diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a414bf0cd5..2eca5a86b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -256,7 +256,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: "1.19.9" + go-version: "1.22.5" - run: | cd wormchain make proto -B diff --git a/.github/workflows/wormchain-icts.yml b/.github/workflows/wormchain-icts.yml new file mode 100644 index 0000000000..4b5c7c9dcd --- /dev/null +++ b/.github/workflows/wormchain-icts.yml @@ -0,0 +1,111 @@ +name: Wormchain's end-to-end Interchain Tests + +on: + pull_request: + push: + tags: + - "**" + branches: + - "main" + +permissions: + contents: read + packages: write + +env: + GO_VERSION: 1.22.0 + TAR_PATH: /tmp/wormchain-docker-image.tar + IMAGE_NAME: wormchain-docker-image + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: wormchain/interchaintest/go.sum + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and export + uses: docker/build-push-action@v5 + with: + context: . + file: wormchain/Dockerfile.ict + tags: wormchain:local + outputs: type=docker,dest=${{ env.TAR_PATH }} + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME }} + path: ${{ env.TAR_PATH }} + + e2e-tests: + needs: build-docker + runs-on: ubuntu-latest + strategy: + matrix: + # names of `make` commands to run tests + test: + - "ictest-cancel-upgrade" + - "ictest-chain-start" + - "ictest-malformed-payload" + - "ictest-guardian-set-proposal" + - "ictest-wormhole-message-proposal" + - "ictest-upgrade-failure" + - "ictest-upgrade" + - "ictest-wasmd-ante" + - "ictest-wormchain" + fail-fast: false + + steps: + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: interchaintest/go.sum + + - name: checkout chain + uses: actions/checkout@v4 + + - name: Download Tarball Artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.IMAGE_NAME }} + path: /tmp + + - name: Load Docker Image + run: | + docker image load -i ${{ env.TAR_PATH }} + docker image ls -a + + - name: Run Test + id: run_test + continue-on-error: true + working-directory: wormchain + run: make ${{ matrix.test }} + + - name: Retry Failed Test + if: steps.run_test.outcome == 'failure' + working-directory: wormchain + run: | + for i in 1 2; do + echo "Retry attempt $i" + if make ${{ matrix.test }}; then + echo "Test passed on retry" + exit 0 + fi + done + echo "Test failed after retries" + exit 1 \ No newline at end of file diff --git a/Tiltfile b/Tiltfile index 1c9042d02e..98e65f80df 100644 --- a/Tiltfile +++ b/Tiltfile @@ -814,15 +814,15 @@ if wormchain: dockerfile = "./wormchain/Dockerfile", build_args = {"num_guardians": str(num_guardians)}, only = [], - ignore = ["./wormchain/testing", "./wormchain/ts-sdk", "./wormchain/design", "./wormchain/vue", "./wormchain/build/wormchaind"], + ignore = ["./wormchain/testing", "./wormchain/ts-sdk", "./wormchain/design", "./wormchain/ts-client", "./wormchain/build/wormchaind"], ) - # docker_build( - # ref = "vue-export", - # context = ".", - # dockerfile = "./wormchain/Dockerfile.proto", - # target = "vue-export", - # ) + docker_build( + ref = "ts-client-export", + context = ".", + dockerfile = "./wormchain/Dockerfile.proto", + target = "ts-client-export", + ) docker_build( ref = "wormchain-deploy", diff --git a/cspell-custom-words.txt b/cspell-custom-words.txt index 33017133b6..a7e25d5cf4 100644 --- a/cspell-custom-words.txt +++ b/cspell-custom-words.txt @@ -1,5 +1,5 @@ -acala Acala +acala Acks Alertmanager algod @@ -12,8 +12,8 @@ authorisation authorise authorised backdoors -bech Bech +bech behaviour Berachain bigset @@ -25,8 +25,8 @@ bytecodes callstack ccqlistener CCTP -celestia Celestia +celestia celo certusone Chainlink @@ -37,8 +37,8 @@ Concat conftest Cosm cosmoshub -cosmwasm Cosmwasm +cosmwasm counterparty cpus crosschain @@ -46,8 +46,8 @@ Cyfrin datagram denoms devnet -dymension Dymension +dymension ethcrypto ethersproject ETHRPC @@ -59,16 +59,16 @@ funder gogoproto goimports gossipv -guardiand GUARDIAND +guardiand guardiand's Hacken hashdump -healthcheck Healthcheck +healthcheck hexdump -holesky Holesky +holesky horcrux ICCO incentivized @@ -76,28 +76,28 @@ incentivizing initialisation initialised initialiser -injective Injective +injective inotify intcblock -ints Ints +ints IPFS journalctl -karura Karura +karura Keccak -kevm KEVM +kevm keymap keytool -klaytn Klaytn +klaytn kompiled kompiles Kudelski -kujira Kujira +kujira lamports lastrun libp @@ -115,11 +115,12 @@ moonscan moretags Neodyme nhooyr -obsv +Nygard Obsv +obsv optimisation -optin Optin +optin parachain pdas permissioned @@ -130,16 +131,17 @@ Polkadot Positionals prefunded promauto -proto Proto +proto protobuf protos prototxt +Pryce's pubkey pushbytes pushint -pytest Pytest +pytest pythnet QUIC ramfs @@ -157,26 +159,29 @@ seievm Sepolia serde setcap -snaxchain SnaxChain -solana +snaxchain Solana +solana Solana's spydk Starport statesync +Strangelove struct structs subdenom -subdenoms Subdenoms +subdenoms +submessage supermajority superminority -tendermint Tendermint +tendermint terrad tokenbridge tokenfactory +toolset trustlessly tsig tsproto @@ -200,16 +205,17 @@ vimdiff vphash wasmhooks wasms +wasmvm WORKDIR worldchain WorldChain -wormchain Wormchain +wormchain wormchaind Wormholescan wormscan wormscanurl xlayer -xpla XPLA -Zellic +xpla +Zellic \ No newline at end of file diff --git a/node/Dockerfile b/node/Dockerfile index 428aae9100..2175f9705c 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -21,8 +21,8 @@ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ export CGO_ENABLED=1 && \ cd node && \ go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-extldflags "-Wl,--allow-multiple-definition" -X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /guardiand github.com/certusone/wormhole/node && \ - go get github.com/CosmWasm/wasmvm@v1.1.1 && \ - cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.1.1/internal/api/libwasmvm.x86_64.so /usr/lib/ + go get github.com/CosmWasm/wasmvm@v1.5.2 && \ + cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.5.2/internal/api/libwasmvm.x86_64.so /usr/lib/ # Only export the final binary (+ shared objects). This reduces the image size # from ~1GB to ~150MB. diff --git a/node/cmd/guardiand/adminclient.go b/node/cmd/guardiand/adminclient.go index ee087431aa..a18fc3e0d5 100644 --- a/node/cmd/guardiand/adminclient.go +++ b/node/cmd/guardiand/adminclient.go @@ -214,6 +214,7 @@ var Keccak256Hash = &cobra.Command{ } func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, nodev1.NodePrivilegedServiceClient, error) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { @@ -225,6 +226,7 @@ func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, nodev1. } func getPublicRPCServiceClient(ctx context.Context, addr string) (*grpc.ClientConn, publicrpcv1.PublicRPCServiceClient, error) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { diff --git a/node/cmd/guardiand/admintemplate.go b/node/cmd/guardiand/admintemplate.go index a985fbd27b..c0f949d463 100644 --- a/node/cmd/guardiand/admintemplate.go +++ b/node/cmd/guardiand/admintemplate.go @@ -10,11 +10,11 @@ import ( "strings" "github.com/btcsuite/btcutil/bech32" + "github.com/cometbft/cometbft/libs/rand" "github.com/ethereum/go-ethereum/common" "github.com/holiman/uint256" "github.com/mr-tron/base58" "github.com/spf13/pflag" - "github.com/tendermint/tendermint/libs/rand" "github.com/wormhole-foundation/wormhole/sdk/vaa" "github.com/ethereum/go-ethereum/crypto" diff --git a/node/cmd/spy/spy_test.go b/node/cmd/spy/spy_test.go index edd80fc198..1a2452d406 100644 --- a/node/cmd/spy/spy_test.go +++ b/node/cmd/spy/spy_test.go @@ -111,6 +111,7 @@ func bufDialer(context.Context, string) (net.Conn, error) { func grpcClientSetup(t *testing.T) (context.Context, *grpc.ClientConn, spyv1.SpyRPCServiceClient) { ctx := context.Background() creds := grpc.WithTransportCredentials(insecure.NewCredentials()) + //nolint: staticcheck conn, err := grpc.DialContext(ctx, "bufnet", grpc.WithContextDialer(bufDialer), creds) if err != nil { t.Fatalf("Failed to dial bufnet: %v", err) diff --git a/node/go.mod b/node/go.mod index 4d2bc8912d..0db5b192da 100644 --- a/node/go.mod +++ b/node/go.mod @@ -4,110 +4,134 @@ go 1.23.3 require ( github.com/celo-org/celo-blockchain v1.5.5 - github.com/cenkalti/backoff/v4 v4.2.0 + github.com/cenkalti/backoff/v4 v4.2.1 + github.com/cometbft/cometbft v0.37.9 github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf - github.com/davecgh/go-spew v1.1.1 + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/dgraph-io/badger/v3 v3.2103.1 - github.com/ethereum/go-ethereum v1.10.21 + github.com/ethereum/go-ethereum v1.10.26 github.com/gagliardetto/solana-go v1.8.4 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 github.com/improbable-eng/grpc-web v0.15.0 github.com/ipfs/go-log/v2 v2.5.1 github.com/libp2p/go-libp2p v0.33.1 github.com/libp2p/go-libp2p-kad-dht v0.25.2 github.com/libp2p/go-libp2p-pubsub v0.10.0 - github.com/miguelmota/go-ethereum-hdwallet v0.1.0 + github.com/miguelmota/go-ethereum-hdwallet v0.1.2 github.com/mitchellh/go-homedir v1.1.0 github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-multiaddr v0.12.2 github.com/near/borsh-go v0.3.0 - github.com/prometheus/client_golang v1.18.0 - github.com/spf13/cobra v1.6.1 + github.com/prometheus/client_golang v1.20.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.14.0 - github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 - github.com/stretchr/testify v1.8.4 - github.com/tendermint/tendermint v0.34.24 + github.com/spf13/viper v1.18.2 + github.com/status-im/keycard-go v0.2.0 + github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.15.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.19.0 - golang.org/x/sys v0.17.0 + golang.org/x/crypto v0.25.0 + golang.org/x/sys v0.23.0 golang.org/x/time v0.5.0 - google.golang.org/api v0.126.0 - google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/grpc v1.57.1 - google.golang.org/protobuf v1.32.0 + google.golang.org/api v0.172.0 + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 ) require ( - github.com/CosmWasm/wasmd v0.30.0 + cosmossdk.io/math v1.4.0 + github.com/CosmWasm/wasmd v0.45.0 github.com/algorand/go-algorand-sdk v1.23.0 github.com/benbjohnson/clock v1.3.5 github.com/blendle/zapdriver v1.3.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce - github.com/cosmos/cosmos-sdk v0.45.11 + github.com/cosmos/cosmos-sdk v0.47.12 github.com/go-kit/kit v0.12.0 - github.com/golang/snappy v0.0.4 - github.com/google/uuid v1.4.0 - github.com/grafana/dskit v0.0.0-20230201083518-528d8a7d52f2 - github.com/grafana/loki v1.6.2-0.20230721141808-0d81144cfee8 + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb + github.com/google/uuid v1.6.0 + github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b + github.com/grafana/loki/v3 v3.1.1 github.com/hashicorp/golang-lru v0.6.0 - github.com/holiman/uint256 v1.2.1 - github.com/prometheus/client_model v0.6.0 - github.com/prometheus/common v0.47.0 + github.com/holiman/uint256 v1.2.4 + github.com/prometheus/client_model v0.6.1 + github.com/prometheus/common v0.55.0 github.com/wormhole-foundation/wormchain v0.0.0-00010101000000-000000000000 - github.com/wormhole-foundation/wormhole/sdk v0.0.0-20220926172624-4b38dc650bb0 - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a - google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e + github.com/wormhole-foundation/wormhole/sdk v0.0.0-20240705140936-31b01629087c + golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc + google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a gopkg.in/godo.v2 v2.0.9 nhooyr.io/websocket v1.8.7 ) require ( - cloud.google.com/go/compute v1.23.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.7 // indirect + cloud.google.com/go/storage v1.40.0 // indirect contrib.go.opencensus.io/exporter/stackdriver v0.13.11 // indirect + cosmossdk.io/api v0.3.1 // indirect + cosmossdk.io/core v0.6.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.3.1 // indirect + cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/CosmWasm/wasmvm v1.1.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect + github.com/CosmWasm/wasmvm v1.5.2 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/StackExchange/wmi v1.2.1 // indirect - github.com/VictoriaMetrics/fastcache v1.6.0 // indirect - github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/VictoriaMetrics/fastcache v1.12.1 // indirect + github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/algorand/go-codec/codec v1.1.8 // indirect github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect - github.com/armon/go-metrics v0.4.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go v1.44.187 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/aws/aws-sdk-go v1.50.32 // indirect + github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect - github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee // indirect + github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/celo-org/celo-bls-go v0.2.4 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.3 // indirect - github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.4 // indirect - github.com/cosmos/ibc-go/v4 v4.2.2 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 // indirect + github.com/cosmos/ibc-go/v7 v7.6.0 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set v1.8.0 // indirect @@ -116,81 +140,96 @@ require ( github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/elastic/gosigar v0.14.2 // indirect - github.com/fatih/color v1.14.1 // indirect + github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect + github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gagliardetto/binary v0.7.7 // indirect github.com/gagliardetto/treeout v0.1.4 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/analysis v0.21.4 // indirect - github.com/go-openapi/errors v0.20.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/loads v0.21.2 // indirect - github.com/go-openapi/spec v0.20.7 // indirect - github.com/go-openapi/strfmt v0.21.3 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-openapi/validate v0.22.0 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-openapi/analysis v0.22.2 // indirect + github.com/go-openapi/errors v0.21.1 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/loads v0.21.5 // indirect + github.com/go-openapi/spec v0.20.14 // indirect + github.com/go-openapi/strfmt v0.22.2 // indirect + github.com/go-openapi/swag v0.22.9 // indirect + github.com/go-openapi/validate v0.23.0 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gogo/gateway v1.1.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect github.com/gogo/status v1.1.1 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/flatbuffers v1.12.0 // indirect + github.com/google/flatbuffers v2.0.8+incompatible // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect github.com/gorilla/handlers v1.5.1 // indirect - github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765 // indirect + github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 // indirect + github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d // indirect + github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/consul/api v1.18.0 // indirect + github.com/hashicorp/consul/api v1.28.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.2.0 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-sockaddr v1.0.6 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/memberlist v0.5.0 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/huandu/skiplist v1.2.0 // indirect + github.com/huandu/xstrings v1.3.3 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/boxo v0.10.0 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect @@ -205,10 +244,13 @@ require ( github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/koron/go-ssdp v0.0.4 // indirect - github.com/lib/pq v1.10.6 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect @@ -221,13 +263,15 @@ require ( github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect + github.com/manifoldco/promptui v0.9.0 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mgutz/str v1.2.0 // indirect github.com/miekg/dns v1.1.58 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect @@ -235,8 +279,10 @@ require ( github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect @@ -250,6 +296,7 @@ require ( github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect @@ -261,17 +308,18 @@ require ( github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/pires/go-proxyproto v0.7.0 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polydawn/refmt v0.89.0 // indirect - github.com/prometheus/alertmanager v0.25.0 // indirect + github.com/prometheus/alertmanager v0.27.0 // indirect github.com/prometheus/common/sigv4 v0.1.0 // indirect - github.com/prometheus/exporter-toolkit v0.8.2 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/prometheus/prometheus v0.42.0 // indirect + github.com/prometheus/exporter-toolkit v0.11.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/prometheus/prometheus v0.51.0 // indirect github.com/prometheus/tsdb v0.7.1 // indirect github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/quic-go v0.42.0 // indirect @@ -279,53 +327,55 @@ require ( github.com/rakyll/statik v0.1.7 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/regen-network/cosmos-proto v0.3.1 // indirect - github.com/rjeczalik/notify v0.9.1 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/rs/zerolog v1.27.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/rjeczalik/notify v0.9.3 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.10.1 // indirect + github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect - github.com/sercand/kuberesolver/v4 v4.0.0 // indirect + github.com/sercand/kuberesolver/v5 v5.1.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/sirupsen/logrus v1.9.0 // indirect - github.com/soheilhy/cmux v0.1.5 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/sony/gobreaker v0.5.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/afero v1.9.3 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/streamingfast/logging v0.0.0-20220813175024-b4fbb0e893df // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tendermint/btcd v0.1.1 // indirect - github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tendermint/spm v0.1.9 // indirect - github.com/tendermint/tm-db v0.6.7 // indirect github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect + github.com/tidwall/btree v1.6.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect - github.com/tyler-smith/go-bip39 v1.0.2 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect - github.com/weaveworks/common v0.0.0-20230531151736-e2613bee6b73 // indirect - github.com/weaveworks/promrus v1.2.0 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - go.etcd.io/etcd/api/v3 v3.5.5 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect - go.etcd.io/etcd/client/v3 v3.5.5 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.etcd.io/etcd/api/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/v3 v3.5.10 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/collector/featuregate v1.3.0 // indirect + go.opentelemetry.io/collector/pdata v1.3.0 // indirect + go.opentelemetry.io/collector/semconv v0.96.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/dig v1.17.1 // indirect go.uber.org/fx v1.20.1 // indirect @@ -333,31 +383,40 @@ require ( go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/term v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.18.0 // indirect + go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gonum.org/v1/gonum v0.13.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apimachinery v0.29.2 // indirect + k8s.io/client-go v0.29.2 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect lukechampine.com/blake3 v1.2.1 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) // Needed for cosmos-sdk based chains. See // https://github.com/cosmos/cosmos-sdk/issues/10925 for more details. -replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 +replace ( + github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + github.com/cosmos/cosmos-sdk => github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917213759-b3717b72c41a -replace github.com/wormhole-foundation/wormhole/sdk => ../sdk + github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.7.0 + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/wormhole-foundation/wormchain => ../wormchain - -replace github.com/CosmWasm/wasmd v0.30.0 => github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2 - -replace github.com/cosmos/cosmos-sdk => github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + github.com/wormhole-foundation/wormchain => ../wormchain + github.com/wormhole-foundation/wormhole/sdk => ../sdk +) diff --git a/node/go.sum b/node/go.sum index 82ce15f2a7..c659093b17 100644 --- a/node/go.sum +++ b/node/go.sum @@ -1,16 +1,8 @@ -4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= -bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= -cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= -cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= @@ -24,7 +16,6 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= @@ -40,7 +31,6 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= @@ -49,47 +39,176 @@ cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34h cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= +cloud.google.com/go v0.110.9/go.mod h1:rpxevX/0Lqvlbc88b7Sc1SPNdyK1riNBTUU6JXhYNpM= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68= +cloud.google.com/go/accessapproval v1.7.2/go.mod h1:/gShiq9/kK/h8T/eEn1BTzalDvk0mZxJlhfw0p+Xuc0= +cloud.google.com/go/accessapproval v1.7.3/go.mod h1:4l8+pwIxGTNqSf4T3ds8nLO94NQf0W/KnMNuQ9PbnP8= +cloud.google.com/go/accessapproval v1.7.4/go.mod h1:/aTEh45LzplQgFYdQdwPMR9YdX0UlhBmvB84uAmQKUc= cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= +cloud.google.com/go/accesscontextmanager v1.8.0/go.mod h1:uI+AI/r1oyWK99NN8cQ3UK76AMelMzgZCvJfsi2c+ps= +cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo= +cloud.google.com/go/accesscontextmanager v1.8.2/go.mod h1:E6/SCRM30elQJ2PKtFMs2YhfJpZSNcJyejhuzoId4Zk= +cloud.google.com/go/accesscontextmanager v1.8.3/go.mod h1:4i/JkF2JiFbhLnnpnfoTX5vRXfhf9ukhU1ANOTALTOQ= +cloud.google.com/go/accesscontextmanager v1.8.4/go.mod h1:ParU+WbMpD34s5JFEnGAnPBYAgUHozaTmDJU7aCU9+M= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= +cloud.google.com/go/aiplatform v1.45.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= +cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= +cloud.google.com/go/aiplatform v1.50.0/go.mod h1:IRc2b8XAMTa9ZmfJV1BCCQbieWWvDnP1A8znyz5N7y4= +cloud.google.com/go/aiplatform v1.51.0/go.mod h1:IRc2b8XAMTa9ZmfJV1BCCQbieWWvDnP1A8znyz5N7y4= +cloud.google.com/go/aiplatform v1.51.1/go.mod h1:kY3nIMAVQOK2XDqDPHaOuD9e+FdMA6OOpfBjsvaFSOo= +cloud.google.com/go/aiplatform v1.51.2/go.mod h1:hCqVYB3mY45w99TmetEoe8eCQEwZEp9WHxeZdcv9phw= +cloud.google.com/go/aiplatform v1.52.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= +cloud.google.com/go/aiplatform v1.54.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= +cloud.google.com/go/aiplatform v1.57.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= +cloud.google.com/go/aiplatform v1.58.0/go.mod h1:pwZMGvqe0JRkI1GWSZCtnAfrR4K1bv65IHILGA//VEU= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/analytics v0.21.2/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= +cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= +cloud.google.com/go/analytics v0.21.4/go.mod h1:zZgNCxLCy8b2rKKVfC1YkC2vTrpfZmeRCySM3aUbskA= +cloud.google.com/go/analytics v0.21.5/go.mod h1:BQtOBHWTlJ96axpPPnw5CvGJ6i3Ve/qX2fTxR8qWyr8= +cloud.google.com/go/analytics v0.21.6/go.mod h1:eiROFQKosh4hMaNhF85Oc9WO97Cpa7RggD40e/RBy8w= +cloud.google.com/go/analytics v0.22.0/go.mod h1:eiROFQKosh4hMaNhF85Oc9WO97Cpa7RggD40e/RBy8w= cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA= +cloud.google.com/go/apigateway v1.6.2/go.mod h1:CwMC90nnZElorCW63P2pAYm25AtQrHfuOkbRSHj0bT8= +cloud.google.com/go/apigateway v1.6.3/go.mod h1:k68PXWpEs6BVDTtnLQAyG606Q3mz8pshItwPXjgv44Y= +cloud.google.com/go/apigateway v1.6.4/go.mod h1:0EpJlVGH5HwAN4VF4Iec8TAzGN1aQgbxAWGJsnPCGGY= cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs= +cloud.google.com/go/apigeeconnect v1.6.2/go.mod h1:s6O0CgXT9RgAxlq3DLXvG8riw8PYYbU/v25jqP3Dy18= +cloud.google.com/go/apigeeconnect v1.6.3/go.mod h1:peG0HFQ0si2bN15M6QSjEW/W7Gy3NYkWGz7pFz13cbo= +cloud.google.com/go/apigeeconnect v1.6.4/go.mod h1:CapQCWZ8TCjnU0d7PobxhpOdVz/OVJ2Hr/Zcuu1xFx0= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw= +cloud.google.com/go/apigeeregistry v0.7.2/go.mod h1:9CA2B2+TGsPKtfi3F7/1ncCCsL62NXBRfM6iPoGSM+8= +cloud.google.com/go/apigeeregistry v0.8.1/go.mod h1:MW4ig1N4JZQsXmBSwH4rwpgDonocz7FPBSw6XPGHmYw= +cloud.google.com/go/apigeeregistry v0.8.2/go.mod h1:h4v11TDGdeXJDJvImtgK2AFVvMIgGWjSb0HRnBSjcX8= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= +cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY= +cloud.google.com/go/appengine v1.8.2/go.mod h1:WMeJV9oZ51pvclqFN2PqHoGnys7rK0rz6s3Mp6yMvDo= +cloud.google.com/go/appengine v1.8.3/go.mod h1:2oUPZ1LVZ5EXi+AF1ihNAF+S8JrzQ3till5m9VQkrsk= +cloud.google.com/go/appengine v1.8.4/go.mod h1:TZ24v+wXBujtkK77CXCpjZbnuTvsFNT41MUaZ28D6vg= cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg= +cloud.google.com/go/area120 v0.8.2/go.mod h1:a5qfo+x77SRLXnCynFWPUZhnZGeSgvQ+Y0v1kSItkh4= +cloud.google.com/go/area120 v0.8.3/go.mod h1:5zj6pMzVTH+SVHljdSKC35sriR/CVvQZzG/Icdyriw0= +cloud.google.com/go/area120 v0.8.4/go.mod h1:jfawXjxf29wyBXr48+W+GyX/f8fflxp642D/bb9v68M= cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= +cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E= +cloud.google.com/go/artifactregistry v1.14.2/go.mod h1:Xk+QbsKEb0ElmyeMfdHAey41B+qBq3q5R5f5xD4XT3U= +cloud.google.com/go/artifactregistry v1.14.3/go.mod h1:A2/E9GXnsyXl7GUvQ/2CjHA+mVRoWAXC0brg2os+kNI= +cloud.google.com/go/artifactregistry v1.14.4/go.mod h1:SJJcZTMv6ce0LDMUnihCN7WSrI+kBSFV0KIKo8S8aYU= +cloud.google.com/go/artifactregistry v1.14.6/go.mod h1:np9LSFotNWHcjnOgh8UVK0RFPCTUGbO0ve3384xyHfE= cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= +cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ= +cloud.google.com/go/asset v1.15.0/go.mod h1:tpKafV6mEut3+vN9ScGvCHXHj7FALFVta+okxFECHcg= +cloud.google.com/go/asset v1.15.1/go.mod h1:yX/amTvFWRpp5rcFq6XbCxzKT8RJUam1UoboE179jU4= +cloud.google.com/go/asset v1.15.2/go.mod h1:B6H5tclkXvXz7PD22qCA2TDxSVQfasa3iDlM89O2NXs= +cloud.google.com/go/asset v1.15.3/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= +cloud.google.com/go/asset v1.16.0/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= +cloud.google.com/go/asset v1.17.0/go.mod h1:yYLfUD4wL4X589A9tYrv4rFrba0QlDeag0CMcM5ggXU= cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= +cloud.google.com/go/assuredworkloads v1.11.2/go.mod h1:O1dfr+oZJMlE6mw0Bp0P1KZSlj5SghMBvTpZqIcUAW4= +cloud.google.com/go/assuredworkloads v1.11.3/go.mod h1:vEjfTKYyRUaIeA0bsGJceFV2JKpVRgyG2op3jfa59Zs= +cloud.google.com/go/assuredworkloads v1.11.4/go.mod h1:4pwwGNwy1RP0m+y12ef3Q/8PaiWrIDQ6nD2E8kvWI9U= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE= +cloud.google.com/go/automl v1.13.2/go.mod h1:gNY/fUmDEN40sP8amAX3MaXkxcqPIn7F1UIIPZpy4Mg= +cloud.google.com/go/automl v1.13.3/go.mod h1:Y8KwvyAZFOsMAPqUCfNu1AyclbC6ivCUF/MTwORymyY= +cloud.google.com/go/automl v1.13.4/go.mod h1:ULqwX/OLZ4hBVfKQaMtxMSTlPx0GqGbWN8uA/1EqCP8= cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA= +cloud.google.com/go/baremetalsolution v1.2.0/go.mod h1:68wi9AwPYkEWIUT4SvSGS9UJwKzNpshjHsH4lzk8iOw= +cloud.google.com/go/baremetalsolution v1.2.1/go.mod h1:3qKpKIw12RPXStwQXcbhfxVj1dqQGEvcmA+SX/mUR88= +cloud.google.com/go/baremetalsolution v1.2.2/go.mod h1:O5V6Uu1vzVelYahKfwEWRMaS3AbCkeYHy3145s1FkhM= +cloud.google.com/go/baremetalsolution v1.2.3/go.mod h1:/UAQ5xG3faDdy180rCUv47e0jvpp3BFxT+Cl0PFjw5g= cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A= +cloud.google.com/go/batch v1.4.1/go.mod h1:KdBmDD61K0ovcxoRHGrN6GmOBWeAOyCgKD0Mugx4Fkk= +cloud.google.com/go/batch v1.5.0/go.mod h1:KdBmDD61K0ovcxoRHGrN6GmOBWeAOyCgKD0Mugx4Fkk= +cloud.google.com/go/batch v1.5.1/go.mod h1:RpBuIYLkQu8+CWDk3dFD/t/jOCGuUpkpX+Y0n1Xccs8= +cloud.google.com/go/batch v1.6.1/go.mod h1:urdpD13zPe6YOK+6iZs/8/x2VBRofvblLpx0t57vM98= +cloud.google.com/go/batch v1.6.3/go.mod h1:J64gD4vsNSA2O5TtDB5AAux3nJ9iV8U3ilg3JDBYejU= +cloud.google.com/go/batch v1.7.0/go.mod h1:J64gD4vsNSA2O5TtDB5AAux3nJ9iV8U3ilg3JDBYejU= cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= +cloud.google.com/go/beyondcorp v0.6.1/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= +cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= +cloud.google.com/go/beyondcorp v1.0.1/go.mod h1:zl/rWWAFVeV+kx+X2Javly7o1EIQThU4WlkynffL/lk= +cloud.google.com/go/beyondcorp v1.0.2/go.mod h1:m8cpG7caD+5su+1eZr+TSvF6r21NdLJk4f9u4SP2Ntc= +cloud.google.com/go/beyondcorp v1.0.3/go.mod h1:HcBvnEd7eYr+HGDd5ZbuVmBYX019C6CEXBonXbCVwJo= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -99,27 +218,89 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= +cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= +cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= +cloud.google.com/go/bigquery v1.55.0/go.mod h1:9Y5I3PN9kQWuid6183JFhOGOW3GcirA5LpsKCUn+2ec= +cloud.google.com/go/bigquery v1.56.0/go.mod h1:KDcsploXTEY7XT3fDQzMUZlpQLHzE4itubHrnmhUrZA= +cloud.google.com/go/bigquery v1.57.1/go.mod h1:iYzC0tGVWt1jqSzBHqCr3lrRn0u13E8e+AqowBsDgug= +cloud.google.com/go/bigquery v1.58.0/go.mod h1:0eh4mWNY0KrBTjUzLjoYImapGORq9gEPT7MWjCy9lik= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= +cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA= +cloud.google.com/go/billing v1.17.0/go.mod h1:Z9+vZXEq+HwH7bhJkyI4OQcR6TSbeMrjlpEjO2vzY64= +cloud.google.com/go/billing v1.17.1/go.mod h1:Z9+vZXEq+HwH7bhJkyI4OQcR6TSbeMrjlpEjO2vzY64= +cloud.google.com/go/billing v1.17.2/go.mod h1:u/AdV/3wr3xoRBk5xvUzYMS1IawOAPwQMuHgHMdljDg= +cloud.google.com/go/billing v1.17.3/go.mod h1:z83AkoZ7mZwBGT3yTnt6rSGI1OOsHSIi6a5M3mJ8NaU= +cloud.google.com/go/billing v1.17.4/go.mod h1:5DOYQStCxquGprqfuid/7haD7th74kyMBHkjO/OvDtk= +cloud.google.com/go/billing v1.18.0/go.mod h1:5DOYQStCxquGprqfuid/7haD7th74kyMBHkjO/OvDtk= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U= +cloud.google.com/go/binaryauthorization v1.7.0/go.mod h1:Zn+S6QqTMn6odcMU1zDZCJxPjU2tZPV1oDl45lWY154= +cloud.google.com/go/binaryauthorization v1.7.1/go.mod h1:GTAyfRWYgcbsP3NJogpV3yeunbUIjx2T9xVeYovtURE= +cloud.google.com/go/binaryauthorization v1.7.2/go.mod h1:kFK5fQtxEp97m92ziy+hbu+uKocka1qRRL8MVJIgjv0= +cloud.google.com/go/binaryauthorization v1.7.3/go.mod h1:VQ/nUGRKhrStlGr+8GMS8f6/vznYLkdK5vaKfdCIpvU= +cloud.google.com/go/binaryauthorization v1.8.0/go.mod h1:VQ/nUGRKhrStlGr+8GMS8f6/vznYLkdK5vaKfdCIpvU= cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI= +cloud.google.com/go/certificatemanager v1.7.2/go.mod h1:15SYTDQMd00kdoW0+XY5d9e+JbOPjp24AvF48D8BbcQ= +cloud.google.com/go/certificatemanager v1.7.3/go.mod h1:T/sZYuC30PTag0TLo28VedIRIj1KPGcOQzjWAptHa00= +cloud.google.com/go/certificatemanager v1.7.4/go.mod h1:FHAylPe/6IIKuaRmHbjbdLhGhVQ+CWHSD5Jq0k4+cCE= cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc= +cloud.google.com/go/channel v1.17.0/go.mod h1:RpbhJsGi/lXWAUM1eF4IbQGbsfVlg2o8Iiy2/YLfVT0= +cloud.google.com/go/channel v1.17.1/go.mod h1:xqfzcOZAcP4b/hUDH0GkGg1Sd5to6di1HOJn/pi5uBQ= +cloud.google.com/go/channel v1.17.2/go.mod h1:aT2LhnftnyfQceFql5I/mP8mIbiiJS4lWqgXA815zMk= +cloud.google.com/go/channel v1.17.3/go.mod h1:QcEBuZLGGrUMm7kNj9IbU1ZfmJq2apotsV83hbxX7eE= +cloud.google.com/go/channel v1.17.4/go.mod h1:QcEBuZLGGrUMm7kNj9IbU1ZfmJq2apotsV83hbxX7eE= cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/cloudbuild v1.10.1/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= +cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= +cloud.google.com/go/cloudbuild v1.14.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= +cloud.google.com/go/cloudbuild v1.14.1/go.mod h1:K7wGc/3zfvmYWOWwYTgF/d/UVJhS4pu+HAy7PL7mCsU= +cloud.google.com/go/cloudbuild v1.14.2/go.mod h1:Bn6RO0mBYk8Vlrt+8NLrru7WXlQ9/RDWz2uo5KG1/sg= +cloud.google.com/go/cloudbuild v1.14.3/go.mod h1:eIXYWmRt3UtggLnFGx4JvXcMj4kShhVzGndL1LwleEM= +cloud.google.com/go/cloudbuild v1.15.0/go.mod h1:eIXYWmRt3UtggLnFGx4JvXcMj4kShhVzGndL1LwleEM= cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI= +cloud.google.com/go/clouddms v1.7.0/go.mod h1:MW1dC6SOtI/tPNCciTsXtsGNEM0i0OccykPvv3hiYeM= +cloud.google.com/go/clouddms v1.7.1/go.mod h1:o4SR8U95+P7gZ/TX+YbJxehOCsM+fe6/brlrFquiszk= +cloud.google.com/go/clouddms v1.7.2/go.mod h1:Rk32TmWmHo64XqDvW7jgkFQet1tUKNVzs7oajtJT3jU= +cloud.google.com/go/clouddms v1.7.3/go.mod h1:fkN2HQQNUYInAU3NQ3vRLkV2iWs8lIdmBKOx4nrL6Hc= cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= +cloud.google.com/go/cloudtasks v1.11.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= +cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= +cloud.google.com/go/cloudtasks v1.12.2/go.mod h1:A7nYkjNlW2gUoROg1kvJrQGhJP/38UaWwsnuBDOBVUk= +cloud.google.com/go/cloudtasks v1.12.3/go.mod h1:GPVXhIOSGEaR+3xT4Fp72ScI+HjHffSS4B8+BaBB5Ys= +cloud.google.com/go/cloudtasks v1.12.4/go.mod h1:BEPu0Gtt2dU6FxZHNqqNdGqIG86qyWKBPGnsb7udGY0= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -132,232 +313,746 @@ cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/contactcenterinsights v1.9.1/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= +cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= +cloud.google.com/go/contactcenterinsights v1.11.0/go.mod h1:hutBdImE4XNZ1NV4vbPJKSFOnQruhC5Lj9bZqWMTKiU= +cloud.google.com/go/contactcenterinsights v1.11.1/go.mod h1:FeNP3Kg8iteKM80lMwSk3zZZKVxr+PGnAId6soKuXwE= +cloud.google.com/go/contactcenterinsights v1.11.2/go.mod h1:A9PIR5ov5cRcd28KlDbmmXE8Aay+Gccer2h4wzkYFso= +cloud.google.com/go/contactcenterinsights v1.11.3/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= +cloud.google.com/go/contactcenterinsights v1.12.0/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= +cloud.google.com/go/contactcenterinsights v1.12.1/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= +cloud.google.com/go/container v1.22.1/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= +cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= +cloud.google.com/go/container v1.26.0/go.mod h1:YJCmRet6+6jnYYRS000T6k0D0xUXQgBSaJ7VwI8FBj4= +cloud.google.com/go/container v1.26.1/go.mod h1:5smONjPRUxeEpDG7bMKWfDL4sauswqEtnBK1/KKpR04= +cloud.google.com/go/container v1.26.2/go.mod h1:YlO84xCt5xupVbLaMY4s3XNE79MUJ+49VmkInr6HvF4= +cloud.google.com/go/container v1.27.1/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= +cloud.google.com/go/container v1.28.0/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= +cloud.google.com/go/container v1.29.0/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= +cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0= +cloud.google.com/go/containeranalysis v0.11.0/go.mod h1:4n2e99ZwpGxpNcz+YsFT1dfOHPQFGcAC8FN2M2/ne/U= +cloud.google.com/go/containeranalysis v0.11.1/go.mod h1:rYlUOM7nem1OJMKwE1SadufX0JP3wnXj844EtZAwWLY= +cloud.google.com/go/containeranalysis v0.11.2/go.mod h1:xibioGBC1MD2j4reTyV1xY1/MvKaz+fyM9ENWhmIeP8= +cloud.google.com/go/containeranalysis v0.11.3/go.mod h1:kMeST7yWFQMGjiG9K7Eov+fPNQcGhb8mXj/UcTiWw9U= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= +cloud.google.com/go/datacatalog v1.14.0/go.mod h1:h0PrGtlihoutNMp/uvwhawLQ9+c63Kz65UFqh49Yo+E= +cloud.google.com/go/datacatalog v1.14.1/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= +cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= +cloud.google.com/go/datacatalog v1.17.1/go.mod h1:nCSYFHgtxh2MiEktWIz71s/X+7ds/UT9kp0PC7waCzE= +cloud.google.com/go/datacatalog v1.18.0/go.mod h1:nCSYFHgtxh2MiEktWIz71s/X+7ds/UT9kp0PC7waCzE= +cloud.google.com/go/datacatalog v1.18.1/go.mod h1:TzAWaz+ON1tkNr4MOcak8EBHX7wIRX/gZKM+yTVsv+A= +cloud.google.com/go/datacatalog v1.18.2/go.mod h1:SPVgWW2WEMuWHA+fHodYjmxPiMqcOiWfhc9OD5msigk= +cloud.google.com/go/datacatalog v1.18.3/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= +cloud.google.com/go/datacatalog v1.19.0/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= +cloud.google.com/go/datacatalog v1.19.2/go.mod h1:2YbODwmhpLM4lOFe3PuEhHK9EyTzQJ5AXgIy7EDKTEE= cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw= +cloud.google.com/go/dataflow v0.9.2/go.mod h1:vBfdBZ/ejlTaYIGB3zB4T08UshH70vbtZeMD+urnUSo= +cloud.google.com/go/dataflow v0.9.3/go.mod h1:HI4kMVjcHGTs3jTHW/kv3501YW+eloiJSLxkJa/vqFE= +cloud.google.com/go/dataflow v0.9.4/go.mod h1:4G8vAkHYCSzU8b/kmsoR2lWyHJD85oMJPHMtan40K8w= cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M= +cloud.google.com/go/dataform v0.8.2/go.mod h1:X9RIqDs6NbGPLR80tnYoPNiO1w0wenKTb8PxxlhTMKM= +cloud.google.com/go/dataform v0.8.3/go.mod h1:8nI/tvv5Fso0drO3pEjtowz58lodx8MVkdV2q0aPlqg= +cloud.google.com/go/dataform v0.9.1/go.mod h1:pWTg+zGQ7i16pyn0bS1ruqIE91SdL2FDMvEYu/8oQxs= cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI= +cloud.google.com/go/datafusion v1.7.2/go.mod h1:62K2NEC6DRlpNmI43WHMWf9Vg/YvN6QVi8EVwifElI0= +cloud.google.com/go/datafusion v1.7.3/go.mod h1:eoLt1uFXKGBq48jy9LZ+Is8EAVLnmn50lNncLzwYokE= +cloud.google.com/go/datafusion v1.7.4/go.mod h1:BBs78WTOLYkT4GVZIXQCZT3GFpkpDN4aBY4NDX/jVlM= cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY= +cloud.google.com/go/datalabeling v0.8.2/go.mod h1:cyDvGHuJWu9U/cLDA7d8sb9a0tWLEletStu2sTmg3BE= +cloud.google.com/go/datalabeling v0.8.3/go.mod h1:tvPhpGyS/V7lqjmb3V0TaDdGvhzgR1JoW7G2bpi2UTI= +cloud.google.com/go/datalabeling v0.8.4/go.mod h1:Z1z3E6LHtffBGrNUkKwbwbDxTiXEApLzIgmymj8A3S8= cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataplex v1.8.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= +cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= +cloud.google.com/go/dataplex v1.9.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= +cloud.google.com/go/dataplex v1.10.1/go.mod h1:1MzmBv8FvjYfc7vDdxhnLFNskikkB+3vl475/XdCDhs= +cloud.google.com/go/dataplex v1.10.2/go.mod h1:xdC8URdTrCrZMW6keY779ZT1cTOfV8KEPNsw+LTRT1Y= +cloud.google.com/go/dataplex v1.11.1/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= +cloud.google.com/go/dataplex v1.11.2/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= +cloud.google.com/go/dataplex v1.13.0/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= +cloud.google.com/go/dataplex v1.14.0/go.mod h1:mHJYQQ2VEJHsyoC0OdNyy988DvEbPhqFs5OOLffLX0c= cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4= +cloud.google.com/go/dataproc/v2 v2.2.0/go.mod h1:lZR7AQtwZPvmINx5J87DSOOpTfof9LVZju6/Qo4lmcY= +cloud.google.com/go/dataproc/v2 v2.2.1/go.mod h1:QdAJLaBjh+l4PVlVZcmrmhGccosY/omC1qwfQ61Zv/o= +cloud.google.com/go/dataproc/v2 v2.2.2/go.mod h1:aocQywVmQVF4i8CL740rNI/ZRpsaaC1Wh2++BJ7HEJ4= +cloud.google.com/go/dataproc/v2 v2.2.3/go.mod h1:G5R6GBc9r36SXv/RtZIVfB8SipI+xVn0bX5SxUzVYbY= +cloud.google.com/go/dataproc/v2 v2.3.0/go.mod h1:G5R6GBc9r36SXv/RtZIVfB8SipI+xVn0bX5SxUzVYbY= cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8= +cloud.google.com/go/dataqna v0.8.2/go.mod h1:KNEqgx8TTmUipnQsScOoDpq/VlXVptUqVMZnt30WAPs= +cloud.google.com/go/dataqna v0.8.3/go.mod h1:wXNBW2uvc9e7Gl5k8adyAMnLush1KVV6lZUhB+rqNu4= +cloud.google.com/go/dataqna v0.8.4/go.mod h1:mySRKjKg5Lz784P6sCov3p1QD+RZQONRMRjzGNcFd0c= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= +cloud.google.com/go/datastore v1.12.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= +cloud.google.com/go/datastore v1.12.1/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= +cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= +cloud.google.com/go/datastore v1.14.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= +cloud.google.com/go/datastore v1.15.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/datastream v1.9.1/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= +cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= +cloud.google.com/go/datastream v1.10.1/go.mod h1:7ngSYwnw95YFyTd5tOGBxHlOZiL+OtpjheqU7t2/s/c= +cloud.google.com/go/datastream v1.10.2/go.mod h1:W42TFgKAs/om6x/CdXX5E4oiAsKlH+e8MTGy81zdYt0= +cloud.google.com/go/datastream v1.10.3/go.mod h1:YR0USzgjhqA/Id0Ycu1VvZe8hEWwrkjuXrGbzeDOSEA= cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= +cloud.google.com/go/deploy v1.11.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= +cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= +cloud.google.com/go/deploy v1.13.1/go.mod h1:8jeadyLkH9qu9xgO3hVWw8jVr29N1mnW42gRJT8GY6g= +cloud.google.com/go/deploy v1.14.1/go.mod h1:N8S0b+aIHSEeSr5ORVoC0+/mOPUysVt8ae4QkZYolAw= +cloud.google.com/go/deploy v1.14.2/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= +cloud.google.com/go/deploy v1.15.0/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= +cloud.google.com/go/deploy v1.16.0/go.mod h1:e5XOUI5D+YGldyLNZ21wbp9S8otJbBE4i88PtO9x/2g= +cloud.google.com/go/deploy v1.17.0/go.mod h1:XBr42U5jIr64t92gcpOXxNrqL2PStQCXHuKK5GRUuYo= cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dialogflow v1.38.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= +cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= +cloud.google.com/go/dialogflow v1.43.0/go.mod h1:pDUJdi4elL0MFmt1REMvFkdsUTYSHq+rTCS8wg0S3+M= +cloud.google.com/go/dialogflow v1.44.0/go.mod h1:pDUJdi4elL0MFmt1REMvFkdsUTYSHq+rTCS8wg0S3+M= +cloud.google.com/go/dialogflow v1.44.1/go.mod h1:n/h+/N2ouKOO+rbe/ZnI186xImpqvCVj2DdsWS/0EAk= +cloud.google.com/go/dialogflow v1.44.2/go.mod h1:QzFYndeJhpVPElnFkUXxdlptx0wPnBWLCBT9BvtC3/c= +cloud.google.com/go/dialogflow v1.44.3/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= +cloud.google.com/go/dialogflow v1.47.0/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= +cloud.google.com/go/dialogflow v1.48.0/go.mod h1:mHly4vU7cPXVweuB5R0zsYKPMzy240aQdAu06SqBbAQ= +cloud.google.com/go/dialogflow v1.48.1/go.mod h1:C1sjs2/g9cEwjCltkKeYp3FFpz8BOzNondEaAlCpt+A= cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI= +cloud.google.com/go/dlp v1.10.2/go.mod h1:ZbdKIhcnyhILgccwVDzkwqybthh7+MplGC3kZVZsIOQ= +cloud.google.com/go/dlp v1.10.3/go.mod h1:iUaTc/ln8I+QT6Ai5vmuwfw8fqTk2kaz0FvCwhLCom0= +cloud.google.com/go/dlp v1.11.1/go.mod h1:/PA2EnioBeXTL/0hInwgj0rfsQb3lpE3R8XUJxqUNKI= cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= +cloud.google.com/go/documentai v1.20.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= +cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= +cloud.google.com/go/documentai v1.22.1/go.mod h1:LKs22aDHbJv7ufXuPypzRO7rG3ALLJxzdCXDPutw4Qc= +cloud.google.com/go/documentai v1.23.0/go.mod h1:LKs22aDHbJv7ufXuPypzRO7rG3ALLJxzdCXDPutw4Qc= +cloud.google.com/go/documentai v1.23.2/go.mod h1:Q/wcRT+qnuXOpjAkvOV4A+IeQl04q2/ReT7SSbytLSo= +cloud.google.com/go/documentai v1.23.4/go.mod h1:4MYAaEMnADPN1LPN5xboDR5QVB6AgsaxgFdJhitlE2Y= +cloud.google.com/go/documentai v1.23.5/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= +cloud.google.com/go/documentai v1.23.6/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= +cloud.google.com/go/documentai v1.23.7/go.mod h1:ghzBsyVTiVdkfKaUCum/9bGBEyBjDO4GfooEcYKhN+g= cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE= +cloud.google.com/go/domains v0.9.2/go.mod h1:3YvXGYzZG1Temjbk7EyGCuGGiXHJwVNmwIf+E/cUp5I= +cloud.google.com/go/domains v0.9.3/go.mod h1:29k66YNDLDY9LCFKpGFeh6Nj9r62ZKm5EsUJxAl84KU= +cloud.google.com/go/domains v0.9.4/go.mod h1:27jmJGShuXYdUNjyDG0SodTfT5RwLi7xmH334Gvi3fY= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk= +cloud.google.com/go/edgecontainer v1.1.2/go.mod h1:wQRjIzqxEs9e9wrtle4hQPSR1Y51kqN75dgF7UllZZ4= +cloud.google.com/go/edgecontainer v1.1.3/go.mod h1:Ll2DtIABzEfaxaVSbwj3QHFaOOovlDFiWVDu349jSsA= +cloud.google.com/go/edgecontainer v1.1.4/go.mod h1:AvFdVuZuVGdgaE5YvlL1faAoa1ndRR/5XhXZvPBHbsE= cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4= +cloud.google.com/go/essentialcontacts v1.6.3/go.mod h1:yiPCD7f2TkP82oJEFXFTou8Jl8L6LBRPeBEkTaO0Ggo= +cloud.google.com/go/essentialcontacts v1.6.4/go.mod h1:iju5Vy3d9tJUg0PYMd1nHhjV7xoCXaOAVabrwLaPBEM= +cloud.google.com/go/essentialcontacts v1.6.5/go.mod h1:jjYbPzw0x+yglXC890l6ECJWdYeZ5dlYACTFL0U/VuM= cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/eventarc v1.12.1/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= +cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= +cloud.google.com/go/eventarc v1.13.1/go.mod h1:EqBxmGHFrruIara4FUQ3RHlgfCn7yo1HYsu2Hpt/C3Y= +cloud.google.com/go/eventarc v1.13.2/go.mod h1:X9A80ShVu19fb4e5sc/OLV7mpFUKZMwfJFeeWhcIObM= +cloud.google.com/go/eventarc v1.13.3/go.mod h1:RWH10IAZIRcj1s/vClXkBgMHwh59ts7hSWcqD3kaclg= cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4= +cloud.google.com/go/filestore v1.7.2/go.mod h1:TYOlyJs25f/omgj+vY7/tIG/E7BX369triSPzE4LdgE= +cloud.google.com/go/filestore v1.7.3/go.mod h1:Qp8WaEERR3cSkxToxFPHh/b8AACkSut+4qlCjAmKTV0= +cloud.google.com/go/filestore v1.7.4/go.mod h1:S5JCxIbFjeBhWMTfIYH2Jx24J6BqjwpkkPl+nBA5DlI= +cloud.google.com/go/filestore v1.8.0/go.mod h1:S5JCxIbFjeBhWMTfIYH2Jx24J6BqjwpkkPl+nBA5DlI= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/firestore v1.11.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= +cloud.google.com/go/firestore v1.12.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= +cloud.google.com/go/firestore v1.13.0/go.mod h1:QojqqOh8IntInDUSTAh0c8ZsPYAr68Ma8c5DWOy8xb8= +cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= +cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE= +cloud.google.com/go/functions v1.15.2/go.mod h1:CHAjtcR6OU4XF2HuiVeriEdELNcnvRZSk1Q8RMqy4lE= +cloud.google.com/go/functions v1.15.3/go.mod h1:r/AMHwBheapkkySEhiZYLDBwVJCdlRwsm4ieJu35/Ug= +cloud.google.com/go/functions v1.15.4/go.mod h1:CAsTc3VlRMVvx+XqXxKqVevguqJpnVip4DdonFsX28I= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gaming v1.10.1/go.mod h1:XQQvtfP8Rb9Rxnxm5wFVpAp9zCQkJi2bLIb7iHGwB3s= cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= +cloud.google.com/go/gkebackup v1.3.1/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= +cloud.google.com/go/gkebackup v1.3.2/go.mod h1:OMZbXzEJloyXMC7gqdSB+EOEQ1AKcpGYvO3s1ec5ixk= +cloud.google.com/go/gkebackup v1.3.3/go.mod h1:eMk7/wVV5P22KBakhQnJxWSVftL1p4VBFLpv0kIft7I= +cloud.google.com/go/gkebackup v1.3.4/go.mod h1:gLVlbM8h/nHIs09ns1qx3q3eaXcGSELgNu1DWXYz1HI= cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw= +cloud.google.com/go/gkeconnect v0.8.2/go.mod h1:6nAVhwchBJYgQCXD2pHBFQNiJNyAd/wyxljpaa6ZPrY= +cloud.google.com/go/gkeconnect v0.8.3/go.mod h1:i9GDTrfzBSUZGCe98qSu1B8YB8qfapT57PenIb820Jo= +cloud.google.com/go/gkeconnect v0.8.4/go.mod h1:84hZz4UMlDCKl8ifVW8layK4WHlMAFeq8vbzjU0yJkw= cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= +cloud.google.com/go/gkehub v0.14.2/go.mod h1:iyjYH23XzAxSdhrbmfoQdePnlMj2EWcvnR+tHdBQsCY= +cloud.google.com/go/gkehub v0.14.3/go.mod h1:jAl6WafkHHW18qgq7kqcrXYzN08hXeK/Va3utN8VKg8= +cloud.google.com/go/gkehub v0.14.4/go.mod h1:Xispfu2MqnnFt8rV/2/3o73SK1snL8s9dYJ9G2oQMfc= cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= +cloud.google.com/go/gkemulticloud v0.6.1/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= +cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= +cloud.google.com/go/gkemulticloud v1.0.1/go.mod h1:AcrGoin6VLKT/fwZEYuqvVominLriQBCKmbjtnbMjG8= +cloud.google.com/go/gkemulticloud v1.0.2/go.mod h1:+ee5VXxKb3H1l4LZAcgWB/rvI16VTNTrInWxDjAGsGo= +cloud.google.com/go/gkemulticloud v1.0.3/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0= +cloud.google.com/go/gkemulticloud v1.1.0/go.mod h1:7NpJBN94U6DY1xHIbsDqB2+TFZUfjLUKLjUX8NGLor0= cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8= cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= +cloud.google.com/go/gsuiteaddons v1.6.2/go.mod h1:K65m9XSgs8hTF3X9nNTPi8IQueljSdYo9F+Mi+s4MyU= +cloud.google.com/go/gsuiteaddons v1.6.3/go.mod h1:sCFJkZoMrLZT3JTb8uJqgKPNshH2tfXeCwTFRebTq48= +cloud.google.com/go/gsuiteaddons v1.6.4/go.mod h1:rxtstw7Fx22uLOXBpsvb9DUbC+fiXs7rF4U29KHM/pE= cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.0.1/go.mod h1:yR3tmSL8BcZB4bxByRv2jkSIahVmCtfKZwLYGBalRE8= +cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= +cloud.google.com/go/iam v1.1.4/go.mod h1:l/rg8l1AaA+VFMho/HYx2Vv6xinPSLMF8qfhRPIZ0L8= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.7 h1:z4VHOhwKLF/+UYXAJDFwGtNF0b6gjsW1Pk9Ml0U/IoM= +cloud.google.com/go/iam v1.1.7/go.mod h1:J4PMPg8TtyurAUvSmPj8FF3EDgY1SPRZxcUGrn7WXGA= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ= +cloud.google.com/go/iap v1.9.0/go.mod h1:01OFxd1R+NFrg78S+hoPV5PxEzv22HXaNqUUlmNHFuY= +cloud.google.com/go/iap v1.9.1/go.mod h1:SIAkY7cGMLohLSdBR25BuIxO+I4fXJiL06IBL7cy/5Q= +cloud.google.com/go/iap v1.9.2/go.mod h1:GwDTOs047PPSnwRD0Us5FKf4WDRcVvHg1q9WVkKBhdI= +cloud.google.com/go/iap v1.9.3/go.mod h1:DTdutSZBqkkOm2HEOTBzhZxh2mwwxshfD/h3yofAiCw= cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw= +cloud.google.com/go/ids v1.4.2/go.mod h1:3vw8DX6YddRu9BncxuzMyWn0g8+ooUjI2gslJ7FH3vk= +cloud.google.com/go/ids v1.4.3/go.mod h1:9CXPqI3GedjmkjbMWCUhMZ2P2N7TUMzAkVXYEH2orYU= +cloud.google.com/go/ids v1.4.4/go.mod h1:z+WUc2eEl6S/1aZWzwtVNWoSZslgzPxAboS0lZX0HjI= cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk= +cloud.google.com/go/iot v1.7.2/go.mod h1:q+0P5zr1wRFpw7/MOgDXrG/HVA+l+cSwdObffkrpnSg= +cloud.google.com/go/iot v1.7.3/go.mod h1:t8itFchkol4VgNbHnIq9lXoOOtHNR3uAACQMYbN9N4I= +cloud.google.com/go/iot v1.7.4/go.mod h1:3TWqDVvsddYBG++nHSZmluoCAVGr1hAcabbWZNKEZLk= cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= +cloud.google.com/go/kms v1.11.0/go.mod h1:hwdiYC0xjnWsKQQCQQmIQnS9asjYVSK6jtXm+zFqXLM= +cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= +cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= +cloud.google.com/go/kms v1.15.2/go.mod h1:3hopT4+7ooWRCjc2DxgnpESFxhIraaI2IpAVUEhbT/w= +cloud.google.com/go/kms v1.15.3/go.mod h1:AJdXqHxS2GlPyduM99s9iGqi2nwbviBbhV/hdmt4iOQ= +cloud.google.com/go/kms v1.15.4/go.mod h1:L3Sdj6QTHK8dfwK5D1JLsAyELsNMnd3tAIwGS4ltKpc= +cloud.google.com/go/kms v1.15.5/go.mod h1:cU2H5jnp6G2TDpUGZyqTCoy1n16fbubHZjmVXSMtwDI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0= +cloud.google.com/go/language v1.11.0/go.mod h1:uDx+pFDdAKTY8ehpWbiXyQdz8tDSYLJbQcXsCkjYyvQ= +cloud.google.com/go/language v1.11.1/go.mod h1:Xyid9MG9WOX3utvDbpX7j3tXDmmDooMyMDqgUVpH17U= +cloud.google.com/go/language v1.12.1/go.mod h1:zQhalE2QlQIxbKIZt54IASBzmZpN/aDASea5zl1l+J4= +cloud.google.com/go/language v1.12.2/go.mod h1:9idWapzr/JKXBBQ4lWqVX/hcadxB194ry20m/bTrhWc= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc= +cloud.google.com/go/lifesciences v0.9.2/go.mod h1:QHEOO4tDzcSAzeJg7s2qwnLM2ji8IRpQl4p6m5Z9yTA= +cloud.google.com/go/lifesciences v0.9.3/go.mod h1:gNGBOJV80IWZdkd+xz4GQj4mbqaz737SCLHn2aRhQKM= +cloud.google.com/go/lifesciences v0.9.4/go.mod h1:bhm64duKhMi7s9jR9WYJYvjAFJwRqNj+Nia7hF0Z7JA= cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI= +cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/longrunning v0.4.2/go.mod h1:OHrnaYyLUV6oqwh0xiS7e5sLQhP1m0QU9R+WhGDMgIQ= +cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= +cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc= +cloud.google.com/go/longrunning v0.5.2/go.mod h1:nqo6DQbNV2pXhGDbDMoN2bWz68MjZUzqv2YttZiveCs= +cloud.google.com/go/longrunning v0.5.3/go.mod h1:y/0ga59EYu58J6SHmmQOvekvND2qODbu8ywBBW7EK7Y= +cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak= +cloud.google.com/go/managedidentities v1.6.2/go.mod h1:5c2VG66eCa0WIq6IylRk3TBW83l161zkFvCj28X7jn8= +cloud.google.com/go/managedidentities v1.6.3/go.mod h1:tewiat9WLyFN0Fi7q1fDD5+0N4VUoL0SCX0OTCthZq4= +cloud.google.com/go/managedidentities v1.6.4/go.mod h1:WgyaECfHmF00t/1Uk8Oun3CQ2PGUtjc3e9Alh79wyiM= cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= +cloud.google.com/go/maps v1.3.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= +cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= +cloud.google.com/go/maps v1.4.1/go.mod h1:BxSa0BnW1g2U2gNdbq5zikLlHUuHW0GFWh7sgML2kIY= +cloud.google.com/go/maps v1.5.1/go.mod h1:NPMZw1LJwQZYCfz4y+EIw+SI+24A4bpdFJqdKVr0lt4= +cloud.google.com/go/maps v1.6.1/go.mod h1:4+buOHhYXFBp58Zj/K+Lc1rCmJssxxF4pJ5CJnhdz18= +cloud.google.com/go/maps v1.6.2/go.mod h1:4+buOHhYXFBp58Zj/K+Lc1rCmJssxxF4pJ5CJnhdz18= +cloud.google.com/go/maps v1.6.3/go.mod h1:VGAn809ADswi1ASofL5lveOHPnE6Rk/SFTTBx1yuOLw= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig= +cloud.google.com/go/mediatranslation v0.8.2/go.mod h1:c9pUaDRLkgHRx3irYE5ZC8tfXGrMYwNZdmDqKMSfFp8= +cloud.google.com/go/mediatranslation v0.8.3/go.mod h1:F9OnXTy336rteOEywtY7FOqCk+J43o2RF638hkOQl4Y= +cloud.google.com/go/mediatranslation v0.8.4/go.mod h1:9WstgtNVAdN53m6TQa5GjIjLqKQPXe74hwSCxUP6nj4= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA= +cloud.google.com/go/memcache v1.10.2/go.mod h1:f9ZzJHLBrmd4BkguIAa/l/Vle6uTHzHokdnzSWOdQ6A= +cloud.google.com/go/memcache v1.10.3/go.mod h1:6z89A41MT2DVAW0P4iIRdu5cmRTsbsFn4cyiIx8gbwo= +cloud.google.com/go/memcache v1.10.4/go.mod h1:v/d8PuC8d1gD6Yn5+I3INzLR01IDn0N4Ym56RgikSI0= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/metastore v1.11.1/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= +cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= +cloud.google.com/go/metastore v1.13.0/go.mod h1:URDhpG6XLeh5K+Glq0NOt74OfrPKTwS62gEPZzb5SOk= +cloud.google.com/go/metastore v1.13.1/go.mod h1:IbF62JLxuZmhItCppcIfzBBfUFq0DIB9HPDoLgWrVOU= +cloud.google.com/go/metastore v1.13.2/go.mod h1:KS59dD+unBji/kFebVp8XU/quNSyo8b6N6tPGspKszA= +cloud.google.com/go/metastore v1.13.3/go.mod h1:K+wdjXdtkdk7AQg4+sXS8bRrQa9gcOr+foOMF2tqINE= cloud.google.com/go/monitoring v1.1.0/go.mod h1:L81pzz7HKn14QCMaCs6NTQkdBnE87TElyanS95vIcl4= cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= +cloud.google.com/go/monitoring v1.16.0/go.mod h1:Ptp15HgAyM1fNICAojDMoNc/wUmn67mLHQfyqbw+poY= +cloud.google.com/go/monitoring v1.16.1/go.mod h1:6HsxddR+3y9j+o/cMJH6q/KJ/CBTvM/38L/1m7bTRJ4= +cloud.google.com/go/monitoring v1.16.2/go.mod h1:B44KGwi4ZCF8Rk/5n+FWeispDXoKSk9oss2QNlXJBgc= +cloud.google.com/go/monitoring v1.16.3/go.mod h1:KwSsX5+8PnXv5NJnICZzW2R8pWTis8ypC4zmdRD63Tw= +cloud.google.com/go/monitoring v1.17.0/go.mod h1:KwSsX5+8PnXv5NJnICZzW2R8pWTis8ypC4zmdRD63Tw= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E= +cloud.google.com/go/networkconnectivity v1.13.0/go.mod h1:SAnGPes88pl7QRLUen2HmcBSE9AowVAcdug8c0RSBFk= +cloud.google.com/go/networkconnectivity v1.14.0/go.mod h1:SAnGPes88pl7QRLUen2HmcBSE9AowVAcdug8c0RSBFk= +cloud.google.com/go/networkconnectivity v1.14.1/go.mod h1:LyGPXR742uQcDxZ/wv4EI0Vu5N6NKJ77ZYVnDe69Zug= +cloud.google.com/go/networkconnectivity v1.14.2/go.mod h1:5UFlwIisZylSkGG1AdwK/WZUaoz12PKu6wODwIbFzJo= +cloud.google.com/go/networkconnectivity v1.14.3/go.mod h1:4aoeFdrJpYEXNvrnfyD5kIzs8YtHg945Og4koAjHQek= cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0= +cloud.google.com/go/networkmanagement v1.9.0/go.mod h1:UTUaEU9YwbCAhhz3jEOHr+2/K/MrBk2XxOLS89LQzFw= +cloud.google.com/go/networkmanagement v1.9.1/go.mod h1:CCSYgrQQvW73EJawO2QamemYcOb57LvrDdDU51F0mcI= +cloud.google.com/go/networkmanagement v1.9.2/go.mod h1:iDGvGzAoYRghhp4j2Cji7sF899GnfGQcQRQwgVOWnDw= +cloud.google.com/go/networkmanagement v1.9.3/go.mod h1:y7WMO1bRLaP5h3Obm4tey+NquUvB93Co1oh4wpL+XcU= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= +cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ= +cloud.google.com/go/networksecurity v0.9.2/go.mod h1:jG0SeAttWzPMUILEHDUvFYdQTl8L/E/KC8iZDj85lEI= +cloud.google.com/go/networksecurity v0.9.3/go.mod h1:l+C0ynM6P+KV9YjOnx+kk5IZqMSLccdBqW6GUoF4p/0= +cloud.google.com/go/networksecurity v0.9.4/go.mod h1:E9CeMZ2zDsNBkr8axKSYm8XyTqNhiCHf1JO/Vb8mD1w= cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8= +cloud.google.com/go/notebooks v1.10.0/go.mod h1:SOPYMZnttHxqot0SGSFSkRrwE29eqnKPBJFqgWmiK2k= +cloud.google.com/go/notebooks v1.10.1/go.mod h1:5PdJc2SgAybE76kFQCWrTfJolCOUQXF97e+gteUUA6A= +cloud.google.com/go/notebooks v1.11.1/go.mod h1:V2Zkv8wX9kDCGRJqYoI+bQAaoVeE5kSiz4yYHd2yJwQ= +cloud.google.com/go/notebooks v1.11.2/go.mod h1:z0tlHI/lREXC8BS2mIsUeR3agM1AkgLiS+Isov3SS70= cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk= +cloud.google.com/go/optimization v1.5.0/go.mod h1:evo1OvTxeBRBu6ydPlrIRizKY/LJKo/drDMMRKqGEUU= +cloud.google.com/go/optimization v1.5.1/go.mod h1:NC0gnUD5MWVAF7XLdoYVPmYYVth93Q6BUzqAq3ZwtV8= +cloud.google.com/go/optimization v1.6.1/go.mod h1:hH2RYPTTM9e9zOiTaYPTiGPcGdNZVnBSBxjIAJzUkqo= +cloud.google.com/go/optimization v1.6.2/go.mod h1:mWNZ7B9/EyMCcwNl1frUGEuY6CPijSkz88Fz2vwKPOY= cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8= +cloud.google.com/go/orchestration v1.8.2/go.mod h1:T1cP+6WyTmh6LSZzeUhvGf0uZVmJyTx7t8z7Vg87+A0= +cloud.google.com/go/orchestration v1.8.3/go.mod h1:xhgWAYqlbYjlz2ftbFghdyqENYW+JXuhBx9KsjMoGHs= +cloud.google.com/go/orchestration v1.8.4/go.mod h1:d0lywZSVYtIoSZXb0iFjv9SaL13PGyVOKDxqGxEf/qI= cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/orgpolicy v1.11.0/go.mod h1:2RK748+FtVvnfuynxBzdnyu7sygtoZa1za/0ZfpOs1M= +cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE= +cloud.google.com/go/orgpolicy v1.11.2/go.mod h1:biRDpNwfyytYnmCRWZWxrKF22Nkz9eNVj9zyaBdpm1o= +cloud.google.com/go/orgpolicy v1.11.3/go.mod h1:oKAtJ/gkMjum5icv2aujkP4CxROxPXsBbYGCDbPO8MM= +cloud.google.com/go/orgpolicy v1.11.4/go.mod h1:0+aNV/nrfoTQ4Mytv+Aw+stBDBjNf4d8fYRA9herfJI= +cloud.google.com/go/orgpolicy v1.12.0/go.mod h1:0+aNV/nrfoTQ4Mytv+Aw+stBDBjNf4d8fYRA9herfJI= cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/osconfig v1.12.0/go.mod h1:8f/PaYzoS3JMVfdfTubkowZYGmAhUCjjwnjqWI7NVBc= +cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE= +cloud.google.com/go/osconfig v1.12.2/go.mod h1:eh9GPaMZpI6mEJEuhEjUJmaxvQ3gav+fFEJon1Y8Iw0= +cloud.google.com/go/osconfig v1.12.3/go.mod h1:L/fPS8LL6bEYUi1au832WtMnPeQNT94Zo3FwwV1/xGM= +cloud.google.com/go/osconfig v1.12.4/go.mod h1:B1qEwJ/jzqSRslvdOCI8Kdnp0gSng0xW4LOnIebQomA= cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs= +cloud.google.com/go/oslogin v1.11.0/go.mod h1:8GMTJs4X2nOAUVJiPGqIWVcDaF0eniEto3xlOxaboXE= +cloud.google.com/go/oslogin v1.11.1/go.mod h1:OhD2icArCVNUxKqtK0mcSmKL7lgr0LVlQz+v9s1ujTg= +cloud.google.com/go/oslogin v1.12.1/go.mod h1:VfwTeFJGbnakxAY236eN8fsnglLiVXndlbcNomY4iZU= +cloud.google.com/go/oslogin v1.12.2/go.mod h1:CQ3V8Jvw4Qo4WRhNPF0o+HAM4DiLuE27Ul9CX9g2QdY= +cloud.google.com/go/oslogin v1.13.0/go.mod h1:xPJqLwpTZ90LSE5IL1/svko+6c5avZLluiyylMb/sRA= cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I= +cloud.google.com/go/phishingprotection v0.8.2/go.mod h1:LhJ91uyVHEYKSKcMGhOa14zMMWfbEdxG032oT6ECbC8= +cloud.google.com/go/phishingprotection v0.8.3/go.mod h1:3B01yO7T2Ra/TMojifn8EoGd4G9jts/6cIO0DgDY9J8= +cloud.google.com/go/phishingprotection v0.8.4/go.mod h1:6b3kNPAc2AQ6jZfFHioZKg9MQNybDg4ixFd4RPZZ2nE= cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= +cloud.google.com/go/policytroubleshooter v1.7.1/go.mod h1:0NaT5v3Ag1M7U5r0GfDCpUFkWd9YqpubBWsQlhanRv0= +cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU= +cloud.google.com/go/policytroubleshooter v1.9.0/go.mod h1:+E2Lga7TycpeSTj2FsH4oXxTnrbHJGRlKhVZBLGgU64= +cloud.google.com/go/policytroubleshooter v1.9.1/go.mod h1:MYI8i0bCrL8cW+VHN1PoiBTyNZTstCg2WUw2eVC4c4U= +cloud.google.com/go/policytroubleshooter v1.10.1/go.mod h1:5C0rhT3TDZVxAu8813bwmTvd57Phbl8mr9F4ipOsxEs= +cloud.google.com/go/policytroubleshooter v1.10.2/go.mod h1:m4uF3f6LseVEnMV6nknlN2vYGRb+75ylQwJdnOXfnv0= cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= +cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA= +cloud.google.com/go/privatecatalog v0.9.2/go.mod h1:RMA4ATa8IXfzvjrhhK8J6H4wwcztab+oZph3c6WmtFc= +cloud.google.com/go/privatecatalog v0.9.3/go.mod h1:K5pn2GrVmOPjXz3T26mzwXLcKivfIJ9R5N79AFCF9UE= +cloud.google.com/go/privatecatalog v0.9.4/go.mod h1:SOjm93f+5hp/U3PqMZAHTtBtluqLygrDrVO8X8tYtG0= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w= cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= +cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= +cloud.google.com/go/pubsub v1.34.0/go.mod h1:alj4l4rBg+N3YTFDDC+/YyFTs6JAjam2QfYsddcAW4c= cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= +cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU= +cloud.google.com/go/recaptchaenterprise/v2 v2.8.0/go.mod h1:QuE8EdU9dEnesG8/kG3XuJyNsjEqMlMzg3v3scCJ46c= +cloud.google.com/go/recaptchaenterprise/v2 v2.8.1/go.mod h1:JZYZJOeZjgSSTGP4uz7NlQ4/d1w5hGmksVgM0lbEij0= +cloud.google.com/go/recaptchaenterprise/v2 v2.8.2/go.mod h1:kpaDBOpkwD4G0GVMzG1W6Doy1tFFC97XAV3xy+Rd/pw= +cloud.google.com/go/recaptchaenterprise/v2 v2.8.3/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= +cloud.google.com/go/recaptchaenterprise/v2 v2.8.4/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= +cloud.google.com/go/recaptchaenterprise/v2 v2.9.0/go.mod h1:Dak54rw6lC2gBY8FBznpOCAR58wKf+R+ZSJRoeJok4w= cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE= +cloud.google.com/go/recommendationengine v0.8.2/go.mod h1:QIybYHPK58qir9CV2ix/re/M//Ty10OxjnnhWdaKS1Y= +cloud.google.com/go/recommendationengine v0.8.3/go.mod h1:m3b0RZV02BnODE9FeSvGv1qibFo8g0OnmB/RMwYy4V8= +cloud.google.com/go/recommendationengine v0.8.4/go.mod h1:GEteCf1PATl5v5ZsQ60sTClUE0phbWmo3rQ1Js8louU= cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA= +cloud.google.com/go/recommender v1.11.0/go.mod h1:kPiRQhPyTJ9kyXPCG6u/dlPLbYfFlkwHNRwdzPVAoII= +cloud.google.com/go/recommender v1.11.1/go.mod h1:sGwFFAyI57v2Hc5LbIj+lTwXipGu9NW015rkaEM5B18= +cloud.google.com/go/recommender v1.11.2/go.mod h1:AeoJuzOvFR/emIcXdVFkspVXVTYpliRCmKNYDnyBv6Y= +cloud.google.com/go/recommender v1.11.3/go.mod h1:+FJosKKJSId1MBFeJ/TTyoGQZiEelQQIZMKYYD8ruK4= +cloud.google.com/go/recommender v1.12.0/go.mod h1:+FJosKKJSId1MBFeJ/TTyoGQZiEelQQIZMKYYD8ruK4= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg= +cloud.google.com/go/redis v1.13.2/go.mod h1:0Hg7pCMXS9uz02q+LoEVl5dNHUkIQv+C/3L76fandSA= +cloud.google.com/go/redis v1.13.3/go.mod h1:vbUpCKUAZSYzFcWKmICnYgRAhTFg9r+djWqFxDYXi4U= +cloud.google.com/go/redis v1.14.1/go.mod h1:MbmBxN8bEnQI4doZPC1BzADU4HGocHBk2de3SbgOkqs= cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8= +cloud.google.com/go/resourcemanager v1.9.2/go.mod h1:OujkBg1UZg5lX2yIyMo5Vz9O5hf7XQOSV7WxqxxMtQE= +cloud.google.com/go/resourcemanager v1.9.3/go.mod h1:IqrY+g0ZgLsihcfcmqSe+RKp1hzjXwG904B92AwBz6U= +cloud.google.com/go/resourcemanager v1.9.4/go.mod h1:N1dhP9RFvo3lUfwtfLWVxfUWq8+KUQ+XLlHLH3BoFJ0= cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw= +cloud.google.com/go/resourcesettings v1.6.2/go.mod h1:mJIEDd9MobzunWMeniaMp6tzg4I2GvD3TTmPkc8vBXk= +cloud.google.com/go/resourcesettings v1.6.3/go.mod h1:pno5D+7oDYkMWZ5BpPsb4SO0ewg3IXcmmrUZaMJrFic= +cloud.google.com/go/resourcesettings v1.6.4/go.mod h1:pYTTkWdv2lmQcjsthbZLNBP4QW140cs7wqA3DuqErVI= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE= +cloud.google.com/go/retail v1.14.2/go.mod h1:W7rrNRChAEChX336QF7bnMxbsjugcOCPU44i5kbLiL8= +cloud.google.com/go/retail v1.14.3/go.mod h1:Omz2akDHeSlfCq8ArPKiBxlnRpKEBjUH386JYFLUvXo= +cloud.google.com/go/retail v1.14.4/go.mod h1:l/N7cMtY78yRnJqp5JW8emy7MB1nz8E4t2yfOmklYfg= cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= +cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo= +cloud.google.com/go/run v1.3.0/go.mod h1:S/osX/4jIPZGg+ssuqh6GNgg7syixKe3YnprwehzHKU= +cloud.google.com/go/run v1.3.1/go.mod h1:cymddtZOzdwLIAsmS6s+Asl4JoXIDm/K1cpZTxV4Q5s= +cloud.google.com/go/run v1.3.2/go.mod h1:SIhmqArbjdU/D9M6JoHaAqnAMKLFtXaVdNeq04NjnVE= +cloud.google.com/go/run v1.3.3/go.mod h1:WSM5pGyJ7cfYyYbONVQBN4buz42zFqwG67Q3ch07iK4= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= +cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo= +cloud.google.com/go/scheduler v1.10.2/go.mod h1:O3jX6HRH5eKCA3FutMw375XHZJudNIKVonSCHv7ropY= +cloud.google.com/go/scheduler v1.10.3/go.mod h1:8ANskEM33+sIbpJ+R4xRfw/jzOG+ZFE8WVLy7/yGvbc= +cloud.google.com/go/scheduler v1.10.4/go.mod h1:MTuXcrJC9tqOHhixdbHDFSIuh7xZF2IysiINDuiq6NI= +cloud.google.com/go/scheduler v1.10.5/go.mod h1:MTuXcrJC9tqOHhixdbHDFSIuh7xZF2IysiINDuiq6NI= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= +cloud.google.com/go/secretmanager v1.11.2/go.mod h1:MQm4t3deoSub7+WNwiC4/tRYgDBHJgJPvswqQVB1Vss= +cloud.google.com/go/secretmanager v1.11.3/go.mod h1:0bA2o6FabmShrEy328i67aV+65XoUFFSmVeLBn/51jI= +cloud.google.com/go/secretmanager v1.11.4/go.mod h1:wreJlbS9Zdq21lMzWmJ0XhWW2ZxgPeahsqeV/vZoJ3w= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= +cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA= +cloud.google.com/go/security v1.15.2/go.mod h1:2GVE/v1oixIRHDaClVbHuPcZwAqFM28mXuAKCfMgYIg= +cloud.google.com/go/security v1.15.3/go.mod h1:gQ/7Q2JYUZZgOzqKtw9McShH+MjNvtDpL40J1cT+vBs= +cloud.google.com/go/security v1.15.4/go.mod h1:oN7C2uIZKhxCLiAAijKUCuHLZbIt/ghYEo8MqwD/Ty4= cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ= +cloud.google.com/go/securitycenter v1.23.1/go.mod h1:w2HV3Mv/yKhbXKwOCu2i8bCuLtNP1IMHuiYQn4HJq5s= +cloud.google.com/go/securitycenter v1.24.1/go.mod h1:3h9IdjjHhVMXdQnmqzVnM7b0wMn/1O/U20eWVpMpZjI= +cloud.google.com/go/securitycenter v1.24.2/go.mod h1:l1XejOngggzqwr4Fa2Cn+iWZGf+aBLTXtB/vXjy5vXM= +cloud.google.com/go/securitycenter v1.24.3/go.mod h1:l1XejOngggzqwr4Fa2Cn+iWZGf+aBLTXtB/vXjy5vXM= cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicedirectory v1.10.1/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= +cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= +cloud.google.com/go/servicedirectory v1.11.1/go.mod h1:tJywXimEWzNzw9FvtNjsQxxJ3/41jseeILgwU/QLrGI= +cloud.google.com/go/servicedirectory v1.11.2/go.mod h1:KD9hCLhncWRV5jJphwIpugKwM5bn1x0GyVVD4NO8mGg= +cloud.google.com/go/servicedirectory v1.11.3/go.mod h1:LV+cHkomRLr67YoQy3Xq2tUXBGOs5z5bPofdq7qtiAw= cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g= +cloud.google.com/go/shell v1.7.2/go.mod h1:KqRPKwBV0UyLickMn0+BY1qIyE98kKyI216sH/TuHmc= +cloud.google.com/go/shell v1.7.3/go.mod h1:cTTEz/JdaBsQAeTQ3B6HHldZudFoYBOqjteev07FbIc= +cloud.google.com/go/shell v1.7.4/go.mod h1:yLeXB8eKLxw0dpEmXQ/FjriYrBijNsONpwnWsdPqlKM= cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= +cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= +cloud.google.com/go/spanner v1.49.0/go.mod h1:eGj9mQGK8+hkgSVbHNQ06pQ4oS+cyc4tXXd6Dif1KoM= +cloud.google.com/go/spanner v1.50.0/go.mod h1:eGj9mQGK8+hkgSVbHNQ06pQ4oS+cyc4tXXd6Dif1KoM= +cloud.google.com/go/spanner v1.51.0/go.mod h1:c5KNo5LQ1X5tJwma9rSQZsXNBDNvj4/n8BVc3LNahq0= +cloud.google.com/go/spanner v1.53.0/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= +cloud.google.com/go/spanner v1.55.0/go.mod h1:HXEznMUVhC+PC+HDyo9YFG2Ajj5BQDkcbqB9Z2Ffxi0= cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= +cloud.google.com/go/speech v1.17.1/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= +cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= +cloud.google.com/go/speech v1.19.1/go.mod h1:WcuaWz/3hOlzPFOVo9DUsblMIHwxP589y6ZMtaG+iAA= +cloud.google.com/go/speech v1.19.2/go.mod h1:2OYFfj+Ch5LWjsaSINuCZsre/789zlcCI3SY4oAi2oI= +cloud.google.com/go/speech v1.20.1/go.mod h1:wwolycgONvfz2EDU8rKuHRW3+wc9ILPsAWoikBEWavY= +cloud.google.com/go/speech v1.21.0/go.mod h1:wwolycgONvfz2EDU8rKuHRW3+wc9ILPsAWoikBEWavY= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -367,428 +1062,372 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.40.0 h1:VEpDQV5CJxFmJ6ueWNsKxcr1QAYOXEgxDa+sBbJahPw= +cloud.google.com/go/storage v1.40.0/go.mod h1:Rrj7/hKlG87BLqDJYtwR0fbPld8uJPbQ2ucUMY7Ir0g= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= +cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= +cloud.google.com/go/storagetransfer v1.10.1/go.mod h1:rS7Sy0BtPviWYTTJVWCSV4QrbBitgPeuK4/FKa4IdLs= +cloud.google.com/go/storagetransfer v1.10.2/go.mod h1:meIhYQup5rg9juQJdyppnA/WLQCOguxtk1pr3/vBWzA= +cloud.google.com/go/storagetransfer v1.10.3/go.mod h1:Up8LY2p6X68SZ+WToswpQbQHnJpOty/ACcMafuey8gc= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24= +cloud.google.com/go/talent v1.6.3/go.mod h1:xoDO97Qd4AK43rGjJvyBHMskiEf3KulgYzcH6YWOVoo= +cloud.google.com/go/talent v1.6.4/go.mod h1:QsWvi5eKeh6gG2DlBkpMaFYZYrYUnIpo34f6/V5QykY= +cloud.google.com/go/talent v1.6.5/go.mod h1:Mf5cma696HmE+P2BWJ/ZwYqeJXEeU0UqjHFXVLadEDI= cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk= +cloud.google.com/go/texttospeech v1.7.2/go.mod h1:VYPT6aTOEl3herQjFHYErTlSZJ4vB00Q2ZTmuVgluD4= +cloud.google.com/go/texttospeech v1.7.3/go.mod h1:Av/zpkcgWfXlDLRYob17lqMstGZ3GqlvJXqKMp2u8so= +cloud.google.com/go/texttospeech v1.7.4/go.mod h1:vgv0002WvR4liGuSd5BJbWy4nDn5Ozco0uJymY5+U74= cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E= +cloud.google.com/go/tpu v1.6.2/go.mod h1:NXh3NDwt71TsPZdtGWgAG5ThDfGd32X1mJ2cMaRlVgU= +cloud.google.com/go/tpu v1.6.3/go.mod h1:lxiueqfVMlSToZY1151IaZqp89ELPSrk+3HIQ5HRkbY= +cloud.google.com/go/tpu v1.6.4/go.mod h1:NAm9q3Rq2wIlGnOhpYICNI7+bpBebMJbh0yyp3aNw1Y= cloud.google.com/go/trace v1.0.0/go.mod h1:4iErSByzxkyHWzzlAj63/Gmjz0NH1ASqhJguHpGcr6A= cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk= +cloud.google.com/go/trace v1.10.2/go.mod h1:NPXemMi6MToRFcSxRl2uDnu/qAlAQ3oULUphcHGh1vA= +cloud.google.com/go/trace v1.10.3/go.mod h1:Ke1bgfc73RV3wUFml+uQp7EsDw4dGaETLxB7Iq/r4CY= +cloud.google.com/go/trace v1.10.4/go.mod h1:Nso99EDIK8Mj5/zmB+iGr9dosS/bzWCJ8wGmE6TXNWY= cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.8.1/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= +cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= +cloud.google.com/go/translate v1.9.0/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= +cloud.google.com/go/translate v1.9.1/go.mod h1:TWIgDZknq2+JD4iRcojgeDtqGEp154HN/uL6hMvylS8= +cloud.google.com/go/translate v1.9.2/go.mod h1:E3Tc6rUTsQkVrXW6avbUhKJSr7ZE3j7zNmqzXKHqRrY= +cloud.google.com/go/translate v1.9.3/go.mod h1:Kbq9RggWsbqZ9W5YpM94Q1Xv4dshw/gr/SHfsl5yCZ0= +cloud.google.com/go/translate v1.10.0/go.mod h1:Kbq9RggWsbqZ9W5YpM94Q1Xv4dshw/gr/SHfsl5yCZ0= cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.17.1/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= +cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= +cloud.google.com/go/video v1.20.0/go.mod h1:U3G3FTnsvAGqglq9LxgqzOiBc/Nt8zis8S+850N2DUM= +cloud.google.com/go/video v1.20.1/go.mod h1:3gJS+iDprnj8SY6pe0SwLeC5BUW80NjhwX7INWEuWGU= +cloud.google.com/go/video v1.20.2/go.mod h1:lrixr5JeKNThsgfM9gqtwb6Okuqzfo4VrY2xynaViTA= +cloud.google.com/go/video v1.20.3/go.mod h1:TnH/mNZKVHeNtpamsSPygSR0iHtvrR/cW1/GDjN5+GU= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= +cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo= +cloud.google.com/go/videointelligence v1.11.2/go.mod h1:ocfIGYtIVmIcWk1DsSGOoDiXca4vaZQII1C85qtoplc= +cloud.google.com/go/videointelligence v1.11.3/go.mod h1:tf0NUaGTjU1iS2KEkGWvO5hRHeCkFK3nPo0/cOZhZAo= +cloud.google.com/go/videointelligence v1.11.4/go.mod h1:kPBMAYsTPFiQxMLmmjpcZUMklJp3nC9+ipJJtprccD8= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU= +cloud.google.com/go/vision/v2 v2.7.3/go.mod h1:V0IcLCY7W+hpMKXK1JYE0LV5llEqVmj+UJChjvA1WsM= +cloud.google.com/go/vision/v2 v2.7.4/go.mod h1:ynDKnsDN/0RtqkKxQZ2iatv3Dm9O+HfRb5djl7l4Vvw= +cloud.google.com/go/vision/v2 v2.7.5/go.mod h1:GcviprJLFfK9OLf0z8Gm6lQb6ZFUulvpZws+mm6yPLM= cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro= +cloud.google.com/go/vmmigration v1.7.2/go.mod h1:iA2hVj22sm2LLYXGPT1pB63mXHhrH1m/ruux9TwWLd8= +cloud.google.com/go/vmmigration v1.7.3/go.mod h1:ZCQC7cENwmSWlwyTrZcWivchn78YnFniEQYRWQ65tBo= +cloud.google.com/go/vmmigration v1.7.4/go.mod h1:yBXCmiLaB99hEl/G9ZooNx2GyzgsjKnw5fWcINRgD70= cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vmwareengine v0.4.1/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= +cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= +cloud.google.com/go/vmwareengine v1.0.1/go.mod h1:aT3Xsm5sNx0QShk1Jc1B8OddrxAScYLwzVoaiXfdzzk= +cloud.google.com/go/vmwareengine v1.0.2/go.mod h1:xMSNjIk8/itYrz1JA8nV3Ajg4L4n3N+ugP8JKzk3OaA= +cloud.google.com/go/vmwareengine v1.0.3/go.mod h1:QSpdZ1stlbfKtyt6Iu19M6XRxjmXO+vb5a/R6Fvy2y4= cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs= +cloud.google.com/go/vpcaccess v1.7.2/go.mod h1:mmg/MnRHv+3e8FJUjeSibVFvQF1cCy2MsFaFqxeY1HU= +cloud.google.com/go/vpcaccess v1.7.3/go.mod h1:YX4skyfW3NC8vI3Fk+EegJnlYFatA+dXK4o236EUCUc= +cloud.google.com/go/vpcaccess v1.7.4/go.mod h1:lA0KTvhtEOb/VOdnH/gwPuOzGgM+CWsmGu6bb4IoMKk= cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc= +cloud.google.com/go/webrisk v1.9.2/go.mod h1:pY9kfDgAqxUpDBOrG4w8deLfhvJmejKB0qd/5uQIPBc= +cloud.google.com/go/webrisk v1.9.3/go.mod h1:RUYXe9X/wBDXhVilss7EDLW9ZNa06aowPuinUOPCXH8= +cloud.google.com/go/webrisk v1.9.4/go.mod h1:w7m4Ib4C+OseSr2GL66m0zMBywdrVNTDKsdEsfMl7X0= cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg= +cloud.google.com/go/websecurityscanner v1.6.2/go.mod h1:7YgjuU5tun7Eg2kpKgGnDuEOXWIrh8x8lWrJT4zfmas= +cloud.google.com/go/websecurityscanner v1.6.3/go.mod h1:x9XANObUFR+83Cya3g/B9M/yoHVqzxPnFtgF8yYGAXw= +cloud.google.com/go/websecurityscanner v1.6.4/go.mod h1:mUiyMQ+dGpPPRkHgknIZeCzSHJ45+fY4F52nZFDHm2o= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= -code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= +cloud.google.com/go/workflows v1.12.0/go.mod h1:PYhSk2b6DhZ508tj8HXKaBh+OFe+xdl0dHF/tJdzPQM= +cloud.google.com/go/workflows v1.12.1/go.mod h1:5A95OhD/edtOhQd/O741NSfIMezNTbCwLM1P1tBRGHM= +cloud.google.com/go/workflows v1.12.2/go.mod h1:+OmBIgNqYJPVggnMo9nqmizW0qEXHhmnAzK/CnBqsHc= +cloud.google.com/go/workflows v1.12.3/go.mod h1:fmOUeeqEwPzIU81foMjTRQIdwQHADi/vEr1cx9R1m5g= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= -contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= -contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.11 h1:YzmWJ2OT2K3ouXyMm5FmFQPoDs5TfLjx6Xn5x5CLN0I= contrib.go.opencensus.io/exporter/stackdriver v0.13.11/go.mod h1:I5htMbyta491eUxufwwZPQdcKvvgzMB4O9ni41YnIM8= -contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= -contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= +cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= +cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= +cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= +cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= filippo.io/edwards25519 v1.0.0-alpha.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= -github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= -github.com/Antonboom/errname v0.1.6/go.mod h1:7lz79JAnuoMNDAWE9MeeIr1/c/VpSUWatBv2FH9NYpI= -github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= -github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= -github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= -github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0 h1:MxA59PGoCFb+vCwRQi3PhQEwHj4+r2dhuv9HG+vM7iM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0 h1:bXwSugBiSbgtz7rOtbfGf+woewp4f06orW9OP5BjHLA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0/go.mod h1:Y/HgrePTmGy9HjdSGTqZNa+apUpTVIEVKXJyARP2lrk= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= -github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.22 h1:/GblQdIudfEM3AWWZ0mrYJQSd7JS4S/Mbzh6F0ov0Xc= -github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= -github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= -github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4= -github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/Code-Hex/go-generics-cache v1.3.1 h1:i8rLwyhoyhaerr7JpjtYjJZUcCbWOdiYO3fZXLiEC4g= +github.com/Code-Hex/go-generics-cache v1.3.1/go.mod h1:qxcC9kRVrct9rHeiYpFWSoW1vxyillCVzX13KZG8dl4= +github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= +github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= +github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= +github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0/go.mod h1:LGOGuvEgCfCQsy3JF2tRmpGDpzA53iZfyGEWSPwQ6/4= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.2/go.mod h1:xj0D2jwLdp6tOKLheyZCsfL0nz8DaicmJxSwj3VcHtY= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= -github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim v0.9.3/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.6 h1:U68crOE3y3MPttCMQGywZOLrTeF5HHJ3/vDBCJn9/bA= -github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= +github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= -github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= +github.com/Workiva/go-datastructures v1.1.0 h1:hu20UpgZneBhQ3ZvwiOGlqJSKIosin2Rd5wAKUHEO/k= +github.com/Workiva/go-datastructures v1.1.0/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= +github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/algorand/go-algorand-sdk v1.23.0 h1:wlEV6OgDVc/sLeF2y41bwNG/Lr8EoMnN87Ur8N2Gyyo= github.com/algorand/go-algorand-sdk v1.23.0/go.mod h1:7i2peZBcE48kfoxNZnLA+mklKh812jBKvQ+t4bn0KBQ= github.com/algorand/go-codec v1.1.8/go.mod h1:XhzVs6VVyWMLu6cApb9/192gBjGRVGm5cX5j203Heg4= github.com/algorand/go-codec/codec v1.1.8 h1:lsFuhcOH2LiEhpBH3BVUUkdevVmwCRyvb7FCAAPeY6U= github.com/algorand/go-codec/codec v1.1.8/go.mod h1:tQ3zAJ6ijTps6V+wp8KsGDnPC2uhHVC7ANyrtkIY0bA= -github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI= +github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= +github.com/alicebob/miniredis/v2 v2.30.4/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= -github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= +github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= +github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ= -github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs= -github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= -github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= -github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= -github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= -github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU= -github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.187 h1:D5CsRomPnlwDHJCanL2mtaLIcbhjiWxNh5j8zvaWdJA= -github.com/aws/aws-sdk-go v1.44.187/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.50.32 h1:POt81DvegnpQKM4DMDLlHz1CO6OBnEoQ1gRhYFd7QRY= +github.com/aws/aws-sdk-go v1.50.32/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= +github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3/go.mod h1:CIWtjkly68+yqLPbvwwR/fjNJA/idrtULjZWh2v1ys0= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= -github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg= -github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= -github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/buf v1.4.0/go.mod h1:mwHG7klTHnX+rM/ym8LXGl7vYpVmnwT96xWoRB4H5QI= -github.com/bufbuild/buf v1.7.0/go.mod h1:Go40fMAF46PnPLC7jJgTQhAI95pmC0+VtxFKVC0qLq0= -github.com/bufbuild/connect-go v0.2.0/go.mod h1:4efZ2eXFENwd4p7tuLaL9m0qtTsCOzuBvrohvRGevDM= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72 h1:fUmDBbSvv1uOzo/t8WaxZMVb7BxJ8JECo5lGoR9c5bA= github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72/go.mod h1:OEE5igu/CDjGegM1Jn6ZMo7R6LlV/JChAkjfQQIRLpg= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee h1:BnPxIde0gjtTnc9Er7cxvBk8DHLWhEux0SxayC8dP6I= -github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= -github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= -github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo= +github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= +github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= github.com/celo-org/celo-blockchain v1.5.5 h1:jFoVv2SX6d6nbnOylLBMnkUJLk0wXyS6PANn4ZXARIc= github.com/celo-org/celo-blockchain v1.5.5/go.mod h1:j18Hg9JZeOg6d5pbFC8Y5ykt1NDs9lmHesyHd91r0PE= github.com/celo-org/celo-bls-go v0.2.4 h1:V1y92kM5IRJWQZ6DCwqiKLW7swmUA5y/dPJ9YbU4HfA= @@ -796,44 +1435,34 @@ github.com/celo-org/celo-bls-go v0.2.4/go.mod h1:eXUCLXu5F1yfd3M+3VaUk5ZUXaA0sLK github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= -github.com/chavacava/garif v0.0.0-20220316182200-5cad0b5181d4/go.mod h1:W8EnPSQ8Nv4fUjc/v1/8tHFqhuOJXnRub0dTfuAQktU= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -845,232 +1474,100 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230428030218-4003588d1b74/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= -github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= -github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= +github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= +github.com/cometbft/cometbft v0.37.9 h1:zsW0wfjcnV9L+D4y3FkVQFSFPSbNWJneS9p3gCsWx8o= +github.com/cometbft/cometbft v0.37.9/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/containerd v1.6.3-0.20220401172941-5ff8fce1fcc6/go.mod h1:WSt2SnDLAGWlu+Vl+EWay37seZLKqgRt6XLjIMy8SYM= -github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/continuity v0.2.3-0.20220330195504-d132b287edc8/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fuse-overlayfs-snapshotter v1.0.2/go.mod h1:nRZceC8a7dRm3Ao6cJAwuJWPFiBPaibHiFntRUnzhwU= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.4/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.6/go.mod h1:BWtoWl5ghVymxu6MBjg79W9NZrCRyHIdUtk4cauMe34= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4= -github.com/containerd/stargz-snapshotter v0.11.3/go.mod h1:2j2EAUyvrLU4D9unYlTIwGhDKQIk74KJ9E71lJsQCVM= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/stargz-snapshotter/estargz v0.11.3/go.mod h1:7vRJIcImfY8bpifnMjt+HTJoQxASq7T28MYbP15/Nf0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.3/go.mod h1:xpdkbVAuaH3WzbEabUd5yDsl9SwJA5pABH85425Es2g= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= -github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI= -github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= -github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= -github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= -github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= -github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= -github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= -github.com/cosmos/ibc-go/v4 v4.2.2 h1:1Tdjj4H6L+iGoDmT/zvJDAysWZpE2kW1twl7u6KKIJY= -github.com/cosmos/ibc-go/v4 v4.2.2/go.mod h1:EFFqkrJHQPHWUlw155QUxGuis4Ett4lvewAT5nvX0yU= -github.com/cosmos/interchain-accounts v0.2.4 h1:7UrroFQsCRSp17980mk6anx4YteveIJVkU+a0wlsHQI= -github.com/cosmos/interchain-accounts v0.2.4/go.mod h1:jeiJEb0zg609G0oCrCG0r6Guhb7YbA1uFiwww/1YgZE= -github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= +github.com/cosmos/ibc-go/v7 v7.6.0 h1:S1G5hcIVe9go+jQV6F9+I9yy+hylbJeLiVHUmktQNrM= +github.com/cosmos/ibc-go/v7 v7.6.0/go.mod h1:LifBA7JHRHl95ujjHIaBEHmUqy2qCGyqDCXB7qmAsZk= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= +github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= -github.com/daixiang0/gci v0.3.3/go.mod h1:1Xr2bxnQbDxCqqulUOv8qpGqkgRw9RSCGGjEC2LjF8o= -github.com/daixiang0/gci v0.6.2/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= -github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= @@ -1080,109 +1577,64 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 h1:CuJS05R9jmNlUK8GOxrEELPbfXm0EuGh/30LjkjN5vo= github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70/go.mod h1:EoK/8RFbMEteaCaz89uessDTnCWjbbcr+DXcBh4el5o= -github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/badger/v3 v3.2103.1 h1:zaX53IRg7ycxVlkd5pYdCeFp1FynD6qBGQoQql3R3Hk= github.com/dgraph-io/badger/v3 v3.2103.1/go.mod h1:dULbq6ehJ5K0cGW/1TQ9iSfUk0gbSiToDWmWmTsJ53E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.95.0 h1:S48/byPKui7RHZc1wYEPfRvkcEvToADNb5I3guu95xg= -github.com/digitalocean/godo v1.95.0/go.mod h1:NRpFznZFvhHjBoqZAaOD3khVzsJ3EibzKqFL4R60dmA= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= +github.com/digitalocean/godo v1.109.0 h1:4W97RJLJSUQ3veRZDNbp1Ol3Rbn6Lmt9bKGvfqYI5SU= +github.com/digitalocean/godo v1.109.0/go.mod h1:R6EmmWI8CT1+fCtjWY9UCB+L5uufuZH13wk3YhxycCs= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.13+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.3-0.20211208011758-87521affb077+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.23+incompatible h1:1ZQUUYAdh+oylOT85aA2ZcfRp22jmLhoaEcVEfK8dyA= -github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c= +github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= +github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -1192,84 +1644,53 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= -github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= -github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= +github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= -github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= -github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= -github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= -github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= +github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb h1:IT4JYU7k4ikYg1SCxNI1/Tieq/NFvh6dzLdgi7eu0tM= +github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.1/go.mod h1:D3dpIBojGGNh5UfElmwPu73SwDCm+VKhHYqwlNOk2uQ= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= -github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= -github.com/fzipp/gocyclo v0.5.1/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gagliardetto/binary v0.7.7 h1:QZpT38+sgoPg+TIQjH94sLbl/vX+nlIRA37pEyOsjfY= github.com/gagliardetto/binary v0.7.7/go.mod h1:mUuay5LL8wFVnIlecHakSZMvcdqfs+CsotR5n77kyjM= github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= @@ -1277,171 +1698,100 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= -github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ= -github.com/go-critic/go-critic v0.6.3/go.mod h1:c6b3ZP1MQ7o6lPR7Rv3lEf7pYQUmAcx8ABHgdZCQt/k= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= -github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= -github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= -github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= -github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI= -github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= -github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y= -github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= +github.com/go-openapi/analysis v0.22.2 h1:ZBmNoP2h5omLKr/srIC9bfqrUGzT6g6gNv03HE9Vpj0= +github.com/go-openapi/analysis v0.22.2/go.mod h1:pDF4UbZsQTo/oNuRfAWWd4dAh4yuYf//LYorPTjrpvo= +github.com/go-openapi/errors v0.21.1 h1:rVisxQPdETctjlYntm0Ek4dKf68nAQocCloCT50vWuI= +github.com/go-openapi/errors v0.21.1/go.mod h1:LyiY9bgc7AVVh6wtVvMYEyoj3KJYNoRw92mmvnMWgj8= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/loads v0.21.5 h1:jDzF4dSoHw6ZFADCGltDb2lE4F6De7aWSpe+IcsRzT0= +github.com/go-openapi/loads v0.21.5/go.mod h1:PxTsnFBoBe+z89riT+wYt3prmSBP6GDAQh2l9H1Flz8= +github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= +github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/strfmt v0.22.2 h1:DPYOrm6gexCfZZfXUaXFS4+Jw6HAaIIG0SZ5630f8yw= +github.com/go-openapi/strfmt v0.22.2/go.mod h1:HB/b7TCm91rno75Dembc1dFW/0FPLk5CEXsoF9ReNc4= +github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= +github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= +github.com/go-openapi/validate v0.23.0 h1:2l7PJLzCis4YUGEoW6eoQw3WhyM65WSIcjX6SQnlfDw= +github.com/go-openapi/validate v0.23.0/go.mod h1:EeiAZ5bmpSIOJV1WLfyYF9qp/B1ZgSaEpHTJHtN5cbE= +github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= -github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= -github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -1451,45 +1801,36 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= -github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= -github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -1508,8 +1849,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -1528,52 +1867,25 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ= -github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng= -github.com/golangci/golangci-lint v1.46.2/go.mod h1:3DkdHnxn9eoTTrpT2gB0TEv8KSziuoqe9FitgQLHvAY= -github.com/golangci/golangci-lint v1.48.0/go.mod h1:5N+oxduCho+7yuccW69upg/O7cxjfR/d+IQeiNxGmKM= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= -github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= -github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -1591,30 +1903,26 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE= -github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= +github.com/google/go-pkcs11 v0.2.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= +github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= -github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -1623,44 +1931,43 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= -github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= -github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s= -github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -1672,95 +1979,66 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= -github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= -github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v1.1.1 h1:MuGyqbSxiuVBqkPZ3+Nhbytk1xZxhmfCB2Rg1cJWFWM= -github.com/gophercloud/gophercloud v1.1.1/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.8.0 h1:TM3Jawprb2NrdOnvcHhWJalmKmAmOGgfZElM/3oBYCk= +github.com/gophercloud/gophercloud v1.8.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= -github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904= -github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w= -github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/analysisutil v0.4.1/go.mod h1:18U/DLpRgIUd459wGxVHE0fRgmo1UgHDcbw7F5idXu0= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/grafana/dskit v0.0.0-20230201083518-528d8a7d52f2 h1:IOks+FXJ6iO/pfbaVEf4efNw+YzYBYNCkCabyrbkFTM= -github.com/grafana/dskit v0.0.0-20230201083518-528d8a7d52f2/go.mod h1:zj+5BNZAVmQafV583uLTAOzRr963KPdEm4d6NPmtbwg= -github.com/grafana/loki v1.6.2-0.20230721141808-0d81144cfee8 h1:jRCxKcBOIdHVlsbEpsdpjlgiQ3dTuqzXP8geDFDCNRA= -github.com/grafana/loki v1.6.2-0.20230721141808-0d81144cfee8/go.mod h1:UEcmph7z8jSsvhZ9MUMR4Q3Ua/FagTfHZUzwWxv038U= -github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765 h1:VXitROTlmZtLzvokNe8ZbUKpmwldM4Hy1zdNRO32jKU= -github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765/go.mod h1:DhJMrd2QInI/1CNtTN43BZuTmkccdizW1jZ+F6aHkhY= +github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b h1:x2HCzk29I0o5pRPfqWP/qwhXaPGlcz8pohq5kO1NZoE= +github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ= +github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 h1:X8IKQ0wu40wpvYcKfBcc5T4QnhdQjUhtUtB/1CY89lE= +github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= +github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d h1:YwbJJ/PrVWVdnR+j/EAVuazdeP+Za5qbiH1Vlr+wFXs= +github.com/grafana/jsonparser v0.0.0-20240209175146-098958973a2d/go.mod h1:796sq+UcONnSlzA3RtlBZ+b/hrerkZXiEmO8oMjyRwY= +github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608 h1:ZYk42718kSXOiIKdjZKljWLgBpzL5z1yutKABksQCMg= +github.com/grafana/loki/pkg/push v0.0.0-20231124142027-e52380921608/go.mod h1:f3JSoxBTPXX5ec4FxxeC19nTBSxoTz+cBgS3cYLMcr0= +github.com/grafana/loki/v3 v3.1.1 h1:qTVih7srptLmQQnWGD+pp93sYDnONy5S9sSt3mnZBa4= +github.com/grafana/loki/v3 v3.1.1/go.mod h1:K/xPywBSTmi4laPLMg7FTFOhljjKxoT2oB0y5j8MNCQ= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= -github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2 h1:dygLcbEBA+t/P7ck6a8AkXv6juQ4cK0RHBoh32jxhHM= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2/go.mod h1:Ap9RLCIJVtgQg1/BBgVEfypOAySvvlcpcVQkSzJCH4Y= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 h1:CWyXh/jylQWp2dtiV33mY4iSSp6yf4lmn+c7/tN+ObI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0/go.mod h1:nCLIt0w3Ept2NwF8ThLmrppXsfT07oC8k0XNDxd8sVU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= @@ -1769,24 +2047,16 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= -github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY= -github.com/hanwen/go-fuse/v2 v2.1.1-0.20220112183258-f57e95bda82d/go.mod h1:B1nGE/6RBFyBRC1RRnf23UpwCdyJ31eukw34oAKukAc= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g= -github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= +github.com/hashicorp/consul/api v1.28.2 h1:mXfkRHrpHN4YY3RqL09nXU1eHKLNiuAN4kHvDQ16k/8= +github.com/hashicorp/consul/api v1.28.2/go.mod h1:KyzqzgMEya+IZPcD65YFoOVAgPpbfERu4I/tzG6/ueE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= -github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= -github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= -github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= +github.com/hashicorp/consul/sdk v0.16.0/go.mod h1:7pxqqhqoaPqnBnzXD1StKed62LqJeClzVsUEy85Zr0A= +github.com/hashicorp/cronexpr v1.1.2 h1:wG/ZYIKT+RT3QkOdgYc+xsKWVRgnxJ1OJtjjy84fJ9A= +github.com/hashicorp/cronexpr v1.1.2/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -1796,96 +2066,79 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= +github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEyqO4u9I= +github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4= github.com/hashicorp/golang-lru v0.6.0/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4= -github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= -github.com/hashicorp/nomad/api v0.0.0-20230124213148-69fd1a0e4bf7 h1:XOdd3JHyeQnBRxotBo9ibxBFiYGuYhQU25s/YeV2cTU= -github.com/hashicorp/nomad/api v0.0.0-20230124213148-69fd1a0e4bf7/go.mod h1:xYYd4dybIhRhhzDemKx7Ddt8CvCosgrEek8YM7/cF0A= +github.com/hashicorp/nomad/api v0.0.0-20240306004928-3e7191ccb702 h1:fI1LXuBaS1d9z1kmb++Og6YD8uMRwadXorCwE+xgOFA= +github.com/hashicorp/nomad/api v0.0.0-20240306004928-3e7191ccb702/go.mod h1:z71gkJdrkAt/Rl6C7Q79VE7AwJ5lUF+M+fzFTyIHYB0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0= github.com/hdevalence/ed25519consensus v0.0.0-20201207055737-7fde80a9d5ff/go.mod h1:Feit0l8NcNO4g69XNjwvsR0LGcwMMfzI1TF253rOIlQ= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/hetznercloud/hcloud-go v1.39.0 h1:RUlzI458nGnPR6dlcZlrsGXYC1hQlFbKdm8tVtEQQB0= -github.com/hetznercloud/hcloud-go v1.39.0/go.mod h1:mepQwR6va27S3UQthaEPGS86jtzSY9xWL1e9dyxXpgA= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/hetznercloud/hcloud-go/v2 v2.6.0 h1:RJOA2hHZ7rD1pScA4O1NF6qhkHyUdbbxjHgFNot8928= +github.com/hetznercloud/hcloud-go/v2 v2.6.0/go.mod h1:4J1cSE57+g0WS93IiHLV7ubTHItcp+awzeBp5bM9mfA= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= -github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= -github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= @@ -1893,37 +2146,28 @@ github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3 github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/ionos-cloud/sdk-go/v6 v6.1.3 h1:vb6yqdpiqaytvreM0bsn2pXw+1YDvEk2RKSmBAQvgDQ= -github.com/ionos-cloud/sdk-go/v6 v6.1.3/go.mod h1:Ox3W0iiEz0GHnfY9e5LmAxwklsxguuNFEUSu0gVRTME= +github.com/ionos-cloud/sdk-go/v6 v6.1.11 h1:J/uRN4UWO3wCyGOeDdMKv8LWRzKu6UIkLEaes38Kzh8= +github.com/ionos-cloud/sdk-go/v6 v6.1.11/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= github.com/ipfs/boxo v0.10.0 h1:tdDAxq8jrsbRkYoF+5Rcqyeb91hgWe2hp7iLu7ORZLY= github.com/ipfs/boxo v0.10.0/go.mod h1:Fg+BnfxZ0RPzR0nOodzdIq3A7KgoWAOWsEIImrIQdBM= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= @@ -1941,65 +2185,33 @@ github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g= github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M= -github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= -github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg= -github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= -github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= -github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= -github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= -github.com/jhump/protoreflect v1.12.1-0.20220417024638-438db461d753/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -2013,95 +2225,63 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= -github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.2 h1:M6QQBNxF+CQ8OFvxrT90BA0qBOXymndZnk5q235mFc4= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.6.2/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= -github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= -github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= -github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= @@ -2136,107 +2316,71 @@ github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCy github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linode/linodego v1.12.0 h1:33mOIrZ+gVva14gyJMKPZ85mQGovAvZCEP1ftgmFBjA= -github.com/linode/linodego v1.12.0/go.mod h1:NJlzvlNtdMRRkXb0oN6UWzUkj6t+IBsyveHgZ5Ppjyk= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/linode/linodego v1.29.0 h1:gDSQWAbKMAQX8db9FDCXHhodQPrJmLcmthjx6m+PyV4= +github.com/linode/linodego v1.29.0/go.mod h1:3k6WvCM10gillgYcnoLqIL23ST27BD9HhMsCJWb3Bpk= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= +github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= -github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.2.1/go.mod h1:+Ro3wqY4vakcYNtkBWdZC7dBg1xSB6sp054wWwmeFm0= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/str v1.2.0 h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw= github.com/mgutz/str v1.2.0/go.mod h1:w1v0ofgLaJdoD0HpQ3fycxKD1WtxpjSo151pK/31q6w= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= -github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miguelmota/go-ethereum-hdwallet v0.1.0 h1:8Hn7ps17tTP4uTCgoEe3tB73yCRFQWOiRnG82J95hJc= -github.com/miguelmota/go-ethereum-hdwallet v0.1.0/go.mod h1:f9m9uXokAHA6WNoYOPjj4AqjJS5pquQRiYYj/XSyPYc= +github.com/miguelmota/go-ethereum-hdwallet v0.1.2 h1:mz9LO6V7QCRkLYb0AH17t5R8KeqCe3E+hx9YXpmZeXA= +github.com/miguelmota/go-ethereum-hdwallet v0.1.2/go.mod h1:fdNwFSoBFVBPnU0xpOd6l2ueqsPSH/Gch5kIvSvTGk8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= @@ -2246,89 +2390,48 @@ github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4S github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= -github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ= -github.com/moby/buildkit v0.10.3/go.mod h1:jxeOuly98l9gWHai0Ojrbnczrk/rf+o9/JqNhY+UCSo= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74= -github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74= -github.com/moby/sys/mount v0.3.0/go.mod h1:U2Z3ur2rXPFrFmy4q6WMwWrBOAQGYtYTRVM8BIvzbwk= -github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= -github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= -github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= @@ -2356,47 +2459,26 @@ github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dy github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= -github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/near/borsh-go v0.3.0 h1:+DvG7eApOD3KrHIh7TwZvYzhXUF/OzMTC6aRTUEtW+8= github.com/near/borsh-go v0.3.0/go.mod h1:NeMochZp7jN/pYFuxLkrZtmLqbADmnp/y1+/dL+AsyQ= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= -github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= -github.com/nishanths/exhaustive v0.8.1/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= -github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -2405,99 +2487,35 @@ github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtb github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= -github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.1/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e h1:4cPxUYdgaGzZIT5/j0IfqOrrXmq6bG8AwvwisMXpdrg= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -2508,24 +2526,13 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= -github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ= -github.com/ovh/go-ovh v1.3.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= +github.com/ovh/go-ovh v1.4.3 h1:Gs3V823zwTFpzgGLZNI6ILS4rmxZgJwJCz54Er9LwD0= +github.com/ovh/go-ovh v1.4.3/go.mod h1:AkPXVtgwB6xlKblMjRKJJmjRp+ogrE7fz2lVgcQY8SY= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -2533,82 +2540,61 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= -github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.0/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs= +github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= -github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= -github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/alertmanager v0.25.0 h1:vbXKUR6PYRiZPRIKfmXaG+dmCKG52RtPL4Btl8hQGvg= -github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I= +github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -2616,9 +2602,10 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -2628,58 +2615,30 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= -github.com/prometheus/exporter-toolkit v0.8.2 h1:sbJAfBXQFkG6sUkbwBun8MNdzW9+wd5YfPYofbmj0YM= -github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= +github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/prometheus/prometheus v0.42.0 h1:G769v8covTkOiNckXFIwLx01XE04OE6Fr0JPA0oR2nI= -github.com/prometheus/prometheus v0.42.0/go.mod h1:Pfqb/MLnnR2KK+0vchiaH39jXxvLMBk+3lnIGP4N7Vk= -github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/prometheus/prometheus v0.51.0 h1:aRdjTnmHLved29ILtdzZN2GNvOjWATtA/z+3fYuexOc= +github.com/prometheus/prometheus v0.51.0/go.mod h1:yv4MwOn3yHMQ6MZGHPg/U7Fcyqf+rxqiZfSur6myVtc= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= -github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k= -github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h1:VMX+OnnSw4LicdiEGtRSD/1X8kW7GuEscjYNr4cOIT4= -github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= -github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= @@ -2691,97 +2650,58 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= -github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= -github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= -github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= +github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= -github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= -github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= -github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg= -github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= -github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sashamelentyev/usestdlibvars v1.8.0/go.mod h1:BFt7b5mSVHaaa26ZupiNRV2ODViQBxZZVhtAxAJRrjs= -github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12 h1:Aaz4T7dZp7cB2cv7D/tGtRdSMh48sRaDYr7Jh0HV4qQ= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25 h1:/8rfZAdFfafRXOgz+ZpMZZWZ5pYggCY9t7e/BvjaBHM= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE= -github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A= -github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME= -github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= -github.com/securego/gosec/v2 v2.12.0/go.mod h1:iTpT+eKTw59bSgklBHlSnH5O2tNygHMDxfvMubA4i7I= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sercand/kuberesolver/v4 v4.0.0 h1:frL7laPDG/lFm5n98ODmWnn+cvPpzlkf3LhzuPhcHP4= -github.com/sercand/kuberesolver/v4 v4.0.0/go.mod h1:F4RGyuRmMAjeXHKL+w4P7AwUnPceEAPAhxUgXZjKgvM= +github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aeprPTHb6yY= +github.com/sercand/kuberesolver/v5 v5.1.1/go.mod h1:Fs1KbKhVRnB2aDWN12NjKCB+RgYMWZJ294T3BtmVCpQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= -github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -2808,120 +2728,71 @@ github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go. github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.5.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= -github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= -github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= -github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= +github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= -github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E= -github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= -github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= -github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 h1:8Tn4Gy/DAq7wzV1CxEGv80ujZ+nUvzgwwdCobO/Gj8Y= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4/go.mod h1:AG8F5pdk3x1h7PlRvPoMem3623W+w8HJHrWYkVJ51kk= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917213759-b3717b72c41a h1:wzEW14lmw0sYD2xFceI351+vDbuyZfYSC2o3n8eA5B8= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917213759-b3717b72c41a/go.mod h1:YNwEJnXzW0fS/bAUsMmLvOfe4SEqQ+hSi3GLF49GrZ0= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/streamingfast/logging v0.0.0-20220405224725-2755dab2ce75/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= github.com/streamingfast/logging v0.0.0-20220813175024-b4fbb0e893df h1:P4pTLzwgd6bO3nnlIPnfQ/9Swnx3kSWxItgfkyDFoWo= github.com/streamingfast/logging v0.0.0-20220813175024-b4fbb0e893df/go.mod h1:VlduQ80JcGJSargkRU4Sg9Xo63wZD/l8A5NC/Uo1/uU= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -2931,278 +2802,124 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= -github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/spm v0.1.9 h1:O1DJF4evS8wgk5SZqRcO29irNNtKQmTpvQ0xFzUiczI= -github.com/tendermint/spm v0.1.9/go.mod h1:iHgfQ5YOI6ONc9E7ugGQolVdfSMHpeXfZ/OpXuN/42Q= -github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= -github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= -github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= -github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.20/go.mod h1:KtOwCLYJcsS1ymtAfnjjAtXfXClbqcqjdqzFt2Em1Ac= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= -github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= -github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= -github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= -github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= -github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 h1:xzABM9let0HLLqFypcxvLmlvEciCHL7+Lv+4vwZqecI= github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569/go.mod h1:2Ly+NIftZN4de9zRmENdYbvPQeaVIYKWpLFStLFEBgI= github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= -github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.15.0 h1:5n/pM+v3r5ujuNl4YLZLsQ+UE5jlkLVm7jMzT5Mpolw= github.com/tidwall/gjson v1.15.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= -github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= -github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= -github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= -github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.6.1/go.mod h1:Eo+Opt6pyMW1b6cNllOcDSSoHO0aTJ+iF6BfCUbHltA= -github.com/tomarrell/wrapcheck/v2 v2.6.2/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= -github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= -github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= -github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= -github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho= -github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= -github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= -github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= -github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= -github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= -github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= -github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/weaveworks/common v0.0.0-20230531151736-e2613bee6b73 h1:CMM9+/AgM77vaMXMQedzqPRMuNwjbI0EcdofPqxc9F8= -github.com/weaveworks/common v0.0.0-20230531151736-e2613bee6b73/go.mod h1:rgbeLfJUtEr+G74cwFPR1k/4N0kDeaeSv/qhUNE4hm8= -github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M= -github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole h1:oWRuBpqReZoLX3pXeqz/sTgu3xPzqnxaFW2GWG5vgTs= -github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= -github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2 h1:T5lnEObp6nfp83K1GJSvgaRQ8VQjhokupAsEPWBph4A= -github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2/go.mod h1:BcwmiI8b2fR2MGioz3HeVvON5QjSDfrnUbGu0gKRk5U= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= -github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= +github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= -gitlab.com/bosi/decorder v0.2.1/go.mod h1:6C/nhLSbF6qZbYD8bRmISBwc6vcWdNsiIBkRvjJFrH0= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0= -go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.5 h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8= -go.etcd.io/etcd/client/pkg/v3 v3.5.5/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.etcd.io/etcd/client/v3 v3.5.5 h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI= -go.etcd.io/etcd/client/v3 v3.5.5/go.mod h1:aApjR4WGlSumpnJ2kloS75h6aHUmAyaPLjHMxpc7E7c= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= +go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= +go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= +go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= -go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= -go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= -go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -3215,62 +2932,43 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0/go.mod h1:LsankqVDx4W+RhZNA5uWarULII/MBhF5qwCYxTuyXjs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0/go.mod h1:vHItvsnJtp7ES++nFLLFBzUWny7fJQSvTlxFcqQGUr4= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/collector/featuregate v1.3.0 h1:nrFSx+zfjdisjE9oCx25Aep3nJ9RaUjeE1qFL6eovoU= +go.opentelemetry.io/collector/featuregate v1.3.0/go.mod h1:mm8+xyQfgDmqhyegZRNIQmoKsNnDTwWKFLsdMoXAb7A= +go.opentelemetry.io/collector/pdata v1.3.0 h1:JRYN7tVHYFwmtQhIYbxWeiKSa2L1nCohyAs8sYqKFZo= +go.opentelemetry.io/collector/pdata v1.3.0/go.mod h1:t7W0Undtes53HODPdSujPLTnfSR5fzT+WpL+RTaaayo= +go.opentelemetry.io/collector/semconv v0.96.0 h1:DrZy8BpzJDnN2zFxXRj6BhfGYxNlqpFHBqyuS9fVHRY= +go.opentelemetry.io/collector/semconv v0.96.0/go.mod h1:zOm/U3pgMIWcvrcnPbR9Xx2HinoXj46ERMK8PUV9wrs= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= -go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/exporters/jaeger v1.4.1/go.mod h1:ZW7vkOu9nC1CxsD8bHNHCia5JUbwP39vxgd1q4Z5rCI= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1/go.mod h1:o5RW5o2pKpJLD5dNTCmjF1DorYwMeFJmb/rKr5sLaa8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1/go.mod h1:c6E4V3/U+miqjs/8l950wggHGL1qzlp0Ypj9xoGrPqo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1/go.mod h1:VwYo0Hak6Efuy0TXsZs8o1hnV3dHDPNtDbycG0hI8+M= -go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= -go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= -go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= @@ -3280,18 +2978,14 @@ go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= @@ -3302,29 +2996,22 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= +go4.org/netipx v0.0.0-20230125063823-8449b0a6169f h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s= +go4.org/netipx v0.0.0-20230125063823-8449b0a6169f/go.mod h1:tgPU4N2u9RByaTN3NC2p9xOzyFpte4jYwsIIRF7XlSc= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= -golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -3332,51 +3019,43 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -3384,17 +3063,24 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -3408,12 +3094,10 @@ golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -3424,19 +3108,19 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -3448,20 +3132,14 @@ golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -3479,12 +3157,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -3493,49 +3168,48 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220726230323-06994584191e/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -3545,7 +3219,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -3561,15 +3234,24 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -3577,53 +3259,44 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3631,26 +3304,19 @@ golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3663,55 +3329,34 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210313202042-bd2e13477e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -3719,69 +3364,71 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220403020550-483a9cbc67c0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220727055044-e65921a090b8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -3793,66 +3440,49 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3860,7 +3490,6 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3868,86 +3497,53 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201028025901-8cd080b735b3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12-0.20220628192153-7743d1d949f1/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -3956,29 +3552,26 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= gonum.org/v1/gonum v0.13.0 h1:a0T3bh+7fhRyqeNbiC3qVHYmkiQgit3wnNan/2c0HMM= gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU= -google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= -google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -3992,7 +3585,6 @@ google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= @@ -4001,7 +3593,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -4013,7 +3604,6 @@ google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdr google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= @@ -4023,7 +3613,6 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= @@ -4036,8 +3625,24 @@ google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91 google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E= +google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= +google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= +google.golang.org/api v0.139.0/go.mod h1:CVagp6Eekz9CjGZ718Z+sloknzkDJE7Vc1Ckj9+viBk= +google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= +google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= +google.golang.org/api v0.172.0 h1:/1OcMZGPmW1rX2LCu2CmGUD1KXK1+pfzxotxyRUCCdk= +google.golang.org/api v0.172.0/go.mod h1:+fJZq6QXWfa9pXhnIzsjx4yI22d4aI9ZpLb58gvXjis= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -4047,38 +3652,29 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -4094,19 +3690,12 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200707001353-8e8330bf89df/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -4139,10 +3728,7 @@ google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211018162055-cf77aa76bad2/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= @@ -4162,7 +3748,6 @@ google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= @@ -4170,7 +3755,6 @@ google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= @@ -4190,27 +3774,120 @@ google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= +google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= +google.golang.org/genproto v0.0.0-20230821184602-ccc8af3d0e93/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU= +google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= +google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= +google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577/go.mod h1:NjCQG/D8JandXxM57PZbAJL1DCNL6EypA0vPPwfsc7c= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20231030173426-d783a09b4405/go.mod h1:GRUCuLdzVqZte8+Dl/D4N25yLzcGqqWaYkeVOwulFqw= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20231212172506-995d672761c0/go.mod h1:guYXGPwC6jwxgWKW5Y405fKWOFNwlvUlUnzyp9i0uqo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920183334-c177e329c48b/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -4218,13 +3895,11 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -4243,9 +3918,7 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= @@ -4256,9 +3929,22 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= -google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -4272,54 +3958,42 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/godo.v2 v2.0.9 h1:jnbznTzXVk0JDKOxN3/LJLDPYJzIl0734y+Z0cEJb4A= gopkg.in/godo.v2 v2.0.9/go.mod h1:wgvPPKLsWN0hPIJ4JyxvFGGbIW3fJMSrXhdvSuZ1z/8= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= -gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -4327,26 +4001,20 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -4354,142 +4022,88 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -honnef.co/go/tools v0.3.1/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= -honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= -k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= -k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= -k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc= -k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U= -k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/cri-api v0.24.0-alpha.3/go.mod h1:c/NLI5Zdyup5+oEYqFO2IE32ptofNiZpS1nL2y51gAg= -k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= +k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= +k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= +k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= +k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= -mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= -mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= -mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= +modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= +modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= +modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= +modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/tcl v1.13.2/go.mod h1:7CLiGIPo1M8Rv1Mitpv5akc2+8fxUd2y2UzC/MfMzy0= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= -sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= -sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= diff --git a/node/hack/findmissing/findmissing.go b/node/hack/findmissing/findmissing.go index 92f3040734..1ce3cd82b4 100644 --- a/node/hack/findmissing/findmissing.go +++ b/node/hack/findmissing/findmissing.go @@ -20,6 +20,7 @@ var ( ) func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, error, nodev1.NodePrivilegedServiceClient) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { diff --git a/node/hack/query/ccqlistener/ccqlistener.go b/node/hack/query/ccqlistener/ccqlistener.go index ae59a9ffe4..d20d12ff71 100644 --- a/node/hack/query/ccqlistener/ccqlistener.go +++ b/node/hack/query/ccqlistener/ccqlistener.go @@ -57,12 +57,12 @@ import ( "github.com/certusone/wormhole/node/pkg/p2p" gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1" "github.com/certusone/wormhole/node/pkg/query" + "github.com/cometbft/cometbft/libs/rand" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common/hexutil" ethCrypto "github.com/ethereum/go-ethereum/crypto" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/crypto" - "github.com/tendermint/tendermint/libs/rand" "go.uber.org/zap" "google.golang.org/protobuf/proto" ) diff --git a/node/hack/query/send_req.go b/node/hack/query/send_req.go index 143de5c0e1..7575b56a31 100644 --- a/node/hack/query/send_req.go +++ b/node/hack/query/send_req.go @@ -18,13 +18,13 @@ import ( "github.com/certusone/wormhole/node/pkg/p2p" gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1" "github.com/certusone/wormhole/node/pkg/query" + "github.com/cometbft/cometbft/libs/rand" "github.com/ethereum/go-ethereum/accounts/abi" ethCommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethCrypto "github.com/ethereum/go-ethereum/crypto" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/crypto" - "github.com/tendermint/tendermint/libs/rand" "go.uber.org/zap" "google.golang.org/protobuf/proto" diff --git a/node/hack/repair_eth/repair_eth.go b/node/hack/repair_eth/repair_eth.go index 7063aad5d3..f65bbf2b69 100644 --- a/node/hack/repair_eth/repair_eth.go +++ b/node/hack/repair_eth/repair_eth.go @@ -106,6 +106,7 @@ func usesBlockscout(chainId vaa.ChainID) bool { } func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, error, nodev1.NodePrivilegedServiceClient) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { diff --git a/node/hack/repair_solana/repair.go b/node/hack/repair_solana/repair.go index 99ac2f53be..9a839c964c 100644 --- a/node/hack/repair_solana/repair.go +++ b/node/hack/repair_solana/repair.go @@ -34,6 +34,7 @@ const ( ) func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, error, nodev1.NodePrivilegedServiceClient) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { diff --git a/node/hack/repair_terra/repair.go b/node/hack/repair_terra/repair.go index 224a596ad4..4d90f3f504 100644 --- a/node/hack/repair_terra/repair.go +++ b/node/hack/repair_terra/repair.go @@ -61,6 +61,7 @@ var ( ) func getAdminClient(ctx context.Context, addr string) (*grpc.ClientConn, error, nodev1.NodePrivilegedServiceClient) { + //nolint: staticcheck conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix:///%s", addr), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { diff --git a/node/pkg/accountant/audit.go b/node/pkg/accountant/audit.go index ea8c6c6f98..7a676ffa08 100644 --- a/node/pkg/accountant/audit.go +++ b/node/pkg/accountant/audit.go @@ -27,7 +27,7 @@ import ( gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1" "github.com/wormhole-foundation/wormhole/sdk/vaa" - cosmossdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "go.uber.org/zap" ) @@ -81,10 +81,10 @@ type ( // TransferData contains the detailed data returned for a committed transfer. TransferData struct { - Amount *cosmossdk.Int `json:"amount"` - TokenChain uint16 `json:"token_chain"` - TokenAddress vaa.Address `json:"token_address"` - RecipientChain uint16 `json:"recipient_chain"` + Amount *math.Int `json:"amount"` + TokenChain uint16 `json:"token_chain"` + TokenAddress vaa.Address `json:"token_address"` + RecipientChain uint16 `json:"recipient_chain"` } // TransferStatusPending contains the data returned for a committed transfer. diff --git a/node/pkg/accountant/data_for_test.go b/node/pkg/accountant/data_for_test.go index 7cf2e7c3c7..5a990b2f62 100644 --- a/node/pkg/accountant/data_for_test.go +++ b/node/pkg/accountant/data_for_test.go @@ -5216,7 +5216,7 @@ func createTxRespForCommitted() []byte { "txhash": "673097FB69A0E78C8B542C5F9BD826BB7C55FAE9560972DE6B075612E2CCB0A5", "codespace": "", "code": 0, - "data": "0AD2010A242F636F736D7761736D2E7761736D2E76312E4D736745786563757465436F6E747261637412A9010AA6015B7B226B6579223A7B22656D69747465725F636861696E223A322C22656D69747465725F61646472657373223A2230303030303030303030303030303030303030303030303030323930666231363732303861663435356262313337373830313633623762376139613130633136222C2273657175656E6365223A313638333133363234347D2C22737461747573223A7B2274797065223A22636F6D6D6974746564227D7D5D", + "data": "12d2010a242f636f736d7761736d2e7761736d2e76312e4d736745786563757465436f6e747261637412a9010aa6015b7b226b6579223a7b22656d69747465725f636861696e223a322c22656d69747465725f61646472657373223a2230303030303030303030303030303030303030303030303030323930666231363732303861663435356262313337373830313633623762376139613130633136222c2273657175656e6365223a313638333133363234347d2c22737461747573223a7b2274797065223a22636f6d6d6974746564227d7d5d12d2010a242f636f736d7761736d2e7761736d2e76312e4d736745786563757465436f6e747261637412a9010aa6015b7b226b6579223a7b22656d69747465725f636861696e223a322c22656d69747465725f61646472657373223a2230303030303030303030303030303030303030303030303030323930666231363732303861663435356262313337373830313633623762376139613130633136222c2273657175656e6365223a313638333133363234347d2c22737461747573223a7b2274797065223a22636f6d6d6974746564227d7d5d", "raw_log": "[{\"events\":[{\"type\":\"execute\",\"attributes\":[{\"key\":\"_contract_address\",\"value\":\"wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmwasm.wasm.v1.MsgExecuteContract\"},{\"key\":\"module\",\"value\":\"wasm\"},{\"key\":\"sender\",\"value\":\"wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq\"}]},{\"type\":\"wasm\",\"attributes\":[{\"key\":\"_contract_address\",\"value\":\"wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465\"},{\"key\":\"action\",\"value\":\"submit_observations\"},{\"key\":\"owner\",\"value\":\"wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq\"}]},{\"type\":\"wasm-Observation\",\"attributes\":[{\"key\":\"_contract_address\",\"value\":\"wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465\"},{\"key\":\"tx_hash\",\"value\":\"\\\"guolNsXRZxgwy0kSD5RHnjS1RZao3TafvCZmZnp2X0s=\\\"\"},{\"key\":\"timestamp\",\"value\":\"1683136244\"},{\"key\":\"nonce\",\"value\":\"0\"},{\"key\":\"emitter_chain\",\"value\":\"2\"},{\"key\":\"emitter_address\",\"value\":\"\\\"0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16\\\"\"},{\"key\":\"sequence\",\"value\":\"1683136244\"},{\"key\":\"consistency_level\",\"value\":\"15\"},{\"key\":\"payload\",\"value\":\"\\\"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3gtrOnZAAAAAAAAAAAAAAAAAAALYvmvwuqdOCpBwFmecrpGQ6A3QoAAgAAAAAAAAAAAAAAAMEIIJg/M0Vs576zoEb1qD+jTwJ9DCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\\\"\"}]}]}]", "logs": [ { @@ -5298,10 +5298,10 @@ func createTxRespForCommitted() []byte { { "type": "tx", "attributes": [ - { "key": "ZmVl", "value": null, "index": true }, + { "key": "fee", "value": null, "index": true }, { - "key": "ZmVlX3BheWVy", - "value": "d29ybWhvbGUxY3l5enB4cGx4ZHprZWVhN2t3c3lkYWRnODczNTdxbmEzemczdHE=", + "key": "fee_payer", + "value": "wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq", "index": true } ] @@ -5310,8 +5310,8 @@ func createTxRespForCommitted() []byte { "type": "tx", "attributes": [ { - "key": "YWNjX3NlcQ==", - "value": "d29ybWhvbGUxY3l5enB4cGx4ZHprZWVhN2t3c3lkYWRnODczNTdxbmEzemczdHEvMjU=", + "key": "acc_seq", + "value": "wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq", "index": true } ] @@ -5320,8 +5320,8 @@ func createTxRespForCommitted() []byte { "type": "tx", "attributes": [ { - "key": "c2lnbmF0dXJl", - "value": "R09qWUJ2RVVTclY0THQydWt3NURwRXU3Rlo1RURCMzRZUmdwYkhQYitmMEFKSjNFZ3RFZEJRaGV1dHdZVk90eU1VWUlpSkVpZytDeFV0WG8xemI1WEE9PQ==", + "key": "signature", + "value": "GOjYBvEUSrV4Lt2ukw5DpEu7FZ5EDB34YRgpbHPb+f0AJJ3EgtEdBQheutwYVOtyMUYIiJEig+CxUtXo1zb5XA==", "index": true } ] @@ -5330,8 +5330,8 @@ func createTxRespForCommitted() []byte { "type": "message", "attributes": [ { - "key": "YWN0aW9u", - "value": "L2Nvc213YXNtLndhc20udjEuTXNnRXhlY3V0ZUNvbnRyYWN0", + "key": "action", + "value": "/cosmwasm.wasm.v1.MsgExecuteContract", "index": true } ] @@ -5339,10 +5339,10 @@ func createTxRespForCommitted() []byte { { "type": "message", "attributes": [ - { "key": "bW9kdWxl", "value": "d2FzbQ==", "index": true }, + { "key": "module", "value": "wasm", "index": true }, { - "key": "c2VuZGVy", - "value": "d29ybWhvbGUxY3l5enB4cGx4ZHprZWVhN2t3c3lkYWRnODczNTdxbmEzemczdHE=", + "key": "sender", + "value": "wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq", "index": true } ] @@ -5351,8 +5351,8 @@ func createTxRespForCommitted() []byte { "type": "execute", "attributes": [ { - "key": "X2NvbnRyYWN0X2FkZHJlc3M=", - "value": "d29ybWhvbGUxNGhqMnRhdnE4ZnBlc2R3eHhjdTQ0cnR5M2hoOTB2aHVqcnZjbXN0bDR6cjN0eG1mdnc5c3JyZzQ2NQ==", + "key": "_contract_address", + "value": "wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465", "index": true } ] @@ -5361,18 +5361,18 @@ func createTxRespForCommitted() []byte { "type": "wasm", "attributes": [ { - "key": "X2NvbnRyYWN0X2FkZHJlc3M=", - "value": "d29ybWhvbGUxNGhqMnRhdnE4ZnBlc2R3eHhjdTQ0cnR5M2hoOTB2aHVqcnZjbXN0bDR6cjN0eG1mdnc5c3JyZzQ2NQ==", + "key": "_contract_address", + "value": "wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465", "index": true }, { - "key": "YWN0aW9u", - "value": "c3VibWl0X29ic2VydmF0aW9ucw==", + "key": "action", + "value": "submit_observations", "index": true }, { - "key": "b3duZXI=", - "value": "d29ybWhvbGUxY3l5enB4cGx4ZHprZWVhN2t3c3lkYWRnODczNTdxbmEzemczdHE=", + "key": "owner", + "value": "wormhole1cyyzpxplxdzkeea7kwsydadg87357qna3zg3tq", "index": true } ] @@ -5381,28 +5381,28 @@ func createTxRespForCommitted() []byte { "type": "wasm-Observation", "attributes": [ { - "key": "X2NvbnRyYWN0X2FkZHJlc3M=", - "value": "d29ybWhvbGUxNGhqMnRhdnE4ZnBlc2R3eHhjdTQ0cnR5M2hoOTB2aHVqcnZjbXN0bDR6cjN0eG1mdnc5c3JyZzQ2NQ==", + "key": "_contract_address", + "value": "wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465", "index": true }, { - "key": "dHhfaGFzaA==", - "value": "Imd1b2xOc1hSWnhnd3kwa1NENVJIbmpTMVJaYW8zVGFmdkNabVpucDJYMHM9Ig==", + "key": "tx_hash", + "value": "\"guolNsXRZxgwy0kSD5RHnjS1RZao3TafvCZmZnp2X0s=\"", "index": true }, - { "key": "dGltZXN0YW1w", "value": "MTY4MzEzNjI0NA==", "index": true }, - { "key": "bm9uY2U=", "value": "MA==", "index": true }, - { "key": "ZW1pdHRlcl9jaGFpbg==", "value": "Mg==", "index": true }, + { "key": "timestamp", "value": "1683136244", "index": true }, + { "key": "nonce", "value": "0", "index": true }, + { "key": "emitter_chain", "value": "2", "index": true }, { - "key": "ZW1pdHRlcl9hZGRyZXNz", - "value": "IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAyOTBmYjE2NzIwOGFmNDU1YmIxMzc3ODAxNjNiN2I3YTlhMTBjMTYi", + "key": "emitter_address", + "value": "\"0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16\"", "index": true }, - { "key": "c2VxdWVuY2U=", "value": "MTY4MzEzNjI0NA==", "index": true }, - { "key": "Y29uc2lzdGVuY3lfbGV2ZWw=", "value": "MTU=", "index": true }, + { "key": "sequence", "value": "1683136244", "index": true }, + { "key": "consistency_level", "value": "15", "index": true }, { - "key": "cGF5bG9hZA==", - "value": "IkFRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEzZ3RyT25aQUFBQUFBQUFBQUFBQUFBQUFBQUxZdm12d3VxZE9DcEJ3Rm1lY3JwR1E2QTNRb0FBZ0FBQUFBQUFBQUFBQUFBQU1FSUlKZy9NMFZzNTc2em9FYjFxRCtqVHdKOURDQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE9PSI=", + "key": "payload", + "value": "\"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3gtrOnZAAAAAAAAAAAAAAAAAAALYvmvwuqdOCpBwFmecrpGQ6A3QoAAgAAAAAAAAAAAAAAAMEIIJg/M0Vs576zoEb1qD+jTwJ9DCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\"", "index": true } ] diff --git a/node/pkg/accountant/query_test.go b/node/pkg/accountant/query_test.go index e7fc750ffb..6464308844 100644 --- a/node/pkg/accountant/query_test.go +++ b/node/pkg/accountant/query_test.go @@ -10,7 +10,7 @@ import ( "github.com/wormhole-foundation/wormhole/sdk/vaa" - cosmossdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -60,7 +60,7 @@ func TestParseBatchTransferStatusCommittedResponse(t *testing.T) { expectedTokenAddress, err := vaa.StringToAddress("0000000000000000000000002d8be6bf0baa74e0a907016679cae9190e80dd0a") require.NoError(t, err) - expectedAmount := cosmossdk.NewInt(1000000000000000000) + expectedAmount := math.NewInt(1000000000000000000) expectedDigest, err := hex.DecodeString("d676db7dfffbfda8bd18952ce21d89ca616e3b8f9771ab02eadd398255dcf7d3") require.NoError(t, err) diff --git a/node/pkg/accountant/submit_obs.go b/node/pkg/accountant/submit_obs.go index 2a4658f6f3..27599e69bd 100644 --- a/node/pkg/accountant/submit_obs.go +++ b/node/pkg/accountant/submit_obs.go @@ -430,13 +430,13 @@ func GetObservationResponses(txResp *sdktx.BroadcastTxResponse) (map[string]Obse return nil, fmt.Errorf("failed to unmarshal data: %w", err) } - if len(msg.Data) == 0 { - return nil, fmt.Errorf("data field is empty") - } - var execContractResp wasmdtypes.MsgExecuteContractResponse - if err := execContractResp.Unmarshal(msg.Data[0].Data); err != nil { - return nil, fmt.Errorf("failed to unmarshal ExecuteContractResponse: %w", err) + if len(msg.MsgResponses) > 0 { + if err := execContractResp.Unmarshal(msg.MsgResponses[0].Value); err != nil { + return nil, fmt.Errorf("failed to unmarshal ExecuteContractResponse from msg.MsgResponses: %w", err) + } + } else { + return nil, fmt.Errorf("msg responses array is empty") } var responses ObservationResponses diff --git a/node/pkg/accountant/watcher.go b/node/pkg/accountant/watcher.go index 52ccaf37ce..f0e69be26f 100644 --- a/node/pkg/accountant/watcher.go +++ b/node/pkg/accountant/watcher.go @@ -13,10 +13,10 @@ import ( ethCommon "github.com/ethereum/go-ethereum/common" - tmAbci "github.com/tendermint/tendermint/abci/types" - tmHttp "github.com/tendermint/tendermint/rpc/client/http" - tmCoreTypes "github.com/tendermint/tendermint/rpc/core/types" - tmTypes "github.com/tendermint/tendermint/types" + tmAbci "github.com/cometbft/cometbft/abci/types" + tmHttp "github.com/cometbft/cometbft/rpc/client/http" + tmCoreTypes "github.com/cometbft/cometbft/rpc/core/types" + tmTypes "github.com/cometbft/cometbft/types" "go.uber.org/zap" ) @@ -101,6 +101,7 @@ func (acct *Accountant) handleEvents(ctx context.Context, evts <-chan tmCoreType } for _, event := range tx.Result.Events { + if event.Type == "wasm-Observation" { evt, err := parseEvent[WasmObservation](acct.logger, event, "wasm-Observation", contract) if err != nil { @@ -141,13 +142,16 @@ type ( func parseEvent[T any](logger *zap.Logger, event tmAbci.Event, name string, contractAddress string) (*T, error) { attrs := make(map[string]json.RawMessage) for _, attr := range event.Attributes { - if string(attr.Key) == "_contract_address" { - if string(attr.Value) != contractAddress { - return nil, fmt.Errorf("%s event from unexpected contract: %s", name, string(attr.Value)) + key := attr.Key + value := attr.Value + + if key == "_contract_address" { + if value != contractAddress { + return nil, fmt.Errorf("%s event from unexpected contract: %s", name, value) } } else { - logger.Debug("event attribute", zap.String("event", name), zap.String("key", string(attr.Key)), zap.String("value", string(attr.Value))) - attrs[string(attr.Key)] = attr.Value + logger.Debug("event attribute", zap.String("event", name), zap.String("key", key), zap.String("value", value)) + attrs[key] = []byte(value) } } diff --git a/node/pkg/accountant/watcher_test.go b/node/pkg/accountant/watcher_test.go index 6088782ef8..d787a3e055 100644 --- a/node/pkg/accountant/watcher_test.go +++ b/node/pkg/accountant/watcher_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmAbci "github.com/tendermint/tendermint/abci/types" + tmAbci "github.com/cometbft/cometbft/abci/types" "go.uber.org/zap" ) @@ -18,7 +18,19 @@ import ( func TestParseWasmObservationFromTestTool(t *testing.T) { logger := zap.NewNop() - eventJson := []byte("{\"type\":\"wasm-Observation\",\"attributes\":[{\"key\":\"X2NvbnRyYWN0X2FkZHJlc3M=\",\"value\":\"d29ybWhvbGUxNDY2bmYzenV4cHlhOHE5ZW14dWtkN3ZmdGFmNmg0cHNyMGEwN3NybDV6dzc0emg4NHlqcTRseWptaA==\",\"index\":true},{\"key\":\"dHhfaGFzaA==\",\"value\":\"Imd1b2xOc1hSWnhnd3kwa1NENVJIbmpTMVJaYW8zVGFmdkNabVpucDJYMHM9Ig==\",\"index\":true},{\"key\":\"dGltZXN0YW1w\",\"value\":\"MTY3MjkzMjk5OA==\",\"index\":true},{\"key\":\"bm9uY2U=\",\"value\":\"MA==\",\"index\":true},{\"key\":\"ZW1pdHRlcl9jaGFpbg==\",\"value\":\"Mg==\",\"index\":true},{\"key\":\"ZW1pdHRlcl9hZGRyZXNz\",\"value\":\"IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAyOTBmYjE2NzIwOGFmNDU1YmIxMzc3ODAxNjNiN2I3YTlhMTBjMTYi\",\"index\":true},{\"key\":\"c2VxdWVuY2U=\",\"value\":\"MTY3MjkzMjk5OA==\",\"index\":true},{\"key\":\"Y29uc2lzdGVuY3lfbGV2ZWw=\",\"value\":\"MTU=\",\"index\":true},{\"key\":\"dGVzdF9maWVsZA==\",\"value\":\"MTU=\",\"index\":true},{\"key\":\"cGF5bG9hZA==\",\"value\":\"IkFRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEzZ3RyT25aQUFBQUFBQUFBQUFBQUFBQUFBQUxZdm12d3VxZE9DcEJ3Rm1lY3JwR1E2QTNRb0FBZ0FBQUFBQUFBQUFBQUFBQU1FSUlKZy9NMFZzNTc2em9FYjFxRCtqVHdKOURDQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE9PSI=\",\"index\":true}]}") + eventJson := []byte(`{"type":"wasm-Observation","attributes":[ + {"key":"_contract_address","value":"wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh","index":true}, + {"key":"tx_hash","value":"\"guolNsXRZxgwy0kSD5RHnjS1RZao3TafvCZmZnp2X0s=\"","index":true}, + {"key":"timestamp","value":"1672932998","index":true}, + {"key":"nonce","value":"0","index":true}, + {"key":"emitter_chain","value":"2","index":true}, + {"key":"emitter_address","value":"\"0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16\"","index":true}, + {"key":"sequence","value":"1672932998","index":true}, + {"key":"consistency_level","value":"15","index":true}, + {"key":"test_field","value":"15","index":true}, + {"key":"payload","value":"\"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3gtrOnZAAAAAAAAAAAAAAAAAAALYvmvwuqdOCpBwFmecrpGQ6A3QoAAgAAAAAAAAAAAAAAAMEIIJg/M0Vs576zoEb1qD+jTwJ9DCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\"","index":true} + ]}`) + event := tmAbci.Event{} err := json.Unmarshal(eventJson, &event) require.NoError(t, err) @@ -52,7 +64,18 @@ func TestParseWasmObservationFromTestTool(t *testing.T) { func TestParseWasmObservationFromPortalBridge(t *testing.T) { logger := zap.NewNop() - eventJson := []byte("{\"type\":\"wasm-Observation\",\"attributes\":[{\"key\":\"X2NvbnRyYWN0X2FkZHJlc3M=\",\"value\":\"d29ybWhvbGUxNDY2bmYzenV4cHlhOHE5ZW14dWtkN3ZmdGFmNmg0cHNyMGEwN3NybDV6dzc0emg4NHlqcTRseWptaA==\",\"index\":true},{\"key\":\"dHhfaGFzaA==\",\"value\":\"IlovM0x1bklSK0FaWjdRdllqS0dHSDBNZU94M1pIZlR1SHZ6TDAxdm9TcjQ9Ig==\",\"index\":true},{\"key\":\"dGltZXN0YW1w\",\"value\":\"OTUwNw==\",\"index\":true},{\"key\":\"bm9uY2U=\",\"value\":\"NTU0MzAzNzQ0\",\"index\":true},{\"key\":\"ZW1pdHRlcl9jaGFpbg==\",\"value\":\"Mg==\",\"index\":true},{\"key\":\"ZW1pdHRlcl9hZGRyZXNz\",\"value\":\"IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAyOTBmYjE2NzIwOGFmNDU1YmIxMzc3ODAxNjNiN2I3YTlhMTBjMTYi\",\"index\":true},{\"key\":\"c2VxdWVuY2U=\",\"value\":\"MQ==\",\"index\":true},{\"key\":\"Y29uc2lzdGVuY3lfbGV2ZWw=\",\"value\":\"MQ==\",\"index\":true},{\"key\":\"cGF5bG9hZA==\",\"value\":\"IkFRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBSlVDK1FBQUFBQUFBQUFBQUFBQUFBQTNiWlA1R3FSMUc3aWxDQlRuOEpmMEh4ZjZqNEFBZ0FBQUFBQUFBQUFBQUFBQUpENHYycEhueklPclFkRUVhU3c1NVJPcU1uQkFBUUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE9PSI=\",\"index\":true}]}") + eventJson := []byte(`{"type":"wasm-Observation","attributes":[ + {"key":"_contract_address","value":"wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh","index":true}, + {"key":"tx_hash","value":"\"Z/3LunIR+AZZ7QvYjKGGH0MeOx3ZHfTuHvzL01voSr4=\"","index":true}, + {"key":"timestamp","value":"9507","index":true}, + {"key":"nonce","value":"554303744","index":true}, + {"key":"emitter_chain","value":"2","index":true}, + {"key":"emitter_address","value":"\"0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16\"","index":true}, + {"key":"sequence","value":"1","index":true}, + {"key":"consistency_level","value":"1","index":true}, + {"key":"payload","value":"\"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJUC+QAAAAAAAAAAAAAAAAA3bZP5GqR1G7ilCBTn8Jf0Hxf6j4AAgAAAAAAAAAAAAAAAJD4v2pHnzIOrQdEEaSw55ROqMnBAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\"","index":true}]} + `) + event := tmAbci.Event{} err := json.Unmarshal(eventJson, &event) require.NoError(t, err) @@ -87,7 +110,12 @@ func TestParseWasmObservationFromPortalBridge(t *testing.T) { func TestParseWasmObservationError(t *testing.T) { logger := zap.NewNop() - eventJson := []byte("{\"type\":\"wasm-ObservationError\",\"attributes\":[{\"key\":\"X2NvbnRyYWN0X2FkZHJlc3M=\",\"value\":\"d29ybWhvbGUxNDY2bmYzenV4cHlhOHE5ZW14dWtkN3ZmdGFmNmg0cHNyMGEwN3NybDV6dzc0emg4NHlqcTRseWptaA==\",\"index\":true},{\"key\":\"a2V5\",\"value\":\"eyJlbWl0dGVyX2NoYWluIjoyLCJlbWl0dGVyX2FkZHJlc3MiOiIwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMjkwZmIxNjcyMDhhZjQ1NWJiMTM3NzgwMTYzYjdiN2E5YTEwYzE2Iiwic2VxdWVuY2UiOjE2NzQxNDQ1NDV9\",\"index\":true},{\"key\":\"ZXJyb3I=\",\"value\":\"ImRpZ2VzdCBtaXNtYXRjaCBmb3IgcHJvY2Vzc2VkIG1lc3NhZ2Ui\",\"index\":true}]}") + eventJson := []byte(`{"type":"wasm-ObservationError","attributes":[ + {"key":"_contract_address","value":"wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh","index":true}, + {"key":"key","value":"{\"emitter_chain\":2,\"emitter_address\":\"0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16\",\"sequence\":1674144545}","index":true}, + {"key":"error","value":"\"digest mismatch for processed message\"","index":true}]} + `) + event := tmAbci.Event{} err := json.Unmarshal(eventJson, &event) require.NoError(t, err) diff --git a/node/pkg/node/node_test.go b/node/pkg/node/node_test.go index 378f2acc0f..11fe10e9ea 100644 --- a/node/pkg/node/node_test.go +++ b/node/pkg/node/node_test.go @@ -735,6 +735,7 @@ func runConsensusTests(t *testing.T, testCases []testCase, numGuardians int) { } s := fmt.Sprintf("unix:///%s", gs[i].config.adminSocket) + //nolint: staticcheck conn, err := grpc.DialContext(ctx, s, grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() @@ -778,6 +779,7 @@ func runConsensusTests(t *testing.T, testCases []testCase, numGuardians int) { // check that the VAAs were generated logger.Info("Connecting to publicrpc...") + //nolint: staticcheck conn, err := grpc.DialContext(ctx, gs[vaaCheckGuardianIndex].config.publicRpc, grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) @@ -1225,6 +1227,7 @@ func runConsensusBenchmark(t *testing.B, name string, numGuardians int, numMessa time.Sleep(time.Microsecond * 100) } // now that it's online, connect to publicrpc of guardian-0 + //nolint: staticcheck conn, err := grpc.DialContext(ctx, gs[vaaCheckGuardianIndex].config.publicRpc, grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() diff --git a/node/pkg/node/publicwebRunnable.go b/node/pkg/node/publicwebRunnable.go index 575b05391d..85380f6396 100644 --- a/node/pkg/node/publicwebRunnable.go +++ b/node/pkg/node/publicwebRunnable.go @@ -57,6 +57,7 @@ func publicwebServiceRunnable( tlsCacheDir string, ) supervisor.Runnable { return func(ctx context.Context) error { + //nolint: staticcheck conn, err := grpc.DialContext( ctx, fmt.Sprintf("unix:///%s", upstreamAddr), diff --git a/node/pkg/telemetry/loki.go b/node/pkg/telemetry/loki.go index 243d8976d2..e7e9db0a1e 100644 --- a/node/pkg/telemetry/loki.go +++ b/node/pkg/telemetry/loki.go @@ -18,10 +18,10 @@ import ( gkzap "github.com/go-kit/kit/log/zap" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/flagext" - "github.com/grafana/loki/clients/pkg/promtail/api" - "github.com/grafana/loki/clients/pkg/promtail/client" - "github.com/grafana/loki/pkg/logproto" - lokiflag "github.com/grafana/loki/pkg/util/flagext" + "github.com/grafana/loki/v3/clients/pkg/promtail/api" + "github.com/grafana/loki/v3/clients/pkg/promtail/client" + "github.com/grafana/loki/v3/pkg/logproto" + lokiflag "github.com/grafana/loki/v3/pkg/util/flagext" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/config" "github.com/prometheus/common/model" diff --git a/node/pkg/telemetry/telemetry_test.go b/node/pkg/telemetry/telemetry_test.go index d2bbb42576..b2ba83801f 100644 --- a/node/pkg/telemetry/telemetry_test.go +++ b/node/pkg/telemetry/telemetry_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/v3/pkg/logproto" "github.com/stretchr/testify/assert" "go.uber.org/zap" diff --git a/node/pkg/watchers/ibc/wasm_attrs.go b/node/pkg/watchers/ibc/wasm_attrs.go index 41788d733e..b1c31c633b 100644 --- a/node/pkg/watchers/ibc/wasm_attrs.go +++ b/node/pkg/watchers/ibc/wasm_attrs.go @@ -1,7 +1,6 @@ package ibc import ( - "encoding/base64" "fmt" "strconv" @@ -76,17 +75,9 @@ func (wa *WasmAttributes) Parse(logger *zap.Logger, event gjson.Result) error { if !valueBase.Exists() { return fmt.Errorf("event attribute does not have a value: %s", attribute.String()) } - keyRaw, err := base64.StdEncoding.DecodeString(keyBase.String()) - if err != nil { - return fmt.Errorf("event attribute key is invalid base64: %s", attribute.String()) - } - valueRaw, err := base64.StdEncoding.DecodeString(valueBase.String()) - if err != nil { - return fmt.Errorf("event attribute value is invalid base64: %s", attribute.String()) - } - key := string(keyRaw) - value := string(valueRaw) + key := keyBase.String() + value := valueBase.String() if _, ok := wa.m[key]; ok { return fmt.Errorf("duplicate key in event: %s", key) diff --git a/node/pkg/watchers/ibc/watcher_test.go b/node/pkg/watchers/ibc/watcher_test.go index 016af80970..76c51b6338 100644 --- a/node/pkg/watchers/ibc/watcher_test.go +++ b/node/pkg/watchers/ibc/watcher_test.go @@ -21,18 +21,18 @@ import ( func TestParseIbcReceivePublishEvent(t *testing.T) { logger := zap.NewNop() - eventJson := `{"type": "wasm","attributes": [` + - `{"key": "X2NvbnRyYWN0X2FkZHJlc3M=","value": "d29ybWhvbGUxbmM1dGF0YWZ2NmV5cTdsbGtyMmd2NTBmZjllMjJtbmY3MHFnamx2NzM3a3RtdDRlc3dycTBrZGhjag==","index": true},` + - `{"key": "YWN0aW9u", "value": "cmVjZWl2ZV9wdWJsaXNo", "index": true},` + - `{"key": "Y2hhbm5lbF9pZA==", "value": "Y2hhbm5lbC0w", "index": true},` + - `{"key": "bWVzc2FnZS5tZXNzYWdl","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNA==","index": true},` + - `{"key": "bWVzc2FnZS5zZW5kZXI=","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMzU3NDMwNzQ5NTZjNzEwODAwZTgzMTk4MDExY2NiZDRkZGYxNTU2ZA==","index": true},` + - `{ "key": "bWVzc2FnZS5jaGFpbl9pZA==", "value": "MTg=", "index": true },` + - `{ "key": "bWVzc2FnZS5ub25jZQ==", "value": "MQ==", "index": true },` + - `{ "key": "bWVzc2FnZS5zZXF1ZW5jZQ==", "value": "Mg==", "index": true },` + - `{"key": "bWVzc2FnZS5ibG9ja190aW1l","value": "MTY4MDA5OTgxNA==","index": true},` + - `{"key": "bWVzc2FnZS5ibG9ja19oZWlnaHQ=","value": "MjYxMw==","index": true}` + - `]}` + eventJson := `{"type": "wasm", "attributes": [ + {"key": "_contract_address", "value": "wormhole1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq0kdhcj", "index": true}, + {"key": "action", "value": "receive_publish", "index": true}, + {"key": "channel_id", "value": "channel-0", "index": true}, + {"key": "message.message", "value": "0000000000000000000000000000000000000000000000000000000000000004", "index": true}, + {"key": "message.sender", "value": "00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d", "index": true}, + {"key": "message.chain_id", "value": "18", "index": true}, + {"key": "message.nonce", "value": "1", "index": true}, + {"key": "message.sequence", "value": "2", "index": true}, + {"key": "message.block_time", "value": "1680099814", "index": true}, + {"key": "message.block_height", "value": "2613", "index": true} + ]}` require.Equal(t, true, gjson.Valid(eventJson)) event := gjson.Parse(eventJson) @@ -71,18 +71,15 @@ func TestParseIbcReceivePublishEvent(t *testing.T) { func TestParseEventForWrongContract(t *testing.T) { logger := zap.NewNop() - eventJson := `{"type": "wasm","attributes": [` + - `{"key": "X2NvbnRyYWN0X2FkZHJlc3M=","value": "d29ybWhvbGUxbmM1dGF0YWZ2NmV5cTdsbGtyMmd2NTBmZjllMjJtbmY3MHFnamx2NzM3a3RtdDRlc3dycTBrZGhjag==","index": true},` + - `{"key": "YWN0aW9u", "value": "cmVjZWl2ZV9wdWJsaXNo", "index": true},` + - `{"key": "Y2hhbm5lbF9pZA==", "value": "Y2hhbm5lbC0w", "index": true},` + - `{"key": "bWVzc2FnZS5tZXNzYWdl","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNA==","index": true},` + - `{"key": "bWVzc2FnZS5zZW5kZXI=","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMzU3NDMwNzQ5NTZjNzEwODAwZTgzMTk4MDExY2NiZDRkZGYxNTU2ZA==","index": true},` + - `{ "key": "bWVzc2FnZS5jaGFpbl9pZA==", "value": "MTg=", "index": true },` + - `{ "key": "bWVzc2FnZS5ub25jZQ==", "value": "MQ==", "index": true },` + - `{ "key": "bWVzc2FnZS5zZXF1ZW5jZQ==", "value": "Mg==", "index": true },` + - `{"key": "bWVzc2FnZS5ibG9ja190aW1l","value": "MTY4MDA5OTgxNA==","index": true},` + - `{"key": "bWVzc2FnZS5ibG9ja19oZWlnaHQ=","value": "MjYxMw==","index": true}` + - `]}` + eventJson := `{"type":"wasm","attributes":[ + {"key":"_contract_address","value":"wormhole1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq0kdhcj","index":true}, + {"key":"action","value":"receive_publish","index":true},{"key":"channel_id","value":"channel-0","index":true}, + {"key":"message.message","value":"0000000000000000000000000000000000000000000000000000000000000004","index":true}, + {"key":"message.sender","value":"00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d","index":true}, + {"key":"message.chain_id","value":"18","index":true},{"key":"message.nonce","value":"1","index":true}, + {"key":"message.sequence","value":"2","index":true},{"key":"message.block_time","value":"1680099814","index":true}, + {"key":"message.block_height","value":"2613","index":true} + ]}` require.Equal(t, true, gjson.Valid(eventJson)) event := gjson.Parse(eventJson) @@ -99,18 +96,15 @@ func TestParseEventForWrongContract(t *testing.T) { func TestParseEventForWrongAction(t *testing.T) { logger := zap.NewNop() - eventJson := `{"type": "wasm","attributes": [` + - `{"key": "X2NvbnRyYWN0X2FkZHJlc3M=","value": "d29ybWhvbGUxbmM1dGF0YWZ2NmV5cTdsbGtyMmd2NTBmZjllMjJtbmY3MHFnamx2NzM3a3RtdDRlc3dycTBrZGhjag==","index": true},` + - `{"key": "YWN0aW9u", "value": "cmVjZWl2ZV9wa3Q=", "index": true},` + // Changed action value to "receive_pkt" - `{"key": "Y2hhbm5lbF9pZA==", "value": "Y2hhbm5lbC0w", "index": true},` + - `{"key": "bWVzc2FnZS5tZXNzYWdl","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNA==","index": true},` + - `{"key": "bWVzc2FnZS5zZW5kZXI=","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMzU3NDMwNzQ5NTZjNzEwODAwZTgzMTk4MDExY2NiZDRkZGYxNTU2ZA==","index": true},` + - `{ "key": "bWVzc2FnZS5jaGFpbl9pZA==", "value": "MTg=", "index": true },` + - `{ "key": "bWVzc2FnZS5ub25jZQ==", "value": "MQ==", "index": true },` + - `{ "key": "bWVzc2FnZS5zZXF1ZW5jZQ==", "value": "Mg==", "index": true },` + - `{"key": "bWVzc2FnZS5ibG9ja190aW1l","value": "MTY4MDA5OTgxNA==","index": true},` + - `{"key": "bWVzc2FnZS5ibG9ja19oZWlnaHQ=","value": "MjYxMw==","index": true}` + - `]}` + eventJson := `{"type":"wasm","attributes":[ + {"key":"_contract_address","value":"wormhole1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq0kdhcj","index":true}, + {"key":"action","value":"receive_pkt","index":true},{"key":"channel_id","value":"channel-0","index":true}, + {"key":"message.message","value":"0000000000000000000000000000000000000000000000000000000000000004","index":true}, + {"key":"message.sender","value":"00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d","index":true}, + {"key":"message.chain_id","value":"18","index":true},{"key":"message.nonce","value":"1","index":true}, + {"key":"message.sequence","value":"2","index":true},{"key":"message.block_time","value":"1680099814","index":true}, + {"key":"message.block_height","value":"2613","index":true} + ]}` require.Equal(t, true, gjson.Valid(eventJson)) event := gjson.Parse(eventJson) @@ -128,18 +122,15 @@ func TestParseEventForWrongAction(t *testing.T) { func TestParseEventForNoContractSpecified(t *testing.T) { logger := zap.NewNop() - eventJson := `{"type": "wasm","attributes": [` + - // No contract specified - `{"key": "YWN0aW9u", "value": "cmVjZWl2ZV9wdWJsaXNo", "index": true},` + - `{"key": "Y2hhbm5lbF9pZA==", "value": "Y2hhbm5lbC0w", "index": true},` + - `{"key": "bWVzc2FnZS5tZXNzYWdl","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNA==","index": true},` + - `{"key": "bWVzc2FnZS5zZW5kZXI=","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMzU3NDMwNzQ5NTZjNzEwODAwZTgzMTk4MDExY2NiZDRkZGYxNTU2ZA==","index": true},` + - `{ "key": "bWVzc2FnZS5jaGFpbl9pZA==", "value": "MTg=", "index": true },` + - `{ "key": "bWVzc2FnZS5ub25jZQ==", "value": "MQ==", "index": true },` + - `{ "key": "bWVzc2FnZS5zZXF1ZW5jZQ==", "value": "Mg==", "index": true },` + - `{"key": "bWVzc2FnZS5ibG9ja190aW1l","value": "MTY4MDA5OTgxNA==","index": true},` + - `{"key": "bWVzc2FnZS5ibG9ja19oZWlnaHQ=","value": "MjYxMw==","index": true}` + - `]}` + eventJson := `{"type":"wasm","attributes":[ + {"key":"action","value":"receive_publish","index":true}, + {"key":"channel_id","value":"channel-0","index":true}, + {"key":"message.message","value":"0000000000000000000000000000000000000000000000000000000000000004","index":true}, + {"key":"message.sender","value":"00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d","index":true}, + {"key":"message.chain_id","value":"18","index":true},{"key":"message.nonce","value":"1","index":true}, + {"key":"message.sequence","value":"2","index":true},{"key":"message.block_time","value":"1680099814","index":true}, + {"key":"message.block_height","value":"2613","index":true} + ]}` require.Equal(t, true, gjson.Valid(eventJson)) event := gjson.Parse(eventJson) @@ -156,18 +147,16 @@ func TestParseEventForNoContractSpecified(t *testing.T) { func TestParseEventForNoActionSpecified(t *testing.T) { logger := zap.NewNop() - eventJson := `{"type": "wasm","attributes": [` + - `{"key": "X2NvbnRyYWN0X2FkZHJlc3M=","value": "d29ybWhvbGUxbmM1dGF0YWZ2NmV5cTdsbGtyMmd2NTBmZjllMjJtbmY3MHFnamx2NzM3a3RtdDRlc3dycTBrZGhjag==","index": true},` + - // No action specified - `{"key": "Y2hhbm5lbF9pZA==", "value": "Y2hhbm5lbC0w", "index": true},` + - `{"key": "bWVzc2FnZS5tZXNzYWdl","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwNA==","index": true},` + - `{"key": "bWVzc2FnZS5zZW5kZXI=","value": "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMzU3NDMwNzQ5NTZjNzEwODAwZTgzMTk4MDExY2NiZDRkZGYxNTU2ZA==","index": true},` + - `{ "key": "bWVzc2FnZS5jaGFpbl9pZA==", "value": "MTg=", "index": true },` + - `{ "key": "bWVzc2FnZS5ub25jZQ==", "value": "MQ==", "index": true },` + - `{ "key": "bWVzc2FnZS5zZXF1ZW5jZQ==", "value": "Mg==", "index": true },` + - `{"key": "bWVzc2FnZS5ibG9ja190aW1l","value": "MTY4MDA5OTgxNA==","index": true},` + - `{"key": "bWVzc2FnZS5ibG9ja19oZWlnaHQ=","value": "MjYxMw==","index": true}` + - `]}` + eventJson := `{"type":"wasm","attributes":[ + {"key":"_contract_address","value":"wormhole1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq0kdhcj","index":true}, + {"key":"channel_id","value":"channel-0","index":true},{"key":"message.message","value":"0000000000000000000000000000000000000000000000000000000000000004","index":true}, + {"key":"message.sender","value":"00000000000000000000000035743074956c710800e83198011ccbd4ddf1556d","index":true}, + {"key":"message.chain_id","value":"18","index":true}, + {"key":"message.nonce","value":"1","index":true}, + {"key":"message.sequence","value":"2","index":true}, + {"key":"message.block_time","value":"1680099814","index":true}, + {"key":"message.block_height","value":"2613","index":true} + ]}` require.Equal(t, true, gjson.Valid(eventJson)) event := gjson.Parse(eventJson) diff --git a/node/pkg/wormconn/clientconn.go b/node/pkg/wormconn/clientconn.go index 854d407ee3..1dffbdfba6 100644 --- a/node/pkg/wormconn/clientconn.go +++ b/node/pkg/wormconn/clientconn.go @@ -35,6 +35,7 @@ type ClientConn struct { // NewConn creates a new connection to the wormhole-chain instance at `target`. func NewConn(ctx context.Context, target string, privateKey cryptotypes.PrivKey, chainId string) (*ClientConn, error) { + //nolint: staticcheck c, err := grpc.DialContext( ctx, target, diff --git a/node/pkg/wormconn/send_tx.go b/node/pkg/wormconn/send_tx.go index 709df8f1ca..cf5391ee48 100644 --- a/node/pkg/wormconn/send_tx.go +++ b/node/pkg/wormconn/send_tx.go @@ -3,6 +3,7 @@ package wormconn import ( "context" "fmt" + "time" txclient "github.com/cosmos/cosmos-sdk/client/tx" sdktypes "github.com/cosmos/cosmos-sdk/types" @@ -84,7 +85,7 @@ func (c *ClientConn) SignAndBroadcastTx(ctx context.Context, msg sdktypes.Msg) ( txResp, err := client.BroadcastTx( ctx, &sdktx.BroadcastTxRequest{ - Mode: sdktx.BroadcastMode_BROADCAST_MODE_BLOCK, + Mode: sdktx.BroadcastMode_BROADCAST_MODE_SYNC, TxBytes: txBytes, }, ) @@ -92,5 +93,35 @@ func (c *ClientConn) SignAndBroadcastTx(ctx context.Context, msg sdktypes.Msg) ( return nil, fmt.Errorf("failed to broadcast tx: %w", err) } + // Wait for the tx to be included in a block (13 seconds for 2 blocks minimum) + res, err := waitForBlockInclusion(ctx, client, txResp.TxResponse.TxHash, 13*time.Second) + if err != nil { + return nil, fmt.Errorf("failed to wait for tx inclusion: %w", err) + } else { + // update the response with the final result + txResp.TxResponse = res.TxResponse + } + return txResp, nil } + +// waitForBlockInclusion waits for the tx to be included in a block, or times out after a given duration. +func waitForBlockInclusion(ctx context.Context, client sdktx.ServiceClient, txHash string, waitTimeout time.Duration) (*sdktx.GetTxResponse, error) { + exitAfter := time.After(waitTimeout) + for { + select { + // check if wait timeout is exceeded + case <-exitAfter: + return nil, fmt.Errorf("timed out after: %d; wait for tx %s to be included in a block", waitTimeout, txHash) + // check if in block every second + case <-time.After(100 * time.Millisecond): + res, err := client.GetTx(ctx, &sdktx.GetTxRequest{Hash: txHash}) + if err == nil { + return res, nil + } + // check if context is done + case <-ctx.Done(): + return nil, ctx.Err() + } + } +} diff --git a/scripts/check-docker-pin.sh b/scripts/check-docker-pin.sh index 9c2eb96b13..1cdbb2dee7 100755 --- a/scripts/check-docker-pin.sh +++ b/scripts/check-docker-pin.sh @@ -11,9 +11,9 @@ # - We ignore scratch because it's literally the docker base image # - We ignore solana AS (builder|ci_tests) because it's a relative reference to another FROM call # - We ignore cosmwasm_artifacts AS artifacts because it's a local reference only, is built in tilt -# - We ignore base AS (ignite-go-build|ignite-vue-build) because the base image is already pinned in wormchain/Dockerfile.proto +# - We ignore base AS (ignite-go-build|ignite-ts-client-build) because the base image is already pinned in wormchain/Dockerfile.proto # -git ls-files -z | grep -z "Dockerfile*" | xargs -r -0 grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts|cli-gen|const-gen|dev AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-vue-build|cli-export|const-export|build)' +git ls-files -z | grep -z "Dockerfile*" | xargs -r -0 grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts|cli-gen|const-gen|dev|wormchain-builder AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-ts-client|cli-export|const-export|build)' if [ $? -eq 0 ]; then echo "[!] Unpinned docker files" >&2 exit 1 diff --git a/scripts/sort-cspell-custom-words.sh b/scripts/sort-cspell-custom-words.sh new file mode 100644 index 0000000000..dd81f05086 --- /dev/null +++ b/scripts/sort-cspell-custom-words.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# This script sorts the custom words in cspell-custom-words.txt alphabetically +# and includes duplicate words. +# +# Note: Run this script from the root of the project. +sort cspell-custom-words.txt -o cspell-custom-words.txt -f \ No newline at end of file diff --git a/sdk/js/src/bridge/__tests__/wormhole_ibc_e2e.ts b/sdk/js/src/bridge/__tests__/wormhole_ibc_e2e.ts index cfe43a156f..763ffbf781 100644 --- a/sdk/js/src/bridge/__tests__/wormhole_ibc_e2e.ts +++ b/sdk/js/src/bridge/__tests__/wormhole_ibc_e2e.ts @@ -1,4 +1,4 @@ -import { describe, test } from "@jest/globals"; +import { describe, test, jest } from "@jest/globals"; import { LCDClient, MnemonicKey, @@ -73,6 +73,7 @@ describe("IBC Watcher Integration Tests", () => { }, } ); + const postedVaa = await terraBroadcastTxAndGetSignedVaa( [postMsg], terraWallet, diff --git a/spydk/js/package.json b/spydk/js/package.json index 04c36ffe5e..f1e3ebd2a8 100644 --- a/spydk/js/package.json +++ b/spydk/js/package.json @@ -13,7 +13,7 @@ "build-lib": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json", "build-all": "npm run build-lib", "test": "jest --config jestconfig.json --verbose", - "test-ci": "jest --config jestconfig.json --verbose --setupFiles ./ci-config.js --forceExit", + "test-ci": "jest --config jestconfig.json --verbose --setupFiles ./ci-config.js", "build": "npm run build-all", "format": "echo \"disabled: prettier --write \"src/**/*.ts\"\"", "lint": "tslint -p tsconfig.json", diff --git a/tools/go.sum b/tools/go.sum index f09142af9b..b24ac1538e 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -72,7 +72,6 @@ github.com/bufbuild/buf v1.0.0/go.mod h1:XSlWaqwE9OUiImCWblZYTeLRBWnqoiJXA3v3uw5 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -219,7 +218,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 h1:ajue7SzQMywqRjg2fK7dcpc0QhFGpTR2plWfV4EZWR4= github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0/go.mod h1:r1hZAcvfFXuYmcKyCJI9wlyOPIZUJl6FCB8Cpca/NLE= diff --git a/wormchain/.gitignore b/wormchain/.gitignore index 252784af5f..883174bd3b 100644 --- a/wormchain/.gitignore +++ b/wormchain/.gitignore @@ -6,7 +6,7 @@ release/ testing/js/node_modules !build build/wormhole-chaind -build/wormchaind +build/wormchaind* build/data devnet/wormchain-*/data devnet/wormchain-*/config/*.toml @@ -15,6 +15,8 @@ devnet/wormchain-*/config/genesis.json ts-sdk/node_modules ts-sdk/lib contracts/artifacts +cmd/wormchaind/wormchaind +ts-client/ .idea *.iml diff --git a/wormchain/Dockerfile b/wormchain/Dockerfile index 3fd327fc2c..32c82d2f38 100644 --- a/wormchain/Dockerfile +++ b/wormchain/Dockerfile @@ -1,8 +1,8 @@ -FROM docker.io/golang:1.19.9@sha256:86901bd215ca2b33bdef68f70b999140252169bb55883bb29347334fa00b5b62 +FROM golang:1.22.5@sha256:86a3c48a61915a8c62c0e1d7594730399caa3feb73655dfe96c7bc17710e96cf #used for a readiness probe RUN apt-get update -RUN apt install -y netcat +RUN apt install -y netcat-openbsd RUN apt install -y jq WORKDIR /app @@ -13,7 +13,7 @@ COPY ./sdk /sdk RUN go mod download # copy over c bindings (libwasmvm.x86_64.so, etc) -RUN cp -r /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.1.1/internal/api/* /usr/lib +RUN cp -r /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.5.2/internal/api/* /usr/lib COPY ./wormchain . diff --git a/wormchain/Dockerfile.deploy b/wormchain/Dockerfile.deploy index f86b232489..871bd8d41d 100644 --- a/wormchain/Dockerfile.deploy +++ b/wormchain/Dockerfile.deploy @@ -19,7 +19,8 @@ COPY ./ts-sdk/package.json ./ts-sdk/package-lock.json /ts-sdk/ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \ npm ci --prefix=/ts-sdk COPY ./ts-sdk /ts-sdk -# COPY --from=vue-export /vue /vue +COPY --from=ts-client-export /ts-client /ts-client + RUN npm run build --prefix=/ts-sdk COPY ./contracts/tools/package.json ./contracts/tools/package-lock.json /app/tools/ diff --git a/wormchain/Dockerfile.ict b/wormchain/Dockerfile.ict new file mode 100644 index 0000000000..a6a4ad25eb --- /dev/null +++ b/wormchain/Dockerfile.ict @@ -0,0 +1,40 @@ +FROM golang:1.22.5@sha256:86a3c48a61915a8c62c0e1d7594730399caa3feb73655dfe96c7bc17710e96cf AS builder + +WORKDIR /app + +# Install dependencies +RUN apt update && \ + apt-get install -y \ + build-essential \ + ca-certificates \ + curl + +# Enable faster module downloading. +ENV GOPROXY https://proxy.golang.org + +COPY ./wormchain/go.mod . +COPY ./wormchain/go.sum . +COPY ./sdk /sdk +RUN go mod download + +COPY ./wormchain . + +RUN make build/wormchaind + +FROM golang:1.22.5@sha256:86a3c48a61915a8c62c0e1d7594730399caa3feb73655dfe96c7bc17710e96cf + +WORKDIR /home/heighliner + +COPY --from=builder /app/build/wormchaind /usr/bin + +# copy over c bindings (libwasmvm.x86_64.so, etc) +COPY --from=builder /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.5.2/internal/api/* /usr/lib + +EXPOSE 26657 +EXPOSE 26656 +EXPOSE 6060 +EXPOSE 9090 +EXPOSE 1317 +EXPOSE 4500 + +ENTRYPOINT [ "wormchaind" ] diff --git a/wormchain/Dockerfile.proto b/wormchain/Dockerfile.proto index 0d4a39afbf..6abbebcfed 100644 --- a/wormchain/Dockerfile.proto +++ b/wormchain/Dockerfile.proto @@ -1,20 +1,84 @@ -FROM ignitehq/cli@sha256:1e2846f3621bc3ed2af3e59749bc02f6aec761e1260486da3a17c8fe2c8d2b6c AS base +FROM golang:1.22.5@sha256:86a3c48a61915a8c62c0e1d7594730399caa3feb73655dfe96c7bc17710e96cf AS base -COPY --chown=tendermint:tendermint wormchain /apps/wormchain -COPY --chown=tendermint:tendermint sdk /apps/sdk +WORKDIR /home -WORKDIR /apps/wormchain +# Install dependencies +RUN apt update && \ + apt-get install -y \ + build-essential \ + ca-certificates \ + curl -FROM base AS ignite-go-build +# Enable faster module downloading. +ENV GOPROXY https://proxy.golang.org + + + +## CLI BUILDER STAGE +FROM base AS cli-builder + +WORKDIR /ignite + +# Git clone https://github.com/ignite/cli version v0.27.2 +RUN git clone --branch release/v0.27.2 https://github.com/ignite/cli.git + +WORKDIR /ignite/cli + +RUN sed -i 's/go 1.19/go 1.22.5/g' go.mod +RUN go mod tidy + +# Install ignite binary & verify installation +RUN --mount=type=cache,target=/root/.cache/go-build go install -v ./... +RUN ignite version + + + +## WORMCHAIN BUILDER STAGE +FROM base AS wormchain-builder + +# Define 'tendermint' user (same as in the official ignite image) +RUN useradd -ms /bin/bash tendermint +USER tendermint + +# Copy wormchain into container +COPY --chown=tendermint:tendermint wormchain /wh/apps/wormchain +COPY --chown=tendermint:tendermint sdk /wh/apps/sdk + +# Set working directory +WORKDIR /wh/apps/wormchain + +# Copy ignite cli binary +COPY --from=cli-builder /go/bin/ignite /usr/bin + +# Verify ignite setup +RUN ignite doctor + + + +## GO PROTO BUILDER STAGE +FROM wormchain-builder AS ignite-go-build +# Ignite only likes minor versions in go.mod +RUN sed -i 's/go 1.22.5/go 1.22/g' go.mod RUN ignite generate proto-go + + +## GO EXPORT STAGE FROM scratch AS go-export -COPY --from=ignite-go-build /apps/wormchain/x/wormhole/types /x/wormhole/types -COPY --from=ignite-go-build /apps/wormchain/x/tokenfactory/types /x/tokenfactory/types -COPY --from=ignite-go-build /apps/wormchain/x/ibc-composability-mw/types /x/ibc-composability-mw/types +COPY --from=ignite-go-build /wh/apps/wormchain/x/wormhole/types /x/wormhole/types +COPY --from=ignite-go-build /wh/apps/wormchain/x/tokenfactory/types /x/tokenfactory/types +COPY --from=ignite-go-build /wh/apps/wormchain/x/ibc-composability-mw/types /x/ibc-composability-mw/types + + + +## TS CLIENT BUILDER STAGE +FROM wormchain-builder AS ignite-ts-client-build +# Ignite only likes minor versions in go.mod +RUN sed -i 's/go 1.22.5/go 1.22/g' go.mod +RUN NODE_OPTIONS="" ignite generate ts-client + -FROM base AS ignite-vue-build -RUN NODE_OPTIONS="" ignite generate vuex --proto-all-modules -FROM scratch AS vue-export -COPY --from=ignite-vue-build /apps/wormchain/vue/ /vue +## VUE EXPORT STAGE +FROM scratch AS ts-client-export +COPY --from=ignite-ts-client-build /wh/apps/wormchain/ts-client /ts-client \ No newline at end of file diff --git a/wormchain/Makefile b/wormchain/Makefile index 60b01c59ce..0e39206b25 100644 --- a/wormchain/Makefile +++ b/wormchain/Makefile @@ -4,40 +4,55 @@ GO_FILES=$(shell find . -name "*.go") TILT_VALADDRESS=wormholevaloper1cyyzpxplxdzkeea7kwsydadg87357qna87hzv8 VERSION := $(shell echo $(shell git describe --tags 2> /dev/null || echo v0.0.1)) +BFT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') # grab everything after the space in "github.com/cometbft/cometbft v0.34.7" COMMIT := $(shell git log -1 --format='%h' 2> /dev/null || echo 'abc123') -ldflags = \ - -X github.com/cosmos/cosmos-sdk/version.Name=wormchain\ - -X github.com/cosmos/cosmos-sdk/version.ServerName=wormchaind\ +build_tags = netgo gcc ledger +build_tags += $(BUILD_TAGS) +build_tags := $(strip $(build_tags)) + +whitespace := +whitespace += $(whitespace) +comma := , +build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) + +ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=wormchain \ + -X github.com/cosmos/cosmos-sdk/version.ServerName=wormchaind \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=ledger" -BUILD_FLAGS := -ldflags '$(ldflags)' + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \ + -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(BFT_VERSION) +ldflags += $(LDFLAGS) +ldflags := $(strip $(ldflags)) + +BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' .PHONY: all all: client -.PHONY: client build/wormchaind +.PHONY: client build/wormchaind install client: build/wormchaind - -build/wormchaind: cmd/wormchaind/main.go $(GO_FILES) +build/wormchaind: cmd/wormchaind/main.go cmd/wormchaind/root.go $(GO_FILES) @echo building "wormchaind-$(VERSION)" - go build -v $(BUILD_FLAGS) -tags ledger -o $@ $< + go build -mod=readonly $(BUILD_FLAGS) -o $@ ./cmd/wormchaind cp "$@" "$@"-"$(VERSION)" -# proto: $(PROTO_FILES) -# DOCKER_BUILDKIT=1 docker build --target go-export -f Dockerfile.proto -o type=local,dest=. .. +install: go.sum + go install -mod=readonly $(BUILD_FLAGS) ./cmd/wormchaind + +proto: $(PROTO_FILES) + DOCKER_BUILDKIT=1 docker build --target go-export -f Dockerfile.proto -o type=local,dest=. .. -# vue: $(GO_FILES) proto -# mkdir -p $@ -# touch -m $@ -# DOCKER_BUILDKIT=1 docker build --target vue-export -f Dockerfile.proto -o type=local,dest=. .. +ts-client: $(GO_FILES) proto + mkdir -p $@ + touch -m $@ + DOCKER_BUILDKIT=1 docker build --target ts-client-export -f Dockerfile.proto -o type=local,dest=. .. # For now this is a phony target so we just rebuild it each time instead of # tracking dependencies .PHONY: ts-sdk -ts-sdk: vue +ts-sdk: ts-client npm ci --prefix $@ npm run build --prefix $@ @@ -76,5 +91,46 @@ bootstrap: .PHONY: clean clean: - rm -rf build/wormchaind build/wormchaind-* build/**/*.db build/**/*.wal vue + rm -rf build/wormchaind build/wormchaind-* build/**/*.db build/**/*.wal vue/ ts-client/ echo "{\"height\":\"0\",\"round\":0,\"step\":0}" > build/data/priv_validator_state.json + +##################### +## INTERCHAINTESTS ## +##################### + +# Generate Wormchain Image +local-image: build/wormchaind + docker build -t wormchain:local -f Dockerfile.ict .. + +# Individual Tests ($$ is interpreted as $) +rm-testcache: + go clean -testcache + +ictest-cancel-upgrade: rm-testcache + cd interchaintest && go test -race -v -run ^TestCancelUpgrade$$ ./... + +ictest-chain-start: rm-testcache + cd interchaintest && go test -race -v -run ^TestChainStart$$ ./... + +ictest-malformed-payload: rm-testcache + cd interchaintest && go test -race -v -run ^TestMalformedPayload$$ ./... + +ictest-guardian-set-proposal: rm-testcache + cd interchaintest && go test -race -v -run ^TestGuardianSetUpdateProposal$$ ./... + +ictest-wormhole-message-proposal: rm-testcache + cd interchaintest && go test -race -v -run ^TestGovernanceWormholeMessageProposal$$ ./... + +ictest-upgrade-failure: rm-testcache + cd interchaintest && go test -race -v -run ^TestUpgradeFailure$$ ./... + +ictest-upgrade: rm-testcache + cd interchaintest && go test -race -v -run ^TestUpgrade$$ ./... + +ictest-wasmd-ante: rm-testcache + cd interchaintest && go test -race -v -run ^TestWasmdAnteDecorator$$ ./... + +ictest-wormchain: rm-testcache + cd interchaintest && go test -race -v -run ^TestWormchain$$ ./... + +.PHONY: run-ictests ictest-cancel-upgrade ictest-chain-start ictest-malformed-payload ictest-proposals ictest-upgrade-failure ictest-upgrade ictest-wasmd-ante ictest-wormchain \ No newline at end of file diff --git a/wormchain/app/app.go b/wormchain/app/app.go index 40463085ec..689a74afcf 100644 --- a/wormchain/app/app.go +++ b/wormchain/app/app.go @@ -7,22 +7,36 @@ import ( "path/filepath" "time" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + errorsmod "cosmossdk.io/errors" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + tmjson "github.com/cometbft/cometbft/libs/json" + "github.com/cometbft/cometbft/libs/log" + tmos "github.com/cometbft/cometbft/libs/os" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" - "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - store "github.com/cosmos/cosmos-sdk/store/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -34,11 +48,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamstypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" @@ -53,6 +68,7 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -60,7 +76,6 @@ import ( paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -71,40 +86,34 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v4/modules/core" - ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" - ibcporttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" + appparams "github.com/wormhole-foundation/wormchain/app/params" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/tendermint/spm/cosmoscmd" - "github.com/tendermint/spm/openapiconsole" + "github.com/wormhole-foundation/wormchain/app/openapiconsole" "github.com/wormhole-foundation/wormchain/docs" + "github.com/wormhole-foundation/wormchain/x/tokenfactory" wormholemodule "github.com/wormhole-foundation/wormchain/x/wormhole" wormholemoduleante "github.com/wormhole-foundation/wormchain/x/wormhole/ante" - wormholeclient "github.com/wormhole-foundation/wormchain/x/wormhole/client" wormholemodulekeeper "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" wormholemoduletypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" // this line is used by starport scaffolding # stargate/app/moduleImport - "github.com/wormhole-foundation/wormchain/x/tokenfactory" "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings" tokenfactorykeeper "github.com/wormhole-foundation/wormchain/x/tokenfactory/keeper" tokenfactorytypes "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" @@ -113,9 +122,9 @@ import ( ibchookskeeper "github.com/wormhole-foundation/wormchain/x/ibc-hooks/keeper" ibchookstypes "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" - packetforward "github.com/strangelove-ventures/packet-forward-middleware/v4/router" - packetforwardkeeper "github.com/strangelove-ventures/packet-forward-middleware/v4/router/keeper" - packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" + packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" + packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" ibccomposabilitymw "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw" ibccomposabilitymwkeeper "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/keeper" @@ -127,28 +136,21 @@ const ( Name = "wormchain" ) -// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals - func getGovProposalHandlers() []govclient.ProposalHandler { var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers govProposalHandlers = append(govProposalHandlers, paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - wormholeclient.GuardianSetUpdateProposalHandler, - wormholeclient.WormholeGovernanceMessageProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler + upgradeclient.LegacyProposalHandler, + upgradeclient.LegacyCancelProposalHandler, ) return govProposalHandlers } // GetWasmOpts build wasm options -func GetWasmOpts(app *App, appOpts servertypes.AppOptions) []wasm.Option { - var wasmOpts []wasm.Option +func GetWasmOpts(app *App, appOpts servertypes.AppOptions) []wasmkeeper.Option { + var wasmOpts []wasmkeeper.Option if cast.ToBool(appOpts.Get("telemetry.enabled")) { wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) } @@ -176,18 +178,19 @@ var ( // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, + genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()...), + gov.NewAppModuleBasic(getGovProposalHandlers()), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, + ibctm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, @@ -212,20 +215,36 @@ var ( ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, wormholemoduletypes.ModuleName: nil, // this line is used by starport scaffolding # stargate/app/maccPerms - wasm.ModuleName: {authtypes.Burner}, + wasmtypes.ModuleName: {authtypes.Burner}, tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, } tokenFactoryCapabilities = []string{} - Upgrades = []Upgrade{V2_23_0_Upgrade} + Upgrades = []Upgrade{V2_23_0_Upgrade, V3_0_0_Upgrade} ) var ( - _ cosmoscmd.CosmosApp = (*App)(nil) + _ runtime.AppI = (*App)(nil) _ servertypes.Application = (*App)(nil) ) +var ( + Bech32Prefix = "wormhole" + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = Bech32Prefix + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic +) + func init() { userHomeDir, err := os.UserHomeDir() if err != nil { @@ -233,6 +252,30 @@ func init() { } DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) + + SetAddressPrefixes() +} + +// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format. +func SetAddressPrefixes() { + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) + config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) + config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) + + // This is copied from the cosmos sdk v0.43.0-beta1 + // source: https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/types/address.go#L141 + config.SetAddressVerifier(func(bytes []byte) error { + if len(bytes) == 0 { + return errorsmod.Wrap(sdkerrors.ErrUnknownAddress, "addresses cannot be empty") + } + + if len(bytes) > address.MaxAddrLen { + return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "address max length is %d, got %d", address.MaxAddrLen, len(bytes)) + } + + return nil + }) } // App extends an ABCI application, but with most of its parameters exported. @@ -244,30 +287,32 @@ type App struct { cdc *codec.LegacyAmino appCodec codec.Codec interfaceRegistry types.InterfaceRegistry + txConfig client.TxConfig invCheckPeriod uint // keys to access the substores - keys map[string]*sdk.KVStoreKey - tkeys map[string]*sdk.TransientStoreKey - memKeys map[string]*sdk.MemoryStoreKey + keys map[string]*storetypes.KVStoreKey + tkeys map[string]*storetypes.TransientStoreKey + memKeys map[string]*storetypes.MemoryStoreKey // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + ConsensusParamsKeeper consensusparamkeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper *govkeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper *upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + EvidenceKeeper evidencekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -286,13 +331,16 @@ type App struct { IbcComposabilityMwKeeper *ibccomposabilitymwkeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration - wasmKeeper wasm.Keeper + wasmKeeper wasmkeeper.Keeper ContractKeeper *wasmkeeper.PermissionedKeeper scopedWasmKeeper capabilitykeeper.ScopedKeeper // the module manager mm *module.Manager + // the simulation manager + sm *module.SimulationManager + // module configurator configurator module.Configurator } @@ -304,12 +352,11 @@ func New( traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, - homePath string, invCheckPeriod uint, - encodingConfig cosmoscmd.EncodingConfig, + encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), -) cosmoscmd.App { +) *App { appCodec := encodingConfig.Marshaler cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -318,16 +365,36 @@ func New( bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) + bApp.SetTxEncoder(encodingConfig.TxConfig.TxEncoder()) keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - wormholemoduletypes.StoreKey, ibccomposabilitytypes.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey - wasm.StoreKey, tokenfactorytypes.StoreKey, - ibchookstypes.StoreKey, packetforwardtypes.StoreKey, + authtypes.StoreKey, + banktypes.StoreKey, + capabilitytypes.StoreKey, + consensusparamstypes.StoreKey, + crisistypes.StoreKey, + + distrtypes.StoreKey, + evidencetypes.StoreKey, + feegrant.StoreKey, + govtypes.StoreKey, + + ibcexported.StoreKey, + ibctransfertypes.StoreKey, + ibccomposabilitytypes.StoreKey, + ibchookstypes.StoreKey, + + minttypes.StoreKey, + paramstypes.StoreKey, + packetforwardtypes.StoreKey, + + stakingtypes.StoreKey, + slashingtypes.StoreKey, + + tokenfactorytypes.StoreKey, + upgradetypes.StoreKey, + wasmtypes.StoreKey, + wormholemoduletypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -337,109 +404,184 @@ func New( cdc: cdc, appCodec: appCodec, interfaceRegistry: interfaceRegistry, + txConfig: encodingConfig.TxConfig, invCheckPeriod: invCheckPeriod, keys: keys, tkeys: tkeys, memKeys: memKeys, } - app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + app.ParamsKeeper = initParamsKeeper( + appCodec, + cdc, + keys[paramstypes.StoreKey], + tkeys[paramstypes.TStoreKey], + ) + + govModAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamstypes.StoreKey], govModAddress) + bApp.SetParamStore(&app.ConsensusParamsKeeper) // add capability keeper and ScopeToModule for ibc module app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) // grant capabilities for the ibc and ibc-transfer modules - app.ScopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + app.ScopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) app.ScopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) // this line is used by starport scaffolding # stargate/app/scopedKeeper - app.scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + app.scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) // add keepers + bech32Prefix := sdk.GetConfig().GetBech32AccountAddrPrefix() app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, + appCodec, + keys[authtypes.StoreKey], + authtypes.ProtoBaseAccount, + maccPerms, + bech32Prefix, + govModAddress, ) + app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), + appCodec, + keys[banktypes.StoreKey], + app.AccountKeeper, + app.ModuleAccountAddrs(), + govModAddress, ) app.WormholeKeeper = *wormholemodulekeeper.NewKeeper( appCodec, keys[wormholemoduletypes.StoreKey], keys[wormholemoduletypes.MemStoreKey], - app.AccountKeeper, app.BankKeeper, + govModAddress, ) stakingKeeper := stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.WormholeKeeper, app.GetSubspace(stakingtypes.ModuleName), + appCodec, + keys[stakingtypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + govModAddress, ) + stakingKeeper.SetWormholekeeper(&app.WormholeKeeper) + app.MintKeeper = mintkeeper.NewKeeper( - appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, - app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, + appCodec, + keys[minttypes.StoreKey], + stakingKeeper, + app.AccountKeeper, + app.BankKeeper, + authtypes.FeeCollectorName, + govModAddress, ) + app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), + appCodec, + keys[distrtypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + stakingKeeper, + authtypes.FeeCollectorName, + govModAddress, ) + app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), + appCodec, + cdc, + keys[slashingtypes.StoreKey], + stakingKeeper, + govModAddress, ) + app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, + appCodec, + keys[crisistypes.StoreKey], + invCheckPeriod, + app.BankKeeper, + authtypes.FeeCollectorName, + govModAddress, + ) + + app.FeeGrantKeeper = feegrantkeeper.NewKeeper( + appCodec, + keys[feegrant.StoreKey], + app.AccountKeeper, ) - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp) + homePath := cast.ToString(appOpts.Get(flags.FlagHome)) + app.UpgradeKeeper = upgradekeeper.NewKeeper( + skipUpgradeHeights, + keys[upgradetypes.StoreKey], + appCodec, + homePath, + bApp, + govModAddress, + ) app.WormholeKeeper.SetUpgradeKeeper(app.UpgradeKeeper) // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( + stakingKeeper.SetHooks( stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), ) + app.StakingKeeper = stakingKeeper // ... other modules keepers // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, app.ScopedIBCKeeper, + appCodec, + keys[ibcexported.StoreKey], + app.GetSubspace(ibcexported.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + app.ScopedIBCKeeper, ) - app.WireICS20PreWasmKeeper(&app.WormholeKeeper) - - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + app.WireICS20PreWasmKeeper() // Create evidence Keeper for to register the IBC light client misbehaviour evidence route evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, + appCodec, + keys[evidencetypes.StoreKey], + app.StakingKeeper, + app.SlashingKeeper, ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper - govRouter.AddRoute(wormholemoduletypes.RouterKey, wormholemodule.NewWormholeGovernanceProposalHandler(app.WormholeKeeper)) + // register the proposal types + govRouter := govv1beta.NewRouter(). + AddRoute(govtypes.RouterKey, govv1beta.ProposalHandler). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). + AddRoute(ibcexported.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, + appCodec, + keys[govtypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + bApp.MsgServiceRouter(), + govtypes.DefaultConfig(), + govModAddress, ) + app.GovKeeper.SetLegacyRouter(govRouter) app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper( + appCodec, app.keys[tokenfactorytypes.StoreKey], - app.GetSubspace(tokenfactorytypes.ModuleName), + maccPerms, app.AccountKeeper, app.BankKeeper, app.DistrKeeper, tokenFactoryCapabilities, + govModAddress, ) // The last arguments can contain custom message handlers, and custom query handlers, @@ -447,45 +589,46 @@ func New( supportedFeatures := "iterator,staking,stargate,wormhole,token_factory" wasmDir := filepath.Join(homePath, "data") + wasmConfig, err := wasm.ReadWasmConfig(appOpts) + if err != nil { + panic("error while reading wasm config: " + err.Error()) + } + // Instantiate wasm keeper with stubs for other modules as we do not need // wasm to be able to write to other modules. - app.wasmKeeper = wasm.NewKeeper( + app.wasmKeeper = wasmkeeper.NewKeeper( appCodec, - keys[wasm.StoreKey], - app.GetSubspace(wasm.ModuleName), + keys[wasmtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.StakingKeeper, - app.DistrKeeper, + distrkeeper.NewQuerier(app.DistrKeeper), + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.scopedWasmKeeper, app.TransferKeeper, - app.WormholeKeeper, app.MsgServiceRouter(), app.GRPCQueryRouter(), wasmDir, - wasm.DefaultWasmConfig(), - // wasmConfig.ToWasmConfig(), + wasmConfig, supportedFeatures, + govModAddress, GetWasmOpts(app, appOpts)..., ) - permissionedWasmKeeper := wasmkeeper.NewDefaultPermissionKeeper(app.wasmKeeper) - app.WormholeKeeper.SetWasmdKeeper(permissionedWasmKeeper) + + app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.wasmKeeper) + app.WormholeKeeper.SetWasmdKeeper(app.ContractKeeper) // the wormhole module must be instantiated after the wasmd module wormholeModule := wormholemodule.NewAppModule(appCodec, app.WormholeKeeper) - // this line is used by starport scaffolding # stargate/app/keeperDefinition - - app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.wasmKeeper) - app.Ics20WasmHooks.ContractKeeper = app.ContractKeeper + app.Ics20WasmHooks.ContractKeeper = &app.wasmKeeper app.IbcComposabilityMwKeeper.SetWasmKeeper(&app.wasmKeeper) // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() ibcRouter.AddRoute(ibctransfertypes.ModuleName, app.TransferStack). - AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)) - // this line is used by starport scaffolding # ibc/app/router + AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)) // TODO: POSSIBLY CHANGE LAST PARAM TOO! app.IBCKeeper.SetRouter(ibcRouter) //upgrade handlers @@ -505,17 +648,17 @@ func New( app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, encodingConfig.TxConfig, ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), + auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.WormholeKeeper), + crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), + gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)).SetWormholeKeeper(app.WormholeKeeper), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), ibc.NewAppModule(app.IBCKeeper), @@ -523,10 +666,10 @@ func New( app.RawIcs20TransferAppModule, wormholeModule, // this line is used by starport scaffolding # stargate/app/appModule - wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), + wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)), ibchooks.NewAppModule(app.AccountKeeper), - packetforward.NewAppModule(app.PacketForwardKeeper), + packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), ibccomposabilitymw.NewAppModule(app.IbcComposabilityMwKeeper), ) @@ -543,7 +686,7 @@ func New( evidencetypes.ModuleName, stakingtypes.ModuleName, vestingtypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, ibctransfertypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -554,7 +697,7 @@ func New( paramstypes.ModuleName, wormholemoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/beginBlockers - wasm.ModuleName, + wasmtypes.ModuleName, tokenfactorytypes.ModuleName, ibchookstypes.ModuleName, packetforwardtypes.ModuleName, @@ -577,11 +720,11 @@ func New( feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, ibctransfertypes.ModuleName, wormholemoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/endBlockers - wasm.ModuleName, + wasmtypes.ModuleName, tokenfactorytypes.ModuleName, ibchookstypes.ModuleName, packetforwardtypes.ModuleName, @@ -608,7 +751,7 @@ func New( govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, paramstypes.ModuleName, @@ -616,15 +759,14 @@ func New( ibctransfertypes.ModuleName, feegrant.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis - wasm.ModuleName, + wasmtypes.ModuleName, tokenfactorytypes.ModuleName, ibchookstypes.ModuleName, packetforwardtypes.ModuleName, ibccomposabilitytypes.ModuleName, ) - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) + app.mm.RegisterInvariants(app.CrisisKeeper) app.mm.RegisterServices(app.configurator) // initialize stores @@ -635,6 +777,14 @@ func New( // register upgrade app.setupUpgradeHandlers(app.configurator) + // SDK v47 - since we do not use dep inject, this gives us access to newer gRPC services. + autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) + reflectionSvc, err := runtimeservices.NewReflectionService() + if err != nil { + panic(err) + } + reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + // initialize BaseApp app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) @@ -651,7 +801,7 @@ func New( if err != nil { panic(err) } - wrappedAnteHandler := WrapAnteHandler(anteHandlerSdk, app.WormholeKeeper, app.IBCKeeper) + wrappedAnteHandler := WrapAnteHandler(anteHandlerSdk, app.WormholeKeeper, app.IBCKeeper, app.wasmKeeper) app.SetAnteHandler(wrappedAnteHandler) app.SetEndBlocker(app.EndBlocker) @@ -662,18 +812,56 @@ func New( if err := app.LoadLatestVersion(); err != nil { tmos.Exit(err.Error()) } + app.CapabilityKeeper.Seal() } + // define the simulation manager + app.sm = module.NewSimulationManager(simulationModules(app, encodingConfig, &wormholeModule)...) + return app } +// simulationModules returns modules for simulation manager +// define the order of the modules for deterministic simulationss +func simulationModules( + app *App, + encodingConfig appparams.EncodingConfig, + wormholeModule *wormholemodule.AppModule, +) []module.AppModuleSimulation { + appCodec := encodingConfig.Marshaler + + return []module.AppModuleSimulation{ + auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), + gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)).SetWormholeKeeper(app.WormholeKeeper), + evidence.NewAppModule(app.EvidenceKeeper), + ibc.NewAppModule(app.IBCKeeper), + params.NewAppModule(app.ParamsKeeper), + app.RawIcs20TransferAppModule, + wormholeModule, + wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)), + packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), + ibccomposabilitymw.NewAppModule(app.IbcComposabilityMwKeeper), + } +} + // Wrap the standard cosmos-sdk antehandlers with additional antehandlers: // - wormhole allowlist antehandler // - default ibc antehandler -func WrapAnteHandler(originalHandler sdk.AnteHandler, wormKeeper wormholemodulekeeper.Keeper, ibcKeeper *ibckeeper.Keeper) sdk.AnteHandler { +func WrapAnteHandler(originalHandler sdk.AnteHandler, wormKeeper wormholemodulekeeper.Keeper, ibcKeeper *ibckeeper.Keeper, wasmdKeeper wasmkeeper.Keeper) sdk.AnteHandler { + wasmdHandler := wormholemoduleante.NewWormholeWasmdDecorator(wormKeeper, wasmdKeeper) whHandler := wormholemoduleante.NewWormholeAllowlistDecorator(wormKeeper) - ibcHandler := ibcante.NewAnteDecorator(ibcKeeper) - newHandlers := sdk.ChainAnteDecorators(whHandler, ibcHandler) + ibcHandler := ibcante.NewRedundantRelayDecorator(ibcKeeper) + + newHandlers := sdk.ChainAnteDecorators(wasmdHandler, whHandler, ibcHandler) + return func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { newCtx, err := originalHandler(ctx, tx, simulate) if err != nil { @@ -746,24 +934,29 @@ func (app *App) InterfaceRegistry() types.InterfaceRegistry { return app.interfaceRegistry } +// TxConfig returns Gaia's TxConfig. +func (app *App) TxConfig() client.TxConfig { + return app.txConfig +} + // GetKey returns the KVStoreKey for the provided store key. // // NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { +func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { return app.keys[storeKey] } // GetTKey returns the TransientStoreKey for the provided store key. // // NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { +func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { return app.tkeys[storeKey] } // GetMemKey returns the MemStoreKey for the provided mem key. // // NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { +func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { return app.memKeys[storeKey] } @@ -779,16 +972,17 @@ func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { // API server. func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx - rpc.RegisterRoutes(clientCtx, apiSvr.Router) - // Register legacy tx routes. - authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) - // Register new tx routes from grpc-gateway. + + // Register tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. + + // Register tendermint queries routes from grpc-gateway. tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) + // Register node gRPC service for grpc-gateway. + nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + + // Register grpc-gateway routes for all modules. ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // register app's OpenAPI routes. @@ -803,7 +997,12 @@ func (app *App) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) + tmservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query) +} + +// RegisterNodeService implements the Application.RegisterNodeService method. +func (app *App) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) } func (app *App) GetWasmKeeper() *wasmkeeper.Keeper { @@ -820,7 +1019,7 @@ func GetMaccPerms() map[string][]string { } // initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { +func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) paramsKeeper.Subspace(authtypes.ModuleName) @@ -829,13 +1028,13 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(minttypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) + paramsKeeper.Subspace(govtypes.ModuleName) paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) + paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(wormholemoduletypes.ModuleName) // this line is used by starport scaffolding # stargate/app/paramSubspace - paramsKeeper.Subspace(wasm.ModuleName) + paramsKeeper.Subspace(wasmtypes.ModuleName) paramsKeeper.Subspace(tokenfactorytypes.ModuleName) paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable()) @@ -853,13 +1052,13 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino // It can be safely skipped when sending. // // After this, the wasm keeper is required to be set on app.Ics20WasmHooks -func (app *App) WireICS20PreWasmKeeper(wk *wormholemodulekeeper.Keeper) { +func (app *App) WireICS20PreWasmKeeper() { // Configure the ibc composability mw keeper ibcComposabilityMwKeeper := ibccomposabilitymwkeeper.NewKeeper( app.appCodec, app.keys[ibccomposabilitytypes.StoreKey], nil, // Wasm keeper is set later - wk, + &app.WormholeKeeper, 0, time.Hour, ) @@ -877,7 +1076,7 @@ func (app *App) WireICS20PreWasmKeeper(wk *wormholemodulekeeper.Keeper) { app.IBCHooksKeeper = &ibcHooksKeeper // Setup the ICS4Wrapper used by the hooks middleware - wormPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix() + wormPrefix := Bech32Prefix wasmHooks := ibchooks.NewWasmHooks(&ibcHooksKeeper, nil, wormPrefix) // The contract keeper needs to be set later app.Ics20WasmHooks = &wasmHooks app.HooksICS4Wrapper = ibchooks.NewICS4Middleware( @@ -886,33 +1085,33 @@ func (app *App) WireICS20PreWasmKeeper(wk *wormholemodulekeeper.Keeper) { ) // Create Transfer Keepers - transferKeeper := ibctransferkeeper.NewKeeper( + app.TransferKeeper = ibctransferkeeper.NewKeeper( app.appCodec, app.keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - // The ICS4Wrapper is replaced by the HooksICS4Wrapper instead of the channel + app.HooksICS4Wrapper, + app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper, ) - app.TransferKeeper = transferKeeper + app.RawIcs20TransferAppModule = transfer.NewAppModule(app.TransferKeeper) // Packet Forward Middleware - // Initialize packet forward middleware router app.PacketForwardKeeper = packetforwardkeeper.NewKeeper( app.appCodec, app.keys[packetforwardtypes.StoreKey], - app.GetSubspace(packetforwardtypes.ModuleName), app.TransferKeeper, app.IBCKeeper.ChannelKeeper, app.DistrKeeper, app.BankKeeper, // The ICS4Wrapper is replaced by the HooksICS4Wrapper instead of the channel so that sending can be overridden by the middleware app.HooksICS4Wrapper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // Set up transfer stack @@ -967,6 +1166,11 @@ func (app *App) setupUpgradeHandlers(cfg module.Configurator) { } } +// SimulationManager implements the SimulationApp interface +func (app *App) SimulationManager() *module.SimulationManager { + return app.sm +} + // BaseAppParamManager defines an interrace that BaseApp is expected to fullfil // that allows upgrade handlers to modify BaseApp parameters. type BaseAppParamManager interface { @@ -990,5 +1194,5 @@ type Upgrade struct { ) upgradetypes.UpgradeHandler // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. - StoreUpgrades store.StoreUpgrades + StoreUpgrades storetypes.StoreUpgrades } diff --git a/wormchain/app/apptesting/mock_key.go b/wormchain/app/apptesting/mock_key.go index 1a8656d8b3..f0cae6883b 100644 --- a/wormchain/app/apptesting/mock_key.go +++ b/wormchain/app/apptesting/mock_key.go @@ -1,9 +1,9 @@ package apptesting import ( - "github.com/tendermint/tendermint/crypto" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" + "github.com/cometbft/cometbft/crypto" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" diff --git a/wormchain/app/apptesting/test_helpers.go b/wormchain/app/apptesting/test_helpers.go index ddeb0f34e3..e462e68b3c 100644 --- a/wormchain/app/apptesting/test_helpers.go +++ b/wormchain/app/apptesting/test_helpers.go @@ -6,6 +6,14 @@ import ( "time" "github.com/CosmWasm/wasmd/x/wasm/keeper" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + baseapp "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -14,21 +22,13 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/ed25519" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tm-db" "github.com/wormhole-foundation/wormchain/app" appparams "github.com/wormhole-foundation/wormchain/app/params" ) // SimAppChainID hardcoded chainID for simulation const ( - SimAppChainID = "wormchain-app" + SimAppChainID = "testing" ) // EmptyBaseAppOptions is a stub implementing AppOptions @@ -41,8 +41,8 @@ func (ao EmptyBaseAppOptions) Get(_ string) interface{} { // DefaultConsensusParams defines the default Tendermint consensus params used // in wormApp testing. -var DefaultConsensusParams = &abci.ConsensusParams{ - Block: &abci.BlockParams{ +var DefaultConsensusParams = &tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, @@ -104,12 +104,16 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, AppStateBytes: stateBytes, + ChainId: SimAppChainID, + Time: time.Now().UTC(), + InitialHeight: 1, }, ) // commit genesis changes wormApp.Commit() wormApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + ChainID: SimAppChainID, Height: wormApp.LastBlockHeight() + 1, AppHash: wormApp.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), @@ -121,23 +125,23 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs func setup(withGenesis bool, invCheckPeriod uint) (*app.App, app.GenesisState) { db := dbm.NewMemDB() - encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) + encoding := app.MakeEncodingConfig() wormApp := app.New( log.NewNopLogger(), db, nil, true, map[int64]bool{}, - app.DefaultNodeHome, invCheckPeriod, encoding, EmptyBaseAppOptions{}, + baseapp.SetChainID(SimAppChainID), ) if withGenesis { - return wormApp.(*app.App), app.NewDefaultGenesisState(encoding.Marshaler) + return wormApp, app.NewDefaultGenesisState(encoding.Marshaler) } - return wormApp.(*app.App), app.GenesisState{} + return wormApp, app.GenesisState{} } func genesisStateWithValSet(t *testing.T, @@ -184,6 +188,7 @@ func genesisStateWithValSet(t *testing.T, defaultStParams.MaxEntries, defaultStParams.HistoricalEntries, appparams.BondDenom, + defaultStParams.MinCommissionRate, ) // set validators and delegations @@ -213,6 +218,7 @@ func genesisStateWithValSet(t *testing.T, balances, totalSupply, []banktypes.Metadata{}, + []banktypes.SendEnabled{}, ) genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) diff --git a/wormchain/app/apptesting/test_suite.go b/wormchain/app/apptesting/test_suite.go index 7080838eac..568f1f90a9 100644 --- a/wormchain/app/apptesting/test_suite.go +++ b/wormchain/app/apptesting/test_suite.go @@ -6,29 +6,29 @@ import ( "testing" "time" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cometbft/cometbft/libs/log" + tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/store/rootmulti" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/authz" + testutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" + stakinghelper "github.com/cosmos/cosmos-sdk/x/staking/testutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/crypto/ed25519" - "github.com/tendermint/tendermint/libs/log" - tmtypes "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" - authzcodec "github.com/wormhole-foundation/wormchain/x/tokenfactory/types/authzcodec" + authzcodec "github.com/wormhole-foundation/wormchain/x/tokenfactory/testhelpers" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/wormhole-foundation/wormchain/app" @@ -41,6 +41,8 @@ type KeeperTestHelper struct { Ctx sdk.Context QueryHelper *baseapp.QueryServiceTestHelper TestAccs []sdk.AccAddress + + StakingHelper *stakinghelper.Helper } var ( @@ -51,18 +53,23 @@ var ( // Setup sets up basic environment for suite (App, Ctx, and test accounts) func (s *KeeperTestHelper) Setup() { s.App = Setup(s.T(), true, 0) - s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "osmosis-1", Time: time.Now().UTC()}) + s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: SimAppChainID, Time: time.Now().UTC()}) s.QueryHelper = &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: s.App.GRPCQueryRouter(), Ctx: s.Ctx, } s.TestAccs = CreateRandomAccounts(3) + + s.StakingHelper = stakinghelper.NewHelper(s.Suite.T(), s.Ctx, s.App.StakingKeeper) + s.StakingHelper.Denom = "uworm" } func (s *KeeperTestHelper) SetupTestForInitGenesis() { // Setting to True, leads to init genesis not running s.App = Setup(s.T(), true, 0) - s.Ctx = s.App.BaseApp.NewContext(true, tmtypes.Header{}) + s.Ctx = s.App.BaseApp.NewContext(true, tmtypes.Header{ + ChainID: SimAppChainID, + }) } // CreateTestContext creates a test context. @@ -86,20 +93,20 @@ func (s *KeeperTestHelper) Commit() { oldHeight := s.Ctx.BlockHeight() oldHeader := s.Ctx.BlockHeader() s.App.Commit() - newHeader := tmtypes.Header{Height: oldHeight + 1, ChainID: oldHeader.ChainID, Time: oldHeader.Time.Add(time.Second)} + newHeader := tmtypes.Header{Height: oldHeight + 1, ChainID: SimAppChainID, Time: oldHeader.Time.Add(time.Second)} s.App.BeginBlock(abci.RequestBeginBlock{Header: newHeader}) s.Ctx = s.App.NewContext(false, newHeader) } // FundAcc funds target address with specified amount. func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins) { - err := simapp.FundAccount(s.App.BankKeeper, s.Ctx, acc, amounts) + err := testutil.FundAccount(s.App.BankKeeper, s.Ctx, acc, amounts) s.Require().NoError(err) } // FundModuleAcc funds target modules with specified amount. func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins) { - err := simapp.FundModuleAccount(s.App.BankKeeper, s.Ctx, moduleName, amounts) + err := testutil.FundModuleAccount(s.App.BankKeeper, s.Ctx, moduleName, amounts) s.Require().NoError(err) } @@ -117,12 +124,8 @@ func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sd s.FundAcc(sdk.AccAddress(valAddr), selfBond) - stakingHandler := staking.NewHandler(s.App.StakingKeeper) - stakingCoin := sdk.NewCoin(sdk.DefaultBondDenom, selfBond[0].Amount) - ZeroCommission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - msg, err := stakingtypes.NewMsgCreateValidator(valAddr, valPub, stakingCoin, stakingtypes.Description{}, ZeroCommission, sdk.OneInt()) - s.Require().NoError(err) - res, err := stakingHandler(s.Ctx, msg) + msg := s.StakingHelper.CreateValidatorMsg(valAddr, valPub, selfBond[0].Amount) + res, err := s.StakingHelper.CreateValidatorWithMsg(s.Ctx, msg) s.Require().NoError(err) s.Require().NotNil(res) @@ -182,7 +185,8 @@ func (s *KeeperTestHelper) BeginNewBlockWithProposer(proposer sdk.ValAddress) { header := tmtypes.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime} newCtx := s.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(s.Ctx.BlockHeight() + 1) s.Ctx = newCtx - lastCommitInfo := abci.LastCommitInfo{ + + lastCommitInfo := abci.CommitInfo{ Votes: []abci.VoteInfo{{ Validator: abci.Validator{Address: valAddr, Power: 1000}, SignedLastBlock: true, @@ -207,7 +211,7 @@ func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, re // allocate reward tokens to distribution module coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, rewardAmt)} - err := simapp.FundModuleAccount(s.App.BankKeeper, s.Ctx, distrtypes.ModuleName, coins) + err := testutil.FundModuleAccount(s.App.BankKeeper, s.Ctx, distrtypes.ModuleName, coins) s.Require().NoError(err) // allocate rewards to validator @@ -263,26 +267,26 @@ func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) { // Authz: Grant Msg typeURL := sdk.MsgTypeURL(msg) - grant, err := authz.NewGrant(authz.NewGenericAuthorization(typeURL), someDate.Add(time.Hour)) + grant, err := authz.NewGrant(someDate.Add(time.Hour), authz.NewGenericAuthorization(typeURL), nil) require.NoError(t, err) msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant} - msgGrantBytes := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgGrant))) - err = authzcodec.ModuleCdc.UnmarshalJSON(msgGrantBytes, &mockMsgGrant) + msgGrantBytes := json.RawMessage(sdk.MustSortJSON(authzcodec.AuthzModuleCdc.MustMarshalJSON(&msgGrant))) + err = authzcodec.AuthzModuleCdc.UnmarshalJSON(msgGrantBytes, &mockMsgGrant) require.NoError(t, err) // Authz: Revoke Msg msgRevoke := authz.MsgRevoke{Granter: mockGranter, Grantee: mockGrantee, MsgTypeUrl: typeURL} - msgRevokeByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgRevoke))) - err = authzcodec.ModuleCdc.UnmarshalJSON(msgRevokeByte, &mockMsgRevoke) + msgRevokeByte := json.RawMessage(sdk.MustSortJSON(authzcodec.AuthzModuleCdc.MustMarshalJSON(&msgRevoke))) + err = authzcodec.AuthzModuleCdc.UnmarshalJSON(msgRevokeByte, &mockMsgRevoke) require.NoError(t, err) // Authz: Exec Msg msgAny, err := cdctypes.NewAnyWithValue(msg) require.NoError(t, err) msgExec := authz.MsgExec{Grantee: mockGrantee, Msgs: []*cdctypes.Any{msgAny}} - execMsgByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgExec))) - err = authzcodec.ModuleCdc.UnmarshalJSON(execMsgByte, &mockMsgExec) + execMsgByte := json.RawMessage(sdk.MustSortJSON(authzcodec.AuthzModuleCdc.MustMarshalJSON(&msgExec))) + err = authzcodec.AuthzModuleCdc.UnmarshalJSON(execMsgByte, &mockMsgExec) require.NoError(t, err) require.Equal(t, msgExec.Msgs[0].Value, mockMsgExec.Msgs[0].Value) } diff --git a/wormchain/app/encoding.go b/wormchain/app/encoding.go new file mode 100644 index 0000000000..d29c058011 --- /dev/null +++ b/wormchain/app/encoding.go @@ -0,0 +1,17 @@ +package app + +import ( + "github.com/cosmos/cosmos-sdk/std" + + "github.com/wormhole-foundation/wormchain/app/params" +) + +// MakeEncodingConfig creates an EncodingConfig for testing +func MakeEncodingConfig() params.EncodingConfig { + encodingConfig := params.MakeEncodingConfig() + std.RegisterLegacyAminoCodec(encodingConfig.Amino) + std.RegisterInterfaces(encodingConfig.InterfaceRegistry) + ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) + ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + return encodingConfig +} diff --git a/wormchain/app/export.go b/wormchain/app/export.go index 41dcc83d29..7bdb19c322 100644 --- a/wormchain/app/export.go +++ b/wormchain/app/export.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,10 +15,7 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. -func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, -) (servertypes.ExportedApp, error) { - +func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) @@ -30,22 +27,19 @@ func (app *App) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesis(ctx, app.appCodec) + genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err } validators, err := staking.WriteValidators(ctx, app.StakingKeeper) - if err != nil { - return servertypes.ExportedApp{}, err - } return servertypes.ExportedApp{ AppState: appState, Validators: validators, Height: height, ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil + }, err } // prepare for fresh start at zero height diff --git a/wormchain/app/openapiconsole/console.go b/wormchain/app/openapiconsole/console.go new file mode 100644 index 0000000000..65fea6b962 --- /dev/null +++ b/wormchain/app/openapiconsole/console.go @@ -0,0 +1,27 @@ +package openapiconsole + +import ( + "embed" + "html/template" + "net/http" +) + +// index.tpl is the template file for the OpenAPI console +// +//go:embed index.tpl +var index embed.FS + +// Handler returns an http handler that servers OpenAPI console for an OpenAPI spec at specURL. +func Handler(title, specURL string) http.HandlerFunc { + t, _ := template.ParseFS(index, "index.tpl") + + return func(w http.ResponseWriter, _ *http.Request) { + t.Execute(w, struct { //nolint:errcheck + Title string + URL string + }{ + title, + specURL, + }) + } +} diff --git a/wormchain/app/openapiconsole/index.tpl b/wormchain/app/openapiconsole/index.tpl new file mode 100644 index 0000000000..d88cd5b09a --- /dev/null +++ b/wormchain/app/openapiconsole/index.tpl @@ -0,0 +1,25 @@ + + + + + {{ .Title }} + + + + +
+ + + + + \ No newline at end of file diff --git a/wormchain/app/params/encoding.go b/wormchain/app/params/encoding.go new file mode 100644 index 0000000000..1043c5ab53 --- /dev/null +++ b/wormchain/app/params/encoding.go @@ -0,0 +1,32 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Marshaler codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} + +// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func MakeEncodingConfig() EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry := types.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) + + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Marshaler: marshaler, + TxConfig: txCfg, + Amino: amino, + } +} diff --git a/wormchain/app/v2_23_0_upgrade.go b/wormchain/app/v2_23_0_upgrade.go index 9d40ff89eb..b0c267922e 100644 --- a/wormchain/app/v2_23_0_upgrade.go +++ b/wormchain/app/v2_23_0_upgrade.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" ibccomposabilitytypes "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" ibchookstypes "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" tokenfactorytypes "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" diff --git a/wormchain/app/v3_0_0_upgrade.go b/wormchain/app/v3_0_0_upgrade.go new file mode 100644 index 0000000000..bf4bf588e2 --- /dev/null +++ b/wormchain/app/v3_0_0_upgrade.go @@ -0,0 +1,116 @@ +package app + +import ( + "fmt" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/baseapp" + store "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tokenfactorytypes "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" + wormholetypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +var V3_0_0_Upgrade = Upgrade{ + UpgradeName: "v3.0.0", + CreateUpgradeHandler: CreateV3_0_0_UpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + crisistypes.ModuleName, // add crisis module store + consensustypes.ModuleName, // add consensus module store + }, + }, +} + +func CreateV3_0_0_UpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + app *App, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + logger := ctx.Logger().With("upgrade", "v3.0.0") + logger.Info("Starting Upgrade") + + // set param key table for params module migration + // ref: https://github.com/cosmos/cosmos-sdk/pull/12363/files + for _, subspace := range app.ParamsKeeper.GetSubspaces() { + subspace := subspace + var keyTable paramstypes.KeyTable + + switch subspace.Name() { + + // cosmos-sdk modules + case authtypes.ModuleName: + keyTable = authtypes.ParamKeyTable() //nolint:staticcheck + case banktypes.ModuleName: + keyTable = banktypes.ParamKeyTable() //nolint:staticcheck + case stakingtypes.ModuleName: + keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck + case minttypes.ModuleName: + keyTable = minttypes.ParamKeyTable() //nolint:staticcheck + case distrtypes.ModuleName: + keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck + case slashingtypes.ModuleName: + keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck + case govtypes.ModuleName: + keyTable = govv1.ParamKeyTable() //nolint:staticcheck + case crisistypes.ModuleName: + keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck + + // ibc-go modules + case ibctransfertypes.ModuleName: + keyTable = ibctransfertypes.ParamKeyTable() + + // wasm modules + case wasmtypes.ModuleName: + keyTable = wasmtypes.ParamKeyTable() //nolint:staticcheck + + // wormhole modules + case tokenfactorytypes.ModuleName: + keyTable = tokenfactorytypes.ParamKeyTable() + case wormholetypes.ModuleName: + continue // skip wormhole module + } + + if !subspace.HasKeyTable() { + subspace.WithKeyTable(keyTable) + } + } + + // migrate params to new conensus params keeper + // ref:https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md#xconsensus + baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) + baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) + + // Run migrations + logger.Info(fmt.Sprintf("pre migrate version map: %v", vm)) + versionMap, err := mm.RunMigrations(ctx, cfg, vm) + if err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("post migrate version map: %v", versionMap)) + + // explicitly update the IBC 02-client params, adding the localhost client type + // ref: https://github.com/cosmos/ibc-go/blob/main/docs/docs/05-migrations/09-v7-to-v7_1.md + params := app.IBCKeeper.ClientKeeper.GetParams(ctx) + params.AllowedClients = append(params.AllowedClients, ibcexported.Localhost) + app.IBCKeeper.ClientKeeper.SetParams(ctx, params) + + return versionMap, err + } +} diff --git a/wormchain/app/wasm_handlers/account.go b/wormchain/app/wasm_handlers/account.go deleted file mode 100644 index 81b4329387..0000000000 --- a/wormchain/app/wasm_handlers/account.go +++ /dev/null @@ -1,30 +0,0 @@ -package wasm_handlers - -import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -type AccountKeeperHandler struct { - AccountKeeper authkeeper.AccountKeeper -} - -var _ wasmtypes.AccountKeeper = &AccountKeeperHandler{} - -func (b *AccountKeeperHandler) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI { - // New accounts are needed for new contracts - return b.AccountKeeper.NewAccountWithAddress(ctx, addr) -} - -// Retrieve an account from the store. -func (b *AccountKeeperHandler) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI { - return b.AccountKeeper.GetAccount(ctx, addr) -} - -// Set an account in the store. -func (b *AccountKeeperHandler) SetAccount(ctx sdk.Context, acc authtypes.AccountI) { - // New accounts are needed for new contracts - b.AccountKeeper.SetAccount(ctx, acc) -} diff --git a/wormchain/app/wasm_handlers/bank.go b/wormchain/app/wasm_handlers/bank.go deleted file mode 100644 index 19d86fecb1..0000000000 --- a/wormchain/app/wasm_handlers/bank.go +++ /dev/null @@ -1,51 +0,0 @@ -package wasm_handlers - -import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" -) - -type BankViewKeeperHandler struct { - Keeper bankkeeper.Keeper -} -type BurnerHandler struct { - Keeper bankkeeper.Keeper -} - -type BankKeeperHandler struct { - BankViewKeeperHandler - BurnerHandler -} - -var _ wasmtypes.BankViewKeeper = &BankViewKeeperHandler{} -var _ wasmtypes.Burner = &BurnerHandler{} -var _ wasmtypes.BankKeeper = &BankKeeperHandler{} - -func (b *BankViewKeeperHandler) GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins { - return b.Keeper.GetAllBalances(ctx, addr) -} -func (b *BankViewKeeperHandler) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin { - return b.Keeper.GetBalance(ctx, addr, denom) -} -func (b *BankViewKeeperHandler) GetSupply(ctx sdk.Context, denom string) sdk.Coin { - return b.Keeper.GetSupply(ctx, denom) -} - -func (b *BurnerHandler) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { - return b.Keeper.BurnCoins(ctx, moduleName, amt) -} - -func (b *BurnerHandler) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { - return b.Keeper.SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt) -} - -func (b *BankKeeperHandler) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error { - return b.BankViewKeeperHandler.Keeper.IsSendEnabledCoins(ctx, coins...) -} -func (b *BankKeeperHandler) BlockedAddr(addr sdk.AccAddress) bool { - return b.BankViewKeeperHandler.Keeper.BlockedAddr(addr) -} -func (b *BankKeeperHandler) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error { - return b.BankViewKeeperHandler.Keeper.SendCoins(ctx, fromAddr, toAddr, amt) -} diff --git a/wormchain/app/wasm_handlers/capability.go b/wormchain/app/wasm_handlers/capability.go deleted file mode 100644 index dbe27a6a28..0000000000 --- a/wormchain/app/wasm_handlers/capability.go +++ /dev/null @@ -1,24 +0,0 @@ -package wasm_handlers - -import ( - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" -) - -type CapabilityKeeperHandler struct { - ScopedKeeper capabilitykeeper.ScopedKeeper -} - -var _ wasmtypes.CapabilityKeeper = &CapabilityKeeperHandler{} - -func (b *CapabilityKeeperHandler) GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) { - return b.ScopedKeeper.GetCapability(ctx, name) -} -func (b *CapabilityKeeperHandler) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { - return b.ScopedKeeper.ClaimCapability(ctx, cap, name) -} -func (b *CapabilityKeeperHandler) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { - return b.ScopedKeeper.AuthenticateCapability(ctx, cap, name) -} diff --git a/wormchain/app/wasm_handlers/ibc.go b/wormchain/app/wasm_handlers/ibc.go deleted file mode 100644 index 1b3c969709..0000000000 --- a/wormchain/app/wasm_handlers/ibc.go +++ /dev/null @@ -1,82 +0,0 @@ -package wasm_handlers - -import ( - "errors" - - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - ibcappkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" - connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/04-channel/keeper" - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - ibcportkeeper "github.com/cosmos/ibc-go/v4/modules/core/05-port/keeper" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" -) - -// This defines which modules we actually want to expose cosmwasm contracts. -// Right now we only permit methods that are read-only. -// See https://github.com/CosmWasm/wasmd/blob/d63bea442bedf5b3055f3821472c7e6cafc3d813/x/wasm/types/expected_keepers.go - -type ChannelKeeperHandler struct { - Keeper ibckeeper.Keeper -} -type ClientKeeperHandler struct { - Keeper ibckeeper.Keeper -} -type ConnectionKeeperHandler struct { - Keeper ibckeeper.Keeper -} -type PortKeeperHandler struct { - Keeper ibcportkeeper.Keeper -} -type ICS20TransferPortSourceHandler struct { - Keeper ibcappkeeper.Keeper -} - -var _ wasmtypes.ChannelKeeper = &ChannelKeeperHandler{} -var _ wasmtypes.ClientKeeper = &ClientKeeperHandler{} -var _ wasmtypes.ConnectionKeeper = &ConnectionKeeperHandler{} -var _ wasmtypes.PortKeeper = &PortKeeperHandler{} -var _ wasmtypes.ICS20TransferPortSource = &ICS20TransferPortSourceHandler{} - -func (b *ChannelKeeperHandler) GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) { - return b.Keeper.GetChannel(ctx, srcPort, srcChan) -} -func (b *ChannelKeeperHandler) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) { - // not permitted - return 0, false -} -func (b *ChannelKeeperHandler) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { - return errors.New("not permitted") -} -func (b *ChannelKeeperHandler) ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error { - return errors.New("not permitted") -} -func (b *ChannelKeeperHandler) GetAllChannels(ctx sdk.Context) (channels []channeltypes.IdentifiedChannel) { - // not permitted - return []channeltypes.IdentifiedChannel{} -} -func (b *ChannelKeeperHandler) IterateChannels(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool) { - // not permitted -} -func (b *ChannelKeeperHandler) SetChannel(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel) { - // not permitted -} - -func (b *ClientKeeperHandler) GetClientConsensusState(ctx sdk.Context, clientID string) (ibcexported.ConsensusState, bool) { - return nil, false -} - -func (b *ConnectionKeeperHandler) GetConnection(ctx sdk.Context, connectionID string) (connection connectiontypes.ConnectionEnd, found bool) { - return connectiontypes.ConnectionEnd{}, false -} - -func (b *PortKeeperHandler) BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability { - return nil -} - -func (b *ICS20TransferPortSourceHandler) GetPort(ctx sdk.Context) string { - // not permitted - return "" -} diff --git a/wormchain/app/wasm_handlers/staking.go b/wormchain/app/wasm_handlers/staking.go deleted file mode 100644 index 15f9d21386..0000000000 --- a/wormchain/app/wasm_handlers/staking.go +++ /dev/null @@ -1,52 +0,0 @@ -package wasm_handlers - -import ( - "context" - - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -type DistributionKeeperHandler struct { - Keeper distrkeeper.Keeper -} -type StakingKeeperHandler struct { - Keeper stakingkeeper.Keeper -} - -var _ wasmtypes.DistributionKeeper = &DistributionKeeperHandler{} -var _ wasmtypes.StakingKeeper = &StakingKeeperHandler{} - -func (b *DistributionKeeperHandler) DelegationRewards(c context.Context, req *distrtypes.QueryDelegationRewardsRequest) (*distrtypes.QueryDelegationRewardsResponse, error) { - return b.Keeper.DelegationRewards(c, req) -} - -func (b *StakingKeeperHandler) BondDenom(ctx sdk.Context) (res string) { - return b.Keeper.BondDenom(ctx) -} - -func (b *StakingKeeperHandler) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) { - return b.Keeper.GetValidator(ctx, addr) -} - -func (b *StakingKeeperHandler) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator { - return b.Keeper.GetBondedValidatorsByPower(ctx) -} - -func (b *StakingKeeperHandler) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation { - return b.Keeper.GetAllDelegatorDelegations(ctx, delegator) -} - -func (b *StakingKeeperHandler) GetDelegation(ctx sdk.Context, - delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) { - return b.Keeper.GetDelegation(ctx, delAddr, valAddr) -} - -func (b *StakingKeeperHandler) HasReceivingRedelegation(ctx sdk.Context, - delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool { - return b.Keeper.HasReceivingRedelegation(ctx, delAddr, valDstAddr) -} diff --git a/wormchain/chains.yml b/wormchain/chains.yml new file mode 100644 index 0000000000..fb113d6190 --- /dev/null +++ b/wormchain/chains.yml @@ -0,0 +1,11 @@ +# This file is used to create docker images using the heighliner binary. +# ref: https://github.com/strangelove-ventures/heighliner + +- name: wormchain + github-organization: wormhole-foundation + github-repo: wormhole + dockerfile: cosmos + build-target: make client + build-dir: wormchain + binaries: + - wormchain/build/wormchaind \ No newline at end of file diff --git a/wormchain/cmd/wormchaind/main.go b/wormchain/cmd/wormchaind/main.go index 660e6e0f50..ac202d5c94 100644 --- a/wormchain/cmd/wormchaind/main.go +++ b/wormchain/cmd/wormchaind/main.go @@ -3,24 +3,19 @@ package main import ( "os" + "cosmossdk.io/log" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/tendermint/spm/cosmoscmd" + "github.com/wormhole-foundation/wormchain/app" - "github.com/wormhole-foundation/wormchain/x/wormhole/client/cli" ) func main() { - rootCmd, _ := cosmoscmd.NewRootCmd( - app.Name, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.Name, - app.ModuleBasics, - app.New, - // this line is used by starport scaffolding # root/arguments - ) - rootCmd.AddCommand(cli.GetGenesisCmd()) - if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { + app.SetAddressPrefixes() + rootCmd, _ := NewRootCmd() + + if err := svrcmd.Execute(rootCmd, "WORMCHAIND", app.DefaultNodeHome); err != nil { + log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) os.Exit(1) } } diff --git a/wormchain/cmd/wormchaind/root.go b/wormchain/cmd/wormchaind/root.go new file mode 100644 index 0000000000..78a6324b10 --- /dev/null +++ b/wormchain/cmd/wormchaind/root.go @@ -0,0 +1,252 @@ +package main + +import ( + "io" + "os" + + wasm "github.com/CosmWasm/wasmd/x/wasm" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/wormhole-foundation/wormchain/app" + "github.com/wormhole-foundation/wormchain/app/params" + "github.com/wormhole-foundation/wormchain/x/wormhole/client/cli" + + dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cometbft/cometbft/libs/log" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" +) + +// NewRootCmd creates a new root command for a Cosmos SDK application +func NewRootCmd() (*cobra.Command, params.EncodingConfig) { + encodingConfig := app.MakeEncodingConfig() + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Marshaler). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(authtypes.AccountRetriever{}). + WithBroadcastMode(flags.BroadcastSync). + WithHomeDir(app.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: "wormchaind", + Short: "Wormchain", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmcfg.DefaultConfig()) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +func initAppConfig() (string, interface{}) { + srvCfg := serverconfig.DefaultConfig() + + return serverconfig.DefaultConfigTemplate, srvCfg +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + ac := appCreator{ + encCfg: encodingConfig, + } + + rootCmd.AddCommand( + genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + config.Cmd(), + ) + + server.AddCommands( + rootCmd, + app.DefaultNodeHome, + ac.newApp, + ac.appExport, + addModuleInitFlags, + ) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + genesisCommand(encodingConfig), + queryCommand(), + txCommand(), + keys.Commands(app.DefaultNodeHome), + ) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) + wasm.AddModuleInitFlags(startCmd) +} + +// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, app.ModuleBasics, app.DefaultNodeHome) + + for _, subCmd := range cmds { + cmd.AddCommand(subCmd) + } + + // Add wormhole genesis subcommands + for _, subCmd := range cli.GetGenesisCmd().Commands() { + cmd.AddCommand(subCmd) + } + + return cmd +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + app.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + flags.LineBreak, + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + app.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +type appCreator struct { + encCfg params.EncodingConfig +} + +func (ac appCreator) newApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + loadLatest := true + + baseappOptions := server.DefaultBaseappOptions(appOpts) + + return app.New( + logger, + db, + traceStore, + loadLatest, + skipUpgradeHeights, + 0, + app.MakeEncodingConfig(), + appOpts, + baseappOptions..., + ) +} + +func (ac appCreator) appExport( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, + modulesToExport []string, +) (servertypes.ExportedApp, error) { + var interchainapp *app.App + + loadLatest := height == -1 + interchainapp = app.New( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + ac.encCfg, + appOpts, + ) + + if height != -1 { + if err := interchainapp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return interchainapp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) +} diff --git a/wormchain/config.yml b/wormchain/config.yml new file mode 100644 index 0000000000..9debb6e958 --- /dev/null +++ b/wormchain/config.yml @@ -0,0 +1,12 @@ +version: 1 +accounts: +- name: alice + coins: + - 20000token + - 200000000stake +client: + typescript: + path: ts-client + vuex: + path: vue/src/store +validators: [] diff --git a/wormchain/contracts/tools/__tests__/test_accountant.ts b/wormchain/contracts/tools/__tests__/test_accountant.ts index 5c534cb055..1c8e9ca3bd 100644 --- a/wormchain/contracts/tools/__tests__/test_accountant.ts +++ b/wormchain/contracts/tools/__tests__/test_accountant.ts @@ -30,7 +30,7 @@ import * as devnetConsts from "../devnet-consts.json"; import { parseUnits } from "ethers/lib/utils"; import { CosmWasmClient } from "@cosmjs/cosmwasm-stargate"; -jest.setTimeout(120000); +jest.setTimeout(300000); if (process.env.INIT_SIGNERS_KEYS_CSV === "undefined") { let msg = `.env is missing. run "make contracts-tools-deps" to fetch.`; diff --git a/wormchain/contracts/tools/__tests__/test_ntt_accountant.ts b/wormchain/contracts/tools/__tests__/test_ntt_accountant.ts index 0b8c0907bc..068f57f31a 100644 --- a/wormchain/contracts/tools/__tests__/test_ntt_accountant.ts +++ b/wormchain/contracts/tools/__tests__/test_ntt_accountant.ts @@ -281,21 +281,23 @@ const makeVAA = ( const submitVAA = async (vaa: VAA) => { const msg = client.wasm.msgExecuteContract({ - sender: signer, - contract: NTT_GA_ADDRESS, - msg: toUtf8( - JSON.stringify({ - submit_vaas: { - vaas: [ - Buffer.from( - serialiseVAA(vaa as unknown as VAA), - "hex" - ).toString("base64"), - ], - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: NTT_GA_ADDRESS, + msg: toUtf8( + JSON.stringify({ + submit_vaas: { + vaas: [ + Buffer.from( + serialiseVAA(vaa as unknown as VAA), + "hex" + ).toString("base64"), + ], + }, + }) + ), + funds: [], + }, }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -1023,11 +1025,11 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_events_received <= - beforeMetrics.global_accountant_events_received || + beforeMetrics.global_accountant_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_transfer_vaas_submitted_and_approved <= - beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved + beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved ); const transferStatus = await fetchGlobalAccountantTransferStatus( HUB_CHAIN, @@ -1059,16 +1061,18 @@ describe("NTT Global Accountant Tests", () => { // check replay protection { const msg = client.wasm.msgExecuteContract({ - sender: signer, - contract: NTT_GA_ADDRESS, - msg: toUtf8( - JSON.stringify({ - submit_vaas: { - vaas: [Buffer.from(signedVAA).toString("base64")], - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: NTT_GA_ADDRESS, + msg: toUtf8( + JSON.stringify({ + submit_vaas: { + vaas: [Buffer.from(signedVAA).toString("base64")], + }, + }) + ), + funds: [], + }, }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -1098,11 +1102,11 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_total_balance_errors <= - beforeMetrics.global_accountant_total_balance_errors + beforeMetrics.global_accountant_total_balance_errors ); // the transfer should fail, because there's an insufficient source balance if (VAA_SIGNERS.length > 1) { @@ -1150,6 +1154,7 @@ describe("NTT Global Accountant Tests", () => { receipt, CONTRACTS.DEVNET.bsc.core ); + // poll until the guardian(s) witness and sign the vaa await getSignedVAAWithRetry( GUARDIAN_RPCS, @@ -1162,14 +1167,15 @@ describe("NTT Global Accountant Tests", () => { 1000, 30 ); + await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_events_received <= - beforeMetrics.global_accountant_events_received || + beforeMetrics.global_accountant_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_transfer_vaas_submitted_and_approved <= - beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved + beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved ); const transferStatus = await fetchGlobalAccountantTransferStatus( SPOKE_CHAIN_A, @@ -1226,6 +1232,7 @@ describe("NTT Global Accountant Tests", () => { receipt, CONTRACTS.DEVNET.bsc.core ); + // poll until the guardian(s) witness and sign the vaa await getSignedVAAWithRetry( GUARDIAN_RPCS, @@ -1238,14 +1245,15 @@ describe("NTT Global Accountant Tests", () => { 1000, 30 ); + await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_events_received <= - beforeMetrics.global_accountant_events_received || + beforeMetrics.global_accountant_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_transfer_vaas_submitted_and_approved <= - beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved + beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved ); const transferStatus = await fetchGlobalAccountantTransferStatus( SPOKE_CHAIN_A, @@ -1297,9 +1305,9 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted + beforeMetrics.global_accountant_transfer_vaas_submitted ); // the transfer should fail, because there's an insufficient source balance await expect( @@ -1340,9 +1348,9 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted + beforeMetrics.global_accountant_transfer_vaas_submitted ); // the transfer should fail, because there's an insufficient source balance await expect( @@ -1383,9 +1391,9 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted + beforeMetrics.global_accountant_transfer_vaas_submitted ); // the transfer should fail, because there's an insufficient source balance await expect( @@ -1416,9 +1424,9 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted + beforeMetrics.global_accountant_transfer_vaas_submitted ); // the transfer should fail, because there's an insufficient source balance await expect( @@ -1450,11 +1458,11 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_error_events_received <= - beforeMetrics.global_accountant_error_events_received || + beforeMetrics.global_accountant_error_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_total_balance_errors <= - beforeMetrics.global_accountant_total_balance_errors + beforeMetrics.global_accountant_total_balance_errors ); // the transfer should fail, because there's an insufficient source balance if (VAA_SIGNERS.length > 1) { @@ -1529,11 +1537,11 @@ describe("NTT Global Accountant Tests", () => { await waitForMetricsChange( (afterMetrics) => afterMetrics.global_accountant_events_received <= - beforeMetrics.global_accountant_events_received || + beforeMetrics.global_accountant_events_received || afterMetrics.global_accountant_transfer_vaas_submitted <= - beforeMetrics.global_accountant_transfer_vaas_submitted || + beforeMetrics.global_accountant_transfer_vaas_submitted || afterMetrics.global_accountant_transfer_vaas_submitted_and_approved <= - beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved + beforeMetrics.global_accountant_transfer_vaas_submitted_and_approved ); const transferStatus = await fetchGlobalAccountantTransferStatus( HUB_CHAIN, @@ -1565,16 +1573,18 @@ describe("NTT Global Accountant Tests", () => { // check replay protection { const msg = client.wasm.msgExecuteContract({ - sender: signer, - contract: NTT_GA_ADDRESS, - msg: toUtf8( - JSON.stringify({ - submit_vaas: { - vaas: [Buffer.from(signedVAA).toString("base64")], - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: NTT_GA_ADDRESS, + msg: toUtf8( + JSON.stringify({ + submit_vaas: { + vaas: [Buffer.from(signedVAA).toString("base64")], + }, + }) + ), + funds: [], + }, }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, diff --git a/wormchain/contracts/tools/accountant_register_mainnet.ts b/wormchain/contracts/tools/accountant_register_mainnet.ts index 5100c88f64..834a8cd2de 100644 --- a/wormchain/contracts/tools/accountant_register_mainnet.ts +++ b/wormchain/contracts/tools/accountant_register_mainnet.ts @@ -28,23 +28,25 @@ async function main() { console.log("wormchain contract deployer is: ", signer); const msg = client.wasm.msgExecuteContract({ - sender: signer, - contract: - "wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465", - msg: toUtf8( - JSON.stringify({ - submit_vaas: { - vaas: [ - Buffer.from( - // This is the mainnet governance VAA for registering the Sui Token Bridge signed by the Guardians https://api.wormscan.io/api/v1/vaas/1/0000000000000000000000000000000000000000000000000000000000000004/8526464727442833848 - "01000000030d00a42d36048a27a763413bfa1d261daeb86f7feed7a9850d9915d8c44acee97dd4327c0351648ac4d496050e6af6534badd2b86416a5675f373e5a5ebf876505700002349ec8ae9aeef147e87b2b06a475d6ec760c20680285ecdd6b7b400cbd67504232e0cae965d27dc9f0a83fbed40ec0a759bd7ad9a014a69c90364a1df88048dc000323d01a78c01887d981e22ffb0f91d02c1d7f015393513db3f215af64bd9cb74829eb08fc9895f8b1247933dd23c2b71ac1bf5bbefb8bea829ab2f6b94317eaa901040305b91b17227313395a861365c8b110414e961ccf25a2b645226e6a307e488f6dace0896c354425f5dfb6b0cb968ef1f752653cd85179b9344f215b555601dd01060dcfd80b54b6f43e502b9628a5a2b92b453fa96718397ecbe0e279495ff37c0835fff5ee7f3b749de287a0c3440105ddd705d06975d56384792373645b7787df000715985ff2cf28e3a8062d9ffc7ef69fbd7c56082f0938cc564586d0dbcacf14986579e7d7a8629dc8a9cfcbf0c97c46ae6492d05c5fba193400746a43b6f1123d000a5db8adfca6d43dd345e130fa0cae250ac7cfa364a29d47cf219ce2b50d6f930a0e1bc399b5b92cdec3d00fcf6f2c7f0732996344812dae85afcfa077c67d94b8010bf68fe7c2ed3aaa180b01ba28052fa63d72509e642bf45f8b5c14c582d8e6eb99514d41ab7fd3f6451470e02a054a3630e347020b6330a8ec23efdc3e4da4550b010d7f3ec58dbb8ae21a2fb71941ed80d646469f1992e7fdc32706c327bfbe01b98011e8b377fce487237f9238fe9af09991f5da11d85aba5a4a81e99df8d066aead010e18e7de979a55bd568b26754fdd7d9e7b03572d742e5657f944ab35b44398a40e07a0c2399e13a244277138375e7e980bf6b666f39bc2f86afd2605f0249a5a53000f77d089279a354b7faa1f3fdc084f6e0ef684d9bcce8d9fb11b5568c0d0b215f15d54cc4383e1b7112fadc238f750b885f5f81a21f84e00ec4487a8064386cc2e01106d9d3067e19413e985f76852eb0cdd071fef659540ddf3a9d5610d492a68a13c61cd109f64c977c1274f9782dcbddfa46ee94331e02f98ba8fb37e22300bd63e0111819a499e30feb82190736054d2993918aeb591e3098b4df77630e93512fec4c122f2cccfe88f2b735f42a06571944d800f3dfcb07de7956330515ddb3c9a41360000000000764b7752000100000000000000000000000000000000000000000000000000000000000000047654167e9520c1b820000000000000000000000000000000000000000000546f6b656e4272696467650100000015ccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5", - "hex" - ).toString("base64"), - ], - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: + "wormhole14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9srrg465", + msg: toUtf8( + JSON.stringify({ + submit_vaas: { + vaas: [ + Buffer.from( + // This is the mainnet governance VAA for registering the Sui Token Bridge signed by the Guardians https://api.wormscan.io/api/v1/vaas/1/0000000000000000000000000000000000000000000000000000000000000004/8526464727442833848 + "01000000030d00a42d36048a27a763413bfa1d261daeb86f7feed7a9850d9915d8c44acee97dd4327c0351648ac4d496050e6af6534badd2b86416a5675f373e5a5ebf876505700002349ec8ae9aeef147e87b2b06a475d6ec760c20680285ecdd6b7b400cbd67504232e0cae965d27dc9f0a83fbed40ec0a759bd7ad9a014a69c90364a1df88048dc000323d01a78c01887d981e22ffb0f91d02c1d7f015393513db3f215af64bd9cb74829eb08fc9895f8b1247933dd23c2b71ac1bf5bbefb8bea829ab2f6b94317eaa901040305b91b17227313395a861365c8b110414e961ccf25a2b645226e6a307e488f6dace0896c354425f5dfb6b0cb968ef1f752653cd85179b9344f215b555601dd01060dcfd80b54b6f43e502b9628a5a2b92b453fa96718397ecbe0e279495ff37c0835fff5ee7f3b749de287a0c3440105ddd705d06975d56384792373645b7787df000715985ff2cf28e3a8062d9ffc7ef69fbd7c56082f0938cc564586d0dbcacf14986579e7d7a8629dc8a9cfcbf0c97c46ae6492d05c5fba193400746a43b6f1123d000a5db8adfca6d43dd345e130fa0cae250ac7cfa364a29d47cf219ce2b50d6f930a0e1bc399b5b92cdec3d00fcf6f2c7f0732996344812dae85afcfa077c67d94b8010bf68fe7c2ed3aaa180b01ba28052fa63d72509e642bf45f8b5c14c582d8e6eb99514d41ab7fd3f6451470e02a054a3630e347020b6330a8ec23efdc3e4da4550b010d7f3ec58dbb8ae21a2fb71941ed80d646469f1992e7fdc32706c327bfbe01b98011e8b377fce487237f9238fe9af09991f5da11d85aba5a4a81e99df8d066aead010e18e7de979a55bd568b26754fdd7d9e7b03572d742e5657f944ab35b44398a40e07a0c2399e13a244277138375e7e980bf6b666f39bc2f86afd2605f0249a5a53000f77d089279a354b7faa1f3fdc084f6e0ef684d9bcce8d9fb11b5568c0d0b215f15d54cc4383e1b7112fadc238f750b885f5f81a21f84e00ec4487a8064386cc2e01106d9d3067e19413e985f76852eb0cdd071fef659540ddf3a9d5610d492a68a13c61cd109f64c977c1274f9782dcbddfa46ee94331e02f98ba8fb37e22300bd63e0111819a499e30feb82190736054d2993918aeb591e3098b4df77630e93512fec4c122f2cccfe88f2b735f42a06571944d800f3dfcb07de7956330515ddb3c9a41360000000000764b7752000100000000000000000000000000000000000000000000000000000000000000047654167e9520c1b820000000000000000000000000000000000000000000546f6b656e4272696467650100000015ccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5", + "hex" + ).toString("base64"), + ], + }, + }) + ), + funds: [], + } }); const res = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, diff --git a/wormchain/contracts/tools/deploy_wormchain.ts b/wormchain/contracts/tools/deploy_wormchain.ts index cc1273be93..877ca7e628 100644 --- a/wormchain/contracts/tools/deploy_wormchain.ts +++ b/wormchain/contracts/tools/deploy_wormchain.ts @@ -147,11 +147,15 @@ async function main() { }; vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); console.log("uploading", file); + const msg = client.core.msgStoreCode({ - signer, - wasm_byte_code: new Uint8Array(contract_bytes), - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + wasmByteCode: new Uint8Array(contract_bytes), + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); + const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, gas: "10000000", @@ -173,13 +177,13 @@ async function main() { // Instantiate contracts. - async function instantiate(code_id: number, inst_msg: any, label: string) { + async function instantiate(codeId: number, inst_msg: any, label: string) { const instMsgBinary = toBinary(inst_msg); const instMsgBytes = fromBase64(instMsgBinary); // see /sdk/vaa/governance.go const codeIdBuf = Buffer.alloc(8); - codeIdBuf.writeBigInt64BE(BigInt(code_id)); + codeIdBuf.writeBigInt64BE(BigInt(codeId)); const codeIdHash = keccak256(codeIdBuf); const codeIdLabelHash = keccak256( Buffer.concat([ @@ -213,11 +217,13 @@ async function main() { // TODO: check for number of guardians in set and use the corresponding keys vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); const msg = client.core.msgInstantiateContract({ - signer, - code_id, - label, - msg: instMsgBytes, - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + codeId, + label, + msg: instMsgBytes, + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -229,7 +235,7 @@ async function main() { .events.find(({ type }) => type === "instantiate") .attributes.find(({ key }) => key === "_contract_address").value; console.log( - `deployed contract ${label}, codeID: ${code_id}, address: ${addr}, txHash: ${result.transactionHash}` + `deployed contract ${label}, codeID: ${codeId}, address: ${addr}, txHash: ${result.transactionHash}` ); return addr; @@ -267,16 +273,18 @@ async function main() { Buffer.from(r, "hex").toString("base64") ); const msg = client.wasm.msgExecuteContract({ - sender: signer, - contract: addresses["global_accountant.wasm"], - msg: toUtf8( - JSON.stringify({ - submit_vaas: { - vaas: accountingRegistrations, - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: addresses["global_accountant.wasm"], + msg: toUtf8( + JSON.stringify({ + submit_vaas: { + vaas: accountingRegistrations, + }, + }) + ), + funds: [], + } }); const res = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -330,10 +338,12 @@ async function main() { }, }; const executeMsg = client.wasm.msgExecuteContract({ - sender: signer, - contract: addresses["wormchain_ibc_receiver.wasm"], - msg: toUtf8(JSON.stringify(wormchainIbcReceiverUpdateWhitelistMsg)), - funds: [], + value: { + sender: signer, + contract: addresses["wormchain_ibc_receiver.wasm"], + msg: toUtf8(JSON.stringify(wormchainIbcReceiverUpdateWhitelistMsg)), + funds: [], + } }); const updateIbcWhitelistRes = await client.signAndBroadcast( signer, @@ -364,44 +374,60 @@ async function main() { signer, [ client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole14vtqhv6550uh6gycxxum8qmx3kmy7ak2qwzecx", - name: "ibcRelayer", + value: { + signer: signer, + address: "wormhole14vtqhv6550uh6gycxxum8qmx3kmy7ak2qwzecx", + name: "ibcRelayer", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1s5a6dg9p902z5rhjgkk0ts8lulvtmhmpftasxe", - name: "guardianGatewayRelayer0", + value: { + signer: signer, + address: "wormhole1s5a6dg9p902z5rhjgkk0ts8lulvtmhmpftasxe", + name: "guardianGatewayRelayer0", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1dtwappgz4zfmlhay44x5r787u6ap0zhrk2m09m", - name: "guardianGatewayRelayer1", + value: { + signer: signer, + address: "wormhole1dtwappgz4zfmlhay44x5r787u6ap0zhrk2m09m", + name: "guardianGatewayRelayer1", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1karc53cm5zyyaeqsw9stmjvu0vwzky7k07lhwm", - name: "guardianNttAccountant0", + value: { + signer: signer, + address: "wormhole1karc53cm5zyyaeqsw9stmjvu0vwzky7k07lhwm", + name: "guardianNttAccountant0", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1cdvy8ae9xgmfjj4pztz77dwqm4wa04glz68r5w", - name: "guardianNttAccountant1", + value: { + signer: signer, + address: "wormhole1cdvy8ae9xgmfjj4pztz77dwqm4wa04glz68r5w", + name: "guardianNttAccountant1", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole18s5lynnmx37hq4wlrw9gdn68sg2uxp5rwf5k3u", - name: "nttAccountantTest", + value: { + signer: signer, + address: "wormhole18s5lynnmx37hq4wlrw9gdn68sg2uxp5rwf5k3u", + name: "nttAccountantTest", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1h6v7cku5w803pf563czepx5s32vrzz5cntj9k4", - name: "guardianAccountant0", + value: { + signer: signer, + address: "wormhole1h6v7cku5w803pf563czepx5s32vrzz5cntj9k4", + name: "guardianAccountant0", + } }), client.core.msgCreateAllowlistEntryRequest({ - signer: signer, - address: "wormhole1g25zz7gyuyh6chuejc3ppfemgfla4xpsm69lzq", - name: "guardianAccountant1", + value: { + signer: signer, + address: "wormhole1g25zz7gyuyh6chuejc3ppfemgfla4xpsm69lzq", + name: "guardianAccountant1", + } }), ], { @@ -491,16 +517,18 @@ async function main() { console.log(`Registering chains for ${contract}:`); for (const registration of registrations) { const executeMsg = client.wasm.msgExecuteContract({ - sender: signer, - contract: addresses[contract], - msg: toUtf8( - JSON.stringify({ - submit_vaa: { - data: Buffer.from(registration, "hex").toString("base64"), - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: addresses[contract], + msg: toUtf8( + JSON.stringify({ + submit_vaa: { + data: Buffer.from(registration, "hex").toString("base64"), + }, + }) + ), + funds: [], + } }); const executeRes = await client.signAndBroadcast(signer, [executeMsg], { ...ZERO_FEE, @@ -544,10 +572,12 @@ async function main() { vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); const msgInstantiateAllowlist = client.core.msgAddWasmInstantiateAllowlist({ - signer: signer, - address: addresses["cw_token_bridge.wasm"], - code_id: codeIds["cw20_wrapped_2.wasm"], - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer: signer, + address: addresses["cw_token_bridge.wasm"], + codeId: codeIds["cw20_wrapped_2.wasm"], + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const msgInstantiateAllowlistRes = await client.signAndBroadcast( signer, @@ -602,19 +632,21 @@ async function main() { updateChannelVaa as unknown as VAA ); const updateMsg = client.wasm.msgExecuteContract({ - sender: signer, - contract: addresses["ibc_translator.wasm"], - msg: toUtf8( - JSON.stringify({ - submit_update_chain_to_channel_map: { - vaa: Buffer.from( - serialiseVAA(updateChannelVaa as unknown as VAA), - "hex" - ).toString("base64"), - }, - }) - ), - funds: [], + value: { + sender: signer, + contract: addresses["ibc_translator.wasm"], + msg: toUtf8( + JSON.stringify({ + submit_update_chain_to_channel_map: { + vaa: Buffer.from( + serialiseVAA(updateChannelVaa as unknown as VAA), + "hex" + ).toString("base64"), + }, + }) + ), + funds: [], + } }); const executeRes = await client.signAndBroadcast(signer, [updateMsg], { ...ZERO_FEE, @@ -639,10 +671,12 @@ async function main() { }, }; const setParamsMsg = client.core.msgExecuteGatewayGovernanceVaa({ - signer: signer, - vaa: hexToUint8Array( - serialiseVAA(setDefaultParamsVaa as unknown as VAA) - ), + value: { + signer: signer, + vaa: hexToUint8Array( + serialiseVAA(setDefaultParamsVaa as unknown as VAA) + ), + } }); await client .signAndBroadcast(signer, [setParamsMsg], { diff --git a/wormchain/contracts/tools/deploy_wormchain_testnet.ts b/wormchain/contracts/tools/deploy_wormchain_testnet.ts index c8b5a00e2b..ec35ab58e1 100644 --- a/wormchain/contracts/tools/deploy_wormchain_testnet.ts +++ b/wormchain/contracts/tools/deploy_wormchain_testnet.ts @@ -130,9 +130,11 @@ async function main() { vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); console.log("uploading", file); const msg = client.core.msgStoreCode({ - signer, - wasm_byte_code: new Uint8Array(contract_bytes), - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + wasmByteCode: new Uint8Array(contract_bytes), + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -155,13 +157,13 @@ async function main() { // Instantiate contracts. - async function instantiate(code_id: number, inst_msg: any, label: string) { + async function instantiate(codeId: number, inst_msg: any, label: string) { const instMsgBinary = toBinary(inst_msg); const instMsgBytes = fromBase64(instMsgBinary); // see /sdk/vaa/governance.go const codeIdBuf = Buffer.alloc(8); - codeIdBuf.writeBigInt64BE(BigInt(code_id)); + codeIdBuf.writeBigInt64BE(BigInt(codeId)); const codeIdHash = keccak256(codeIdBuf); const codeIdLabelHash = keccak256( Buffer.concat([ @@ -195,11 +197,13 @@ async function main() { // TODO: check for number of guardians in set and use the corresponding keys vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); const msg = client.core.msgInstantiateContract({ - signer, - code_id, - label, - msg: instMsgBytes, - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + codeId, + label, + msg: instMsgBytes, + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -211,7 +215,7 @@ async function main() { .events.find(({ type }) => type === "instantiate") .attributes.find(({ key }) => key === "_contract_address").value; console.log( - `deployed contract ${label}, codeID: ${code_id}, address: ${addr}, txHash: ${result.transactionHash}` + `deployed contract ${label}, codeID: ${codeId}, address: ${addr}, txHash: ${result.transactionHash}` ); return addr; diff --git a/wormchain/contracts/tools/package-lock.json b/wormchain/contracts/tools/package-lock.json index 140b759cb9..c965f594e1 100644 --- a/wormchain/contracts/tools/package-lock.json +++ b/wormchain/contracts/tools/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@certusone/wormhole-sdk": "0.10.10", - "@cosmjs/cosmwasm-stargate": "0.29.5", + "@cosmjs/cosmwasm-stargate": "0.30.1", "@improbable-eng/grpc-web-node-http-transport": "0.15.0", "@wormhole-foundation/wormchain-sdk": "file:../../ts-sdk", "cosmwasm": "1.1.1", @@ -35,12 +35,10 @@ "license": "ISC", "dependencies": { "@certusone/wormhole-sdk": "^0.2.0", - "@cosmjs/cosmwasm-stargate": "^0.27.1", - "@cosmjs/launchpad": "^0.27.1", - "@cosmjs/math": "^0.27.1", - "@cosmjs/proto-signing": "^0.27.1", - "@cosmjs/stargate": "^0.27.1", - "@cosmjs/tendermint-rpc": "^0.27.1", + "@cosmjs/cosmwasm-stargate": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", "axios": "^0.26.0", "bech32": "^2.0.0", "elliptic": "^6.5.4", @@ -662,26 +660,6 @@ "xstream": "^11.14.0" } }, - "../../ts-sdk/node_modules/@cosmjs/launchpad": { - "version": "0.27.1", - "license": "Apache-2.0", - "dependencies": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - } - }, - "../../ts-sdk/node_modules/@cosmjs/launchpad/node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "../../ts-sdk/node_modules/@cosmjs/math": { "version": "0.27.1", "license": "Apache-2.0", @@ -2997,10 +2975,6 @@ "node": "> 0.1.90" } }, - "../../ts-sdk/node_modules/fast-deep-equal": { - "version": "3.1.3", - "license": "MIT" - }, "../../ts-sdk/node_modules/fast-json-stable-stringify": { "version": "2.1.0", "license": "MIT" @@ -6409,13 +6383,15 @@ } }, "node_modules/@cosmjs/amino": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" } }, "node_modules/@cosmjs/cli": { @@ -6677,29 +6653,33 @@ } }, "node_modules/@cosmjs/cosmwasm-stargate": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz", + "integrity": "sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stargate": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", "pako": "^2.0.2" } }, "node_modules/@cosmjs/crypto": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "@noble/hashes": "^1", "bn.js": "^5.2.0", "elliptic": "^6.5.4", @@ -6707,7 +6687,9 @@ } }, "node_modules/@cosmjs/encoding": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", "license": "Apache-2.0", "dependencies": { "base64-js": "^1.3.0", @@ -6723,10 +6705,12 @@ } }, "node_modules/@cosmjs/json-rpc": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", + "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.30.1", "xstream": "^11.14.0" } }, @@ -6787,78 +6771,92 @@ "license": "Apache-2.0" }, "node_modules/@cosmjs/math": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", + "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", "license": "Apache-2.0", "dependencies": { "bn.js": "^5.2.0" } }, "node_modules/@cosmjs/proto-signing": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", + "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0" } }, "node_modules/@cosmjs/socket": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", + "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.30.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", + "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", "license": "Apache-2.0", "dependencies": { "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", "protobufjs": "~6.11.3", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stream": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", + "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", "license": "Apache-2.0", "dependencies": { "xstream": "^11.14.0" } }, "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", + "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", "license": "Apache-2.0", "dependencies": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/json-rpc": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/socket": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/json-rpc": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/socket": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/utils": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", "license": "Apache-2.0" }, "node_modules/@cspotcode/source-map-support": { @@ -7835,158 +7833,6 @@ "snakecase-keys": "^5.4.1" } }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/amino": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", - "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", - "optional": true, - "dependencies": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/crypto": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", - "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", - "optional": true, - "dependencies": { - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.4", - "libsodium-wrappers": "^0.7.6" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/encoding": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", - "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", - "optional": true, - "dependencies": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/encoding/node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "optional": true - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/json-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", - "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", - "optional": true, - "dependencies": { - "@cosmjs/stream": "^0.30.1", - "xstream": "^11.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/math": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", - "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", - "optional": true, - "dependencies": { - "bn.js": "^5.2.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/proto-signing": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", - "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", - "optional": true, - "dependencies": { - "@cosmjs/amino": "^0.30.1", - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/socket": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", - "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", - "optional": true, - "dependencies": { - "@cosmjs/stream": "^0.30.1", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/stargate": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", - "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", - "optional": true, - "dependencies": { - "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/proto-signing": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/tendermint-rpc": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0", - "protobufjs": "~6.11.3", - "xstream": "^11.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/stream": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", - "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", - "optional": true, - "dependencies": { - "xstream": "^11.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/tendermint-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", - "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", - "optional": true, - "dependencies": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/json-rpc": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/socket": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "optional": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/@injectivelabs/sdk-ts/node_modules/@cosmjs/utils": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", - "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", - "optional": true - }, "node_modules/@injectivelabs/sdk-ts/node_modules/axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", @@ -8003,16 +7849,6 @@ "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", "optional": true }, - "node_modules/@injectivelabs/sdk-ts/node_modules/cosmjs-types": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", - "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", - "optional": true, - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, "node_modules/@injectivelabs/sdk-ts/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -10131,7 +9967,9 @@ "optional": true }, "node_modules/cosmjs-types": { - "version": "0.5.2", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", + "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", "license": "Apache-2.0", "dependencies": { "long": "^4.0.0", @@ -14884,12 +14722,14 @@ } }, "@cosmjs/amino": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", "requires": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5" + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" } }, "@cosmjs/cli": { @@ -15101,27 +14941,31 @@ } }, "@cosmjs/cosmwasm-stargate": { - "version": "0.29.5", - "requires": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stargate": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz", + "integrity": "sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A==", + "requires": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", "pako": "^2.0.2" } }, "@cosmjs/crypto": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", "requires": { - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "@noble/hashes": "^1", "bn.js": "^5.2.0", "elliptic": "^6.5.4", @@ -15129,7 +14973,9 @@ } }, "@cosmjs/encoding": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", "requires": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -15143,9 +14989,11 @@ } }, "@cosmjs/json-rpc": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", + "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", "requires": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.30.1", "xstream": "^11.14.0" } }, @@ -15202,72 +15050,86 @@ } }, "@cosmjs/math": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", + "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", "requires": { "bn.js": "^5.2.0" } }, "@cosmjs/proto-signing": { - "version": "0.29.5", - "requires": { - "@cosmjs/amino": "^0.29.5", - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", + "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", + "requires": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0" } }, "@cosmjs/socket": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", + "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", "requires": { - "@cosmjs/stream": "^0.29.5", + "@cosmjs/stream": "^0.30.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "@cosmjs/stargate": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", + "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", "requires": { "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/tendermint-rpc": "^0.29.5", - "@cosmjs/utils": "^0.29.5", - "cosmjs-types": "^0.5.2", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", "protobufjs": "~6.11.3", "xstream": "^11.14.0" } }, "@cosmjs/stream": { - "version": "0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", + "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", "requires": { "xstream": "^11.14.0" } }, "@cosmjs/tendermint-rpc": { - "version": "0.29.5", - "requires": { - "@cosmjs/crypto": "^0.29.5", - "@cosmjs/encoding": "^0.29.5", - "@cosmjs/json-rpc": "^0.29.5", - "@cosmjs/math": "^0.29.5", - "@cosmjs/socket": "^0.29.5", - "@cosmjs/stream": "^0.29.5", - "@cosmjs/utils": "^0.29.5", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", + "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", + "requires": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/json-rpc": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/socket": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, "@cosmjs/utils": { - "version": "0.29.5" + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==" }, "@cspotcode/source-map-support": { "version": "0.8.1", @@ -15872,162 +15734,6 @@ "snakecase-keys": "^5.4.1" }, "dependencies": { - "@cosmjs/amino": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", - "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", - "optional": true, - "requires": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1" - } - }, - "@cosmjs/crypto": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", - "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", - "optional": true, - "requires": { - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.4", - "libsodium-wrappers": "^0.7.6" - } - }, - "@cosmjs/encoding": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", - "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", - "optional": true, - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - }, - "dependencies": { - "bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "optional": true - } - } - }, - "@cosmjs/json-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", - "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", - "optional": true, - "requires": { - "@cosmjs/stream": "^0.30.1", - "xstream": "^11.14.0" - } - }, - "@cosmjs/math": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", - "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", - "optional": true, - "requires": { - "bn.js": "^5.2.0" - } - }, - "@cosmjs/proto-signing": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", - "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", - "optional": true, - "requires": { - "@cosmjs/amino": "^0.30.1", - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0" - } - }, - "@cosmjs/socket": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", - "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", - "optional": true, - "requires": { - "@cosmjs/stream": "^0.30.1", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stargate": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", - "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", - "optional": true, - "requires": { - "@confio/ics23": "^0.6.8", - "@cosmjs/amino": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/proto-signing": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/tendermint-rpc": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "cosmjs-types": "^0.7.1", - "long": "^4.0.0", - "protobufjs": "~6.11.3", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stream": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", - "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", - "optional": true, - "requires": { - "xstream": "^11.14.0" - } - }, - "@cosmjs/tendermint-rpc": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", - "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", - "optional": true, - "requires": { - "@cosmjs/crypto": "^0.30.1", - "@cosmjs/encoding": "^0.30.1", - "@cosmjs/json-rpc": "^0.30.1", - "@cosmjs/math": "^0.30.1", - "@cosmjs/socket": "^0.30.1", - "@cosmjs/stream": "^0.30.1", - "@cosmjs/utils": "^0.30.1", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "optional": true, - "requires": { - "follow-redirects": "^1.14.0" - } - } - } - }, - "@cosmjs/utils": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", - "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", - "optional": true - }, "axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", @@ -16044,16 +15750,6 @@ "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", "optional": true }, - "cosmjs-types": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", - "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", - "optional": true, - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, "rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -17067,12 +16763,10 @@ "version": "file:../../ts-sdk", "requires": { "@certusone/wormhole-sdk": "^0.2.0", - "@cosmjs/cosmwasm-stargate": "^0.27.1", - "@cosmjs/launchpad": "^0.27.1", - "@cosmjs/math": "^0.27.1", - "@cosmjs/proto-signing": "^0.27.1", - "@cosmjs/stargate": "^0.27.1", - "@cosmjs/tendermint-rpc": "^0.27.1", + "@cosmjs/cosmwasm-stargate": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", "axios": "^0.26.0", "bech32": "^2.0.0", "elliptic": "^6.5.4", @@ -17495,26 +17189,6 @@ "xstream": "^11.14.0" } }, - "@cosmjs/launchpad": { - "version": "0.27.1", - "requires": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "requires": { - "follow-redirects": "^1.14.0" - } - } - } - }, "@cosmjs/math": { "version": "0.27.1", "requires": { @@ -18983,9 +18657,6 @@ "eyes": { "version": "0.1.8" }, - "fast-deep-equal": { - "version": "3.1.3" - }, "fast-json-stable-stringify": { "version": "2.1.0" }, @@ -21222,7 +20893,9 @@ "optional": true }, "cosmjs-types": { - "version": "0.5.2", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", + "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", "requires": { "long": "^4.0.0", "protobufjs": "~6.11.2" diff --git a/wormchain/contracts/tools/package.json b/wormchain/contracts/tools/package.json index 111e05b5eb..515492c218 100644 --- a/wormchain/contracts/tools/package.json +++ b/wormchain/contracts/tools/package.json @@ -14,7 +14,7 @@ "author": "", "dependencies": { "@certusone/wormhole-sdk": "0.10.10", - "@cosmjs/cosmwasm-stargate": "0.29.5", + "@cosmjs/cosmwasm-stargate": "0.30.1", "@improbable-eng/grpc-web-node-http-transport": "0.15.0", "@wormhole-foundation/wormchain-sdk": "file:../../ts-sdk", "cosmwasm": "1.1.1", diff --git a/wormchain/contracts/tools/upgrade_wormchain_testnet.ts b/wormchain/contracts/tools/upgrade_wormchain_testnet.ts index 15e681fedd..a3d48d3756 100644 --- a/wormchain/contracts/tools/upgrade_wormchain_testnet.ts +++ b/wormchain/contracts/tools/upgrade_wormchain_testnet.ts @@ -128,9 +128,11 @@ async function main() { vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); console.log("uploading", file); const msg = client.core.msgStoreCode({ - signer, - wasm_byte_code: new Uint8Array(contract_bytes), - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + wasmByteCode: new Uint8Array(contract_bytes), + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -153,13 +155,13 @@ async function main() { // Migrate contracts. - async function migrate(code_id: number, migrate_msg: any, contract: string) { + async function migrate(codeId: number, migrate_msg: any, contract: string) { const migrateMsgBinary = toBinary(migrate_msg); const migrateMsgBytes = fromBase64(migrateMsgBinary); // see /sdk/vaa/governance.go const codeIdBuf = Buffer.alloc(8); - codeIdBuf.writeBigInt64BE(BigInt(code_id)); + codeIdBuf.writeBigInt64BE(BigInt(codeId)); const codeIdHash = keccak256(codeIdBuf); const codeIdContractHash = keccak256( Buffer.concat([ @@ -193,11 +195,13 @@ async function main() { // TODO: check for number of guardians in set and use the corresponding keys vaa.signatures = sign(VAA_SIGNERS, vaa as unknown as VAA); const msg = client.core.msgMigrateContract({ - signer, - code_id, - contract, - msg: migrateMsgBytes, - vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + value: { + signer, + codeId, + contract, + msg: migrateMsgBytes, + vaa: hexToUint8Array(serialiseVAA(vaa as unknown as VAA)), + } }); const result = await client.signAndBroadcast(signer, [msg], { ...ZERO_FEE, @@ -206,7 +210,7 @@ async function main() { console.log("contract migration msg: ", msg); console.log("contract migration result: ", result); console.log( - `migrated contract ${contract}, codeID: ${code_id}, txHash: ${result.transactionHash}` + `migrated contract ${contract}, codeID: ${codeId}, txHash: ${result.transactionHash}` ); } diff --git a/wormchain/devnet/base/config/genesis.json b/wormchain/devnet/base/config/genesis.json index 4e4413dda3..8cf65f9752 100644 --- a/wormchain/devnet/base/config/genesis.json +++ b/wormchain/devnet/base/config/genesis.json @@ -442,26 +442,29 @@ ] }, "gov": { - "deposit_params": { + "starting_proposal_id": "1", + "deposits": [], + "proposals": [], + "votes": [], + "deposit_params": null, + "voting_params": null, + "tally_params": null, + "params": { "max_deposit_period": "172800s", "min_deposit": [ { "amount": "1000000", "denom": "uworm" } - ] - }, - "deposits": [], - "proposals": [], - "starting_proposal_id": "1", - "tally_params": { + ], + "voting_period": "50s", "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", - "veto_threshold": "0.334000000000000000" - }, - "votes": [], - "voting_params": { - "voting_period": "50s" + "veto_threshold": "0.334000000000000000", + "min_initial_deposit_ratio": "0.000000000000000000", + "burn_vote_quorum": false, + "burn_proposal_deposit_prevote": false, + "burn_vote_veto": true } }, "ibc": { @@ -508,6 +511,12 @@ "mint_denom": "uworm" } }, + "packetfowardmiddleware": { + "params": { + "fee_percentage": "0.000000000000000000" + }, + "in_flight_packets": {} + }, "params": null, "slashing": { "missed_blocks": [], @@ -530,7 +539,8 @@ "historical_entries": 10000, "max_entries": 7, "max_validators": 1000, - "unbonding_time": "1814400s" + "unbonding_time": "1814400s", + "min_commission_rate": "0.000000000000000000" }, "redelegations": [], "unbonding_delegations": [], @@ -544,20 +554,20 @@ }, "port_id": "transfer" }, + "tokenfactory": {}, "upgrade": {}, "vesting": {}, "wasm": { "params": { "code_upload_access": { "permission": "Everybody", - "address": "" + "addresses": [] }, "instantiate_default_permission": "Everybody" }, "codes": [], "contracts": [], - "sequences": [], - "gen_msgs": [] + "sequences": [] }, "wormhole": { "config": { diff --git a/wormchain/go.mod b/wormchain/go.mod index c64cc0dd62..f60f2be8bd 100644 --- a/wormchain/go.mod +++ b/wormchain/go.mod @@ -1,146 +1,206 @@ module github.com/wormhole-foundation/wormchain -go 1.19 +go 1.22.5 require ( - github.com/CosmWasm/wasmd v0.30.0 - github.com/CosmWasm/wasmvm v1.1.1 - github.com/cosmos/cosmos-sdk v0.45.11 - github.com/cosmos/ibc-go/v4 v4.2.2 + cosmossdk.io/api v0.3.1 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.4.0 + github.com/CosmWasm/wasmd v0.45.0 + github.com/CosmWasm/wasmvm v1.5.2 + github.com/cometbft/cometbft v0.37.9 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.47.12 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 + github.com/cosmos/ibc-go/v7 v7.6.0 github.com/ethereum/go-ethereum v1.10.21 - github.com/gogo/protobuf v1.3.3 - github.com/golang/protobuf v1.5.2 - github.com/gorilla/mux v1.8.0 + github.com/golang/protobuf v1.5.4 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 github.com/holiman/uint256 v1.2.1 - github.com/prometheus/client_golang v1.14.0 - github.com/regen-network/cosmos-proto v0.3.1 - github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.6.1 - github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 - github.com/stretchr/testify v1.8.1 + github.com/prometheus/client_golang v1.16.0 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.1 + github.com/stretchr/testify v1.9.0 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 - github.com/tendermint/spm v0.1.9 - github.com/tendermint/tendermint v0.34.24 - github.com/tendermint/tm-db v0.6.7 - github.com/wormhole-foundation/wormhole/sdk v0.0.0-20220926172624-4b38dc650bb0 - golang.org/x/crypto v0.2.0 - google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 - google.golang.org/grpc v1.50.1 + github.com/wormhole-foundation/wormhole/sdk v0.0.0-20240705140936-31b01629087c + golang.org/x/crypto v0.24.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a + google.golang.org/grpc v1.64.1 ) require ( - filippo.io/edwards25519 v1.0.0-beta.2 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + cosmossdk.io/core v0.6.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/tools/rosetta v0.2.1 // indirect + filippo.io/edwards25519 v1.0.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/btcsuite/btcd v0.22.1 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/apd/v2 v2.0.2 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.3 // indirect - github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.4 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/dustin/go-humanize v1.0.0 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.2.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect - github.com/improbable-eng/grpc-web v0.14.1 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/improbable-eng/grpc-web v0.15.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect - github.com/klauspost/compress v1.15.11 // indirect - github.com/lib/pq v1.10.6 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/klauspost/compress v1.17.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/lib/pq v1.10.7 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/rs/zerolog v1.27.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.14.0 // indirect - github.com/subosito/gotenv v1.4.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tendermint/btcd v0.1.1 // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tidwall/btree v1.6.0 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.2.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.169.0 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - nhooyr.io/websocket v1.8.7 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( - github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 - github.com/CosmWasm/wasmd v0.30.0 => github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2 - github.com/cosmos/cosmos-sdk => github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole-2 + github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + github.com/cosmos/cosmos-sdk => github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917173637-931c4857932e + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wormhole-foundation/wormhole/sdk => ../sdk - google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/wormchain/go.sum b/wormchain/go.sum index 250153453a..982594e291 100644 --- a/wormchain/go.sum +++ b/wormchain/go.sum @@ -1,32 +1,20 @@ -4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= -bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= -cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -37,855 +25,471 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w= -cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= -contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= -contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= -contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= -contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= -contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= +cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= +cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= +cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8= -github.com/Antonboom/errname v0.1.6/go.mod h1:7lz79JAnuoMNDAWE9MeeIr1/c/VpSUWatBv2FH9NYpI= -github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= -github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= -github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= -github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= +filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4= -github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= +github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= +github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= +github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0/go.mod h1:LGOGuvEgCfCQsy3JF2tRmpGDpzA53iZfyGEWSPwQ6/4= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.2/go.mod h1:xj0D2jwLdp6tOKLheyZCsfL0nz8DaicmJxSwj3VcHtY= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= -github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim v0.9.3/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= -github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= -github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ= -github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs= -github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= -github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= -github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= -github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU= -github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= +github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= -github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg= -github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= -github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/buf v1.4.0/go.mod h1:mwHG7klTHnX+rM/ym8LXGl7vYpVmnwT96xWoRB4H5QI= -github.com/bufbuild/buf v1.7.0/go.mod h1:Go40fMAF46PnPLC7jJgTQhAI95pmC0+VtxFKVC0qLq0= -github.com/bufbuild/connect-go v0.2.0/go.mod h1:4efZ2eXFENwd4p7tuLaL9m0qtTsCOzuBvrohvRGevDM= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= -github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= -github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= -github.com/chavacava/garif v0.0.0-20220316182200-5cad0b5181d4/go.mod h1:W8EnPSQ8Nv4fUjc/v1/8tHFqhuOJXnRub0dTfuAQktU= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= -github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= -github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= +github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= +github.com/cometbft/cometbft v0.37.9 h1:zsW0wfjcnV9L+D4y3FkVQFSFPSbNWJneS9p3gCsWx8o= +github.com/cometbft/cometbft v0.37.9/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/containerd v1.6.3-0.20220401172941-5ff8fce1fcc6/go.mod h1:WSt2SnDLAGWlu+Vl+EWay37seZLKqgRt6XLjIMy8SYM= -github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/continuity v0.2.3-0.20220330195504-d132b287edc8/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fuse-overlayfs-snapshotter v1.0.2/go.mod h1:nRZceC8a7dRm3Ao6cJAwuJWPFiBPaibHiFntRUnzhwU= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.4/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.6/go.mod h1:BWtoWl5ghVymxu6MBjg79W9NZrCRyHIdUtk4cauMe34= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4= -github.com/containerd/stargz-snapshotter v0.11.3/go.mod h1:2j2EAUyvrLU4D9unYlTIwGhDKQIk74KJ9E71lJsQCVM= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/stargz-snapshotter/estargz v0.11.3/go.mod h1:7vRJIcImfY8bpifnMjt+HTJoQxASq7T28MYbP15/Nf0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.3/go.mod h1:xpdkbVAuaH3WzbEabUd5yDsl9SwJA5pABH85425Es2g= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= -github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= -github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI= -github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= -github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= -github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= -github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= -github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= -github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= -github.com/cosmos/ibc-go/v4 v4.2.2 h1:1Tdjj4H6L+iGoDmT/zvJDAysWZpE2kW1twl7u6KKIJY= -github.com/cosmos/ibc-go/v4 v4.2.2/go.mod h1:EFFqkrJHQPHWUlw155QUxGuis4Ett4lvewAT5nvX0yU= -github.com/cosmos/interchain-accounts v0.2.4 h1:7UrroFQsCRSp17980mk6anx4YteveIJVkU+a0wlsHQI= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= -github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= +github.com/cosmos/ibc-go/v7 v7.6.0 h1:S1G5hcIVe9go+jQV6F9+I9yy+hylbJeLiVHUmktQNrM= +github.com/cosmos/ibc-go/v7 v7.6.0/go.mod h1:LifBA7JHRHl95ujjHIaBEHmUqy2qCGyqDCXB7qmAsZk= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= +github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= -github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= -github.com/daixiang0/gci v0.3.3/go.mod h1:1Xr2bxnQbDxCqqulUOv8qpGqkgRw9RSCGGjEC2LjF8o= -github.com/daixiang0/gci v0.6.2/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= -github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= -github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.13+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.3-0.20211208011758-87521affb077+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= -github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.1/go.mod h1:D3dpIBojGGNh5UfElmwPu73SwDCm+VKhHYqwlNOk2uQ= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= -github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= -github.com/fzipp/gocyclo v0.5.1/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= -github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ= -github.com/go-critic/go-critic v0.6.3/go.mod h1:c6b3ZP1MQ7o6lPR7Rv3lEf7pYQUmAcx8ABHgdZCQt/k= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= -github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= -github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= @@ -895,8 +499,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -914,47 +516,17 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ= -github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng= -github.com/golangci/golangci-lint v1.46.2/go.mod h1:3DkdHnxn9eoTTrpT2gB0TEv8KSziuoqe9FitgQLHvAY= -github.com/golangci/golangci-lint v1.48.0/go.mod h1:5N+oxduCho+7yuccW69upg/O7cxjfR/d+IQeiNxGmKM= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= -github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= -github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -969,27 +541,20 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE= -github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= -github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -998,32 +563,27 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= -github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s= -github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -1031,74 +591,33 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= -github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= -github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= -github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904= -github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w= -github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/analysisutil v0.4.1/go.mod h1:18U/DLpRgIUd459wGxVHE0fRgmo1UgHDcbw7F5idXu0= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 h1:CWyXh/jylQWp2dtiV33mY4iSSp6yf4lmn+c7/tN+ObI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0/go.mod h1:nCLIt0w3Ept2NwF8ThLmrppXsfT07oC8k0XNDxd8sVU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -1106,606 +625,244 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= -github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY= -github.com/hanwen/go-fuse/v2 v2.1.1-0.20220112183258-f57e95bda82d/go.mod h1:B1nGE/6RBFyBRC1RRnf23UpwCdyJ31eukw34oAKukAc= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= +github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= +github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= -github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= -github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= +github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= -github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg= -github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= -github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= -github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= -github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= -github.com/jhump/protoreflect v1.12.1-0.20220417024638-438db461d753/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= -github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.6.2/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= -github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= -github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= -github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.2.1/go.mod h1:+Ro3wqY4vakcYNtkBWdZC7dBg1xSB6sp054wWwmeFm0= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= -github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= -github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ= -github.com/moby/buildkit v0.10.3/go.mod h1:jxeOuly98l9gWHai0Ojrbnczrk/rf+o9/JqNhY+UCSo= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74= -github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74= -github.com/moby/sys/mount v0.3.0/go.mod h1:U2Z3ur2rXPFrFmy4q6WMwWrBOAQGYtYTRVM8BIvzbwk= -github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= -github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= -github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= -github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= -github.com/nishanths/exhaustive v0.8.1/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg= -github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= -github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.1/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= -github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.0/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= -github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1714,238 +871,98 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= -github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k= -github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h1:VMX+OnnSw4LicdiEGtRSD/1X8kW7GuEscjYNr4cOIT4= -github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= -github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= -github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= -github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= -github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= -github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= -github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= -github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg= -github.com/ryancurrah/gomodguard v1.2.4/go.mod h1:+Kem4VjWwvFpUJRJSwa16s1tBJe+vbv02+naTow2f6M= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= -github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sashamelentyev/usestdlibvars v1.8.0/go.mod h1:BFt7b5mSVHaaa26ZupiNRV2ODViQBxZZVhtAxAJRrjs= -github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE= -github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A= -github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME= -github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= -github.com/securego/gosec/v2 v2.12.0/go.mod h1:iTpT+eKTw59bSgklBHlSnH5O2tNygHMDxfvMubA4i7I= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= -github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.5.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= -github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= -github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= -github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= -github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= -github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 h1:8Tn4Gy/DAq7wzV1CxEGv80ujZ+nUvzgwwdCobO/Gj8Y= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4/go.mod h1:AG8F5pdk3x1h7PlRvPoMem3623W+w8HJHrWYkVJ51kk= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917173637-931c4857932e h1:4t0B7RQByDeyg5X0m3WH+oMMzS5dxmAKtV0JlJsWwvQ= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240917173637-931c4857932e/go.mod h1:7229X7eq5dlYD+X2PHqwnDyYHEDfT4l/jiAR73oMNy4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1953,212 +970,50 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= -github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/spm v0.1.9 h1:O1DJF4evS8wgk5SZqRcO29irNNtKQmTpvQ0xFzUiczI= -github.com/tendermint/spm v0.1.9/go.mod h1:iHgfQ5YOI6ONc9E7ugGQolVdfSMHpeXfZ/OpXuN/42Q= -github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= -github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= -github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= -github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.20/go.mod h1:KtOwCLYJcsS1ymtAfnjjAtXfXClbqcqjdqzFt2Em1Ac= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= -github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= -github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= -github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= -github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= -github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= -github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= -github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= -github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= -github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= -github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.6.1/go.mod h1:Eo+Opt6pyMW1b6cNllOcDSSoHO0aTJ+iF6BfCUbHltA= -github.com/tomarrell/wrapcheck/v2 v2.6.2/go.mod h1:ao7l5p0aOlUNJKI0qVwB4Yjlqutd0IvAB9Rdwyilxvg= -github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= -github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= -github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= -github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho= -github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= -github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= -github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= -github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= -github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= -github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= -github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M= -github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole-2 h1:ZHvVEU+03UbmUOLfSiXuZjsjirKDV32EToYpjlcknug= -github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole-2/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= -github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2 h1:T5lnEObp6nfp83K1GJSvgaRQ8VQjhokupAsEPWBph4A= -github.com/wormhole-foundation/wasmd v0.30.0-wormchain-2/go.mod h1:BcwmiI8b2fR2MGioz3HeVvON5QjSDfrnUbGu0gKRk5U= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= -github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= -github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= -gitlab.com/bosi/decorder v0.2.1/go.mod h1:6C/nhLSbF6qZbYD8bRmISBwc6vcWdNsiIBkRvjJFrH0= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= -go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= -go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -2168,126 +1023,52 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0/go.mod h1:LsankqVDx4W+RhZNA5uWarULII/MBhF5qwCYxTuyXjs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0/go.mod h1:vHItvsnJtp7ES++nFLLFBzUWny7fJQSvTlxFcqQGUr4= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= -go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= -go.opentelemetry.io/otel/exporters/jaeger v1.4.1/go.mod h1:ZW7vkOu9nC1CxsD8bHNHCia5JUbwP39vxgd1q4Z5rCI= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1/go.mod h1:o5RW5o2pKpJLD5dNTCmjF1DorYwMeFJmb/rKr5sLaa8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1/go.mod h1:c6E4V3/U+miqjs/8l950wggHGL1qzlp0Ypj9xoGrPqo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1/go.mod h1:VwYo0Hak6Efuy0TXsZs8o1hnV3dHDPNtDbycG0hI8+M= -go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= -go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= -go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= +go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= -golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= -golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -2296,14 +1077,11 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= -golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg= +golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -2317,32 +1095,22 @@ golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2353,19 +1121,12 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -2383,53 +1144,32 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220726230323-06994584191e/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2439,22 +1179,26 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2462,68 +1206,46 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2535,111 +1257,62 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210313202042-bd2e13477e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220403020550-483a9cbc67c0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220727055044-e65921a090b8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2649,172 +1322,91 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201028025901-8cd080b735b3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12-0.20220628192153-7743d1d949f1/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU= -google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= -google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -2824,7 +1416,6 @@ google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= @@ -2833,7 +1424,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -2842,52 +1432,50 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -2903,29 +1491,21 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200707001353-8e8330bf89df/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -2942,13 +1522,8 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= @@ -2958,19 +1533,90 @@ google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 h1:jCw9YRd2s40X9Vxi4zKsPRvSPlHWNqadVkpbMsCPzPQ= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2984,48 +1630,28 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= -gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -3033,24 +1659,18 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3058,118 +1678,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.3.1/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= -honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= -k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= -k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= -k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc= -k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= -k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U= -k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/cri-api v0.24.0-alpha.3/go.mod h1:c/NLI5Zdyup5+oEYqFO2IE32ptofNiZpS1nL2y51gAg= -k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= -mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= -mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= -mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2YjFf5CaW0Bw4RL8RfbEf4GRggJk= +nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= -nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= -sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= diff --git a/wormchain/ibc-relayer/Dockerfile b/wormchain/ibc-relayer/Dockerfile index 2791d7b669..3e5fc4d370 100644 --- a/wormchain/ibc-relayer/Dockerfile +++ b/wormchain/ibc-relayer/Dockerfile @@ -1,16 +1,18 @@ -FROM docker.io/golang:1.19.9@sha256:86901bd215ca2b33bdef68f70b999140252169bb55883bb29347334fa00b5b62 +FROM docker.io/golang:1.21.0@sha256:b490ae1f0ece153648dd3c5d25be59a63f966b5f9e1311245c947de4506981aa #used for a readiness probe RUN apt-get update -RUN apt install -y netcat +RUN apt install -y netcat-openbsd RUN apt install -y jq WORKDIR /app -RUN curl -OL --ssl https://github.com/cosmos/relayer/archive/c30b8d9e0ba6b45f8a576f768cad0777de545cb3.tar.gz -RUN printf '%s %s\n' "ede065997ee5873b6256748662fb93cd2652f45cb19937b7e6873ecc088109d9" "c30b8d9e0ba6b45f8a576f768cad0777de545cb3.tar.gz" | sha256sum --check -RUN tar xzf c30b8d9e0ba6b45f8a576f768cad0777de545cb3.tar.gz -WORKDIR relayer-c30b8d9e0ba6b45f8a576f768cad0777de545cb3 +# Reference to: https://github.com/cosmos/relayer/commits/v2.4.2/ +RUN curl -OL --ssl https://github.com/cosmos/relayer/archive/259b1278264180a2aefc2085f1b55753849c4815.tar.gz + +RUN printf '%s %s\n' "1a3194dba53e8cc98e7e4c38d13c8c9f06c118aae69a38283eab1fd67d1348fe" "259b1278264180a2aefc2085f1b55753849c4815.tar.gz" | sha256sum --check +RUN tar xzf 259b1278264180a2aefc2085f1b55753849c4815.tar.gz +WORKDIR relayer-259b1278264180a2aefc2085f1b55753849c4815 RUN make install COPY ./wormchain/ibc-relayer/chains /chains diff --git a/wormchain/ibc-relayer/chains/localterra.json b/wormchain/ibc-relayer/chains/localterra.json index 704f305b4a..e759d7119a 100644 --- a/wormchain/ibc-relayer/chains/localterra.json +++ b/wormchain/ibc-relayer/chains/localterra.json @@ -6,7 +6,7 @@ "rpc-addr": "http://terra2-terrad:26657", "account-prefix": "terra", "keyring-backend": "test", - "gas-adjustment": 1.2, + "gas-adjustment": 2.0, "gas-prices": "1uluna", "debug": true, "timeout": "20s", diff --git a/wormchain/ibc-relayer/chains/wormchain.json b/wormchain/ibc-relayer/chains/wormchain.json index 4f2a290884..9493a3d812 100644 --- a/wormchain/ibc-relayer/chains/wormchain.json +++ b/wormchain/ibc-relayer/chains/wormchain.json @@ -6,7 +6,7 @@ "rpc-addr": "http://wormchain:26657", "account-prefix": "wormhole", "keyring-backend": "test", - "gas-adjustment": 1.2, + "gas-adjustment": 2.0, "gas-prices": "0.01utest", "debug": true, "timeout": "20s", diff --git a/wormchain/interchaintest/cancel_upgrade_test.go b/wormchain/interchaintest/cancel_upgrade_test.go index 99c486863f..67a0a7a7f5 100644 --- a/wormchain/interchaintest/cancel_upgrade_test.go +++ b/wormchain/interchaintest/cancel_upgrade_test.go @@ -1,4 +1,4 @@ -package ictest +package interchaintest import ( "context" @@ -6,8 +6,9 @@ import ( "testing" "time" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" @@ -20,23 +21,28 @@ func TestCancelUpgrade(t *testing.T) { // Base setup numVals := 2 guardians := guardians.CreateValSet(t, numVals) - chains := CreateChains(t, "v2.18.1.1", *guardians) - ctx, _, _, _ := BuildInterchain(t, chains) - // Chains + chains := CreateChain(t, *guardians, ibc.DockerImage{ + Repository: WormchainRemoteRepo, + Version: "v2.24.3.2", + UidGid: WormchainImage.UidGid, + }) + wormchain := chains[0].(*cosmos.CosmosChain) + _, ctx, _, _, _, _ := BuildInterchain(t, chains) + // Set up upgrade blocksAfterUpgrade := uint64(10) height, err := wormchain.Height(ctx) require.NoError(t, err, "error fetching height before upgrade") fmt.Println("Height at sending schedule upgrade: ", height) - haltHeight := height + blocksAfterUpgrade + haltHeight := uint64(height) + blocksAfterUpgrade fmt.Println("Height for scheduled upgrade: ", haltHeight) // Schedule upgrade - helpers.ScheduleUpgrade(t, ctx, wormchain, "faucet", "v2.23.0", haltHeight, guardians) + helpers.ScheduleUpgrade(t, ctx, wormchain, "faucet", "v3.0.0", haltHeight, guardians) // Cancel upgrade testutil.WaitForBlocks(ctx, 2, wormchain) diff --git a/wormchain/interchaintest/chain_start_test.go b/wormchain/interchaintest/chain_start_test.go new file mode 100644 index 0000000000..bc1b8b45ea --- /dev/null +++ b/wormchain/interchaintest/chain_start_test.go @@ -0,0 +1,30 @@ +package interchaintest + +import ( + "testing" + + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/interchaintest/guardians" +) + +// TestChainStart asserts the chain will start with a single validator +func TestChainStart(t *testing.T) { + if testing.Short() { + t.Skip() + } + + t.Parallel() + + // Base setup + guardians := guardians.CreateValSet(t, 2) + chains := CreateLocalChain(t, *guardians) + ic, ctx, _, _, _, _ := BuildInterchain(t, chains) + require.NotNil(t, ic) + require.NotNil(t, ctx) + + // Confirm 5 blocks are produced + chain := chains[0].(*cosmos.CosmosChain) + testutil.WaitForBlocks(ctx, 5, chain) +} diff --git a/wormchain/interchaintest/go.mod b/wormchain/interchaintest/go.mod index 428ead1b1d..cea4861ce9 100644 --- a/wormchain/interchaintest/go.mod +++ b/wormchain/interchaintest/go.mod @@ -1,225 +1,262 @@ module github.com/wormhole-foundation/wormchain/interchaintest -go 1.19 +go 1.22.5 require ( - github.com/cosmos/cosmos-sdk v0.45.14 + cosmossdk.io/math v1.4.0 + github.com/btcsuite/btcd/btcutil v1.1.2 + github.com/cosmos/cosmos-sdk v0.47.12 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-go/v7 v7.6.0 + github.com/docker/docker v24.0.7+incompatible + github.com/ethereum/go-ethereum v1.10.21 github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 - github.com/stretchr/testify v1.8.4 - github.com/wormhole-foundation/wormchain v0.0.0-00010101000000-000000000000 - go.uber.org/zap v1.24.0 -) - -require ( - github.com/btcsuite/btcd/btcutil v1.1.3 - github.com/cosmos/ibc-go/v4 v4.3.0 - github.com/docker/docker v20.10.19+incompatible - github.com/ethereum/go-ethereum v1.11.6 - github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20230815125617-67bc301715ea + github.com/strangelove-ventures/interchaintest/v7 v7.1.1-0.20240821202709-c51068e51c79 + github.com/stretchr/testify v1.9.0 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 - github.com/wormhole-foundation/wormhole/sdk v0.0.0-20230614161948-7f6213019abf + github.com/wormhole-foundation/wormchain v0.0.0 + github.com/wormhole-foundation/wormhole/sdk v0.0.0-20240705140936-31b01629087c + go.uber.org/zap v1.26.0 ) require ( - cosmossdk.io/api v0.2.6 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - filippo.io/edwards25519 v1.0.0-rc.1 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + cosmossdk.io/api v0.3.1 // indirect + cosmossdk.io/core v0.6.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.3.1 // indirect + cosmossdk.io/tools/rosetta v0.2.1 // indirect + filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect - github.com/CosmWasm/wasmd v0.31.0 // indirect - github.com/CosmWasm/wasmvm v1.2.1 // indirect - github.com/DataDog/zstd v1.5.2 // indirect - github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/CosmWasm/wasmd v0.45.0 // indirect + github.com/CosmWasm/wasmvm v1.5.2 // indirect + github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect + github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StirlingMarketingGroup/go-namecase v1.0.0 // indirect - github.com/armon/go-metrics v0.4.0 // indirect - github.com/avast/retry-go/v4 v4.0.4 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/avast/retry-go/v4 v4.5.0 // indirect + github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd v0.23.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.4 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + github.com/cometbft/cometbft v0.37.9 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.6 // indirect - github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.5 // indirect - github.com/cosmos/interchain-security v1.0.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect + github.com/cosmos/ibc-go/modules/capability v1.0.0-rc1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/interchain-security/v3 v3.1.1-0.20231102122221-81650a84f989 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 // indirect - github.com/decred/base58 v1.0.3 // indirect - github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/decred/base58 v1.0.4 // indirect + github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.18.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/gateway v1.1.0 // indirect + github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect - github.com/golang/glog v1.0.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect + github.com/golang/glog v1.2.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect - github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/uint256 v1.2.1 // indirect + github.com/huandu/skiplist v1.2.0 // indirect + github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/go-cid v0.0.7 // indirect + github.com/ipfs/go-cid v0.4.1 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.15.15 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect + github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-libp2p-core v0.15.1 // indirect - github.com/libp2p/go-openssl v0.0.7 // indirect - github.com/linxGnu/grocksdb v1.7.10 // indirect - github.com/magiconair/properties v1.8.6 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/libp2p/go-libp2p v0.27.8 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/manifoldco/promptui v0.9.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect + github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect + github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.0 // indirect + github.com/misko9/go-substrate-rpc-client/v4 v4.0.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/multiformats/go-base32 v0.0.3 // indirect - github.com/multiformats/go-base36 v0.1.0 // indirect - github.com/multiformats/go-multiaddr v0.4.1 // indirect - github.com/multiformats/go-multibase v0.0.3 // indirect - github.com/multiformats/go-multicodec v0.4.1 // indirect - github.com/multiformats/go-multihash v0.1.0 // indirect - github.com/multiformats/go-varint v0.0.6 // indirect + github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/multiformats/go-multiaddr v0.9.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect + github.com/multiformats/go-multicodec v0.8.1 // indirect + github.com/multiformats/go-multihash v0.2.1 // indirect + github.com/multiformats/go-varint v0.0.7 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect github.com/pierrec/xxHash v0.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.39.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/regen-network/cosmos-proto v0.3.1 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect - github.com/rs/cors v1.8.2 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.7.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.14.0 // indirect - github.com/subosito/gotenv v1.4.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tendermint/tendermint v0.34.26 // indirect - github.com/tendermint/tm-db v0.6.7 // indirect - github.com/tidwall/btree v1.5.0 // indirect - github.com/vedhavyas/go-subkey v1.0.3 // indirect + github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/gjson v1.17.1 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tyler-smith/go-bip32 v1.0.0 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect + github.com/vedhavyas/go-subkey/v2 v2.0.0 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.5.0 // indirect - golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect - golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - golang.org/x/tools v0.7.0 // indirect - google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa // indirect - google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/api v0.169.0 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect + google.golang.org/grpc v1.64.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/blake3 v1.1.6 // indirect - lukechampine.com/uint128 v1.1.1 // indirect - modernc.org/cc/v3 v3.36.0 // indirect - modernc.org/ccgo/v3 v3.16.6 // indirect - modernc.org/libc v1.16.7 // indirect - modernc.org/mathutil v1.4.1 // indirect - modernc.org/memory v1.1.1 // indirect - modernc.org/opt v0.1.1 // indirect - modernc.org/sqlite v1.17.3 // indirect - modernc.org/strutil v1.1.1 // indirect - modernc.org/token v1.0.0 // indirect + lukechampine.com/blake3 v1.1.7 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.24.1 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.6.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/sqlite v1.25.0 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect + nhooyr.io/websocket v1.8.7 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( - github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d - github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0 - // specify the version of btcd used so we don't get the btcec issue - github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 - // use cosmos-sdk with ics support - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.14-ics - //github.com/cosmos/cosmos-sdk => github.com/wormhole-foundation/cosmos-sdk v0.45.9-wormhole-2 - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/cosmos/cosmos-sdk => github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240726190703-f29ecc00bc0e - //github.com/strangelove-ventures/interchaintest/v4 => ../../../../../strangelove-ventures/interchaintest_v4 - - // pin version! 126854af5e6d has issues with the store so that queries fail - github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // use informal tendermint - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.23 - github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/misko9/go-substrate-rpc-client/v4 => github.com/faddat/go-substrate-rpc-client/v4 v4.0.1-0.20240402155230-48db8c110afe github.com/wormhole-foundation/wormchain => ../ github.com/wormhole-foundation/wormhole/sdk => ../../sdk - + golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) diff --git a/wormchain/interchaintest/go.sum b/wormchain/interchaintest/go.sum index 701880415b..0e8d185740 100644 --- a/wormchain/interchaintest/go.sum +++ b/wormchain/interchaintest/go.sum @@ -3,7 +3,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -16,288 +15,538 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.2.6 h1:AoNwaLLapcLsphhMK6+o0kZl+D6MMUaHVqSdwinASGU= -cosmossdk.io/api v0.2.6/go.mod h1:u/d+GAxil0nWpl1XnQL8nkziQDIWuBDhv8VnDm/s6dI= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= +cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= +cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= +cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= +cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= +filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/CosmWasm/wasmd v0.31.0 h1:xACf6A/SkCeGWQWrKGsR4X9PQb5G4XYuNfnrl+HQ1mE= -github.com/CosmWasm/wasmd v0.31.0/go.mod h1:VcyDGk/ISVlMUeW+1GGL0zdHWBS2FPwLEV2qZ86l7l8= -github.com/CosmWasm/wasmvm v1.2.1 h1:si0tRsRDdUShV0k51Wn6zRKlmj3/WWP9Yr4cLmDTf+8= -github.com/CosmWasm/wasmvm v1.2.1/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= +github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= +github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= +github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc= +github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw= +github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc= +github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StirlingMarketingGroup/go-namecase v1.0.0 h1:2CzaNtCzc4iNHirR+5ru9OzGg8rQp860gqLBFqRI02Y= github.com/StirlingMarketingGroup/go-namecase v1.0.0/go.mod h1:ZsoSKcafcAzuBx+sndbxHu/RjDcDTrEdT4UvhniHfio= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/avast/retry-go/v4 v4.0.4 h1:38hLf0DsRXh+hOF6HbTni0+5QGTNdw9zbaMD7KAO830= -github.com/avast/retry-go/v4 v4.0.4/go.mod h1:HqmLvS2VLdStPCGDFjSuZ9pzlTqVRldCI4w2dO4m1Ms= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg= +github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5Aq1fboC3+I= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= +github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.23.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= +github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.4 h1:G2kCJurlIkguX0oxxI9sPPENuQqMVhIhV9RVkh/dpDg= -github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.4/go.mod h1:5g1oM4Zu3BOaLpsKQ+O8PAv2kNuq+kPcA1VzFbsSqxE= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw= +github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= -github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= +github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= +github.com/cometbft/cometbft v0.37.9 h1:zsW0wfjcnV9L+D4y3FkVQFSFPSbNWJneS9p3gCsWx8o= +github.com/cometbft/cometbft v0.37.9/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 h1:zlCp9n3uwQieELltZWHRmwPmPaZ8+XoL2Sj+A2YJlr8= -github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32/go.mod h1:kwMlEC4wWvB48zAShGKVqboJL6w4zCLesaNQ3YLU2BQ= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.45.14-ics h1:0yHgyiH719bE+1kitN3xR7moZhWb1ZjgaX7m7Xhf0AU= -github.com/cosmos/cosmos-sdk v0.45.14-ics/go.mod h1:bF1fyVbRDvZ922GMByg9opQT26sQwabwYqaYIchwdyw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= -github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= -github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= -github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= -github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v4 v4.3.0 h1:yOzVsyZzsv4XPBux8gq+D0LhZn45yGWKjvT+6Vyo5no= -github.com/cosmos/ibc-go/v4 v4.3.0/go.mod h1:CcLvIoi9NNtIbNsxs4KjBGjYhlwqtsmXy1AKARKiMzQ= -github.com/cosmos/interchain-security v1.0.0 h1:xNQjjigqH3mzEKSGQhAhKy8I0TA8XR2z5rRTxRBKK3o= -github.com/cosmos/interchain-security v1.0.0/go.mod h1:J9SbXUJT1GSe+mZy+MDCxtuAfbhwCKBEJRYnfjXsE8Q= -github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= -github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= +github.com/cosmos/ibc-go/modules/capability v1.0.0-rc1 h1:BvSKnPFKxL+TTSLxGKwJN4x0ndCZj0yfXhSvmsQztSA= +github.com/cosmos/ibc-go/modules/capability v1.0.0-rc1/go.mod h1:A+CxAQdn2j6ihDTbClpEEBdHthWgAUAcHbRAQPY8sl4= +github.com/cosmos/ibc-go/v7 v7.6.0 h1:S1G5hcIVe9go+jQV6F9+I9yy+hylbJeLiVHUmktQNrM= +github.com/cosmos/ibc-go/v7 v7.6.0/go.mod h1:LifBA7JHRHl95ujjHIaBEHmUqy2qCGyqDCXB7qmAsZk= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/interchain-security/v3 v3.1.1-0.20231102122221-81650a84f989 h1:Yk/2X33hHuS0mqjr4rE0ShiwPE/YflXgdyXPIYdwl+Q= +github.com/cosmos/interchain-security/v3 v3.1.1-0.20231102122221-81650a84f989/go.mod h1:5B29fgUbUDTpBTqCnEzA2g3gI5rQG0YE/ir4isb2MEw= +github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= +github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/decred/base58 v1.0.3 h1:KGZuh8d1WEMIrK0leQRM47W85KqCAdl2N+uagbctdDI= -github.com/decred/base58 v1.0.3/go.mod h1:pXP9cXCfM2sFLb2viz2FNIdeMWmZDBKG3ZBYbiSM78E= +github.com/decred/base58 v1.0.4 h1:QJC6B0E0rXOPA8U/kw2rP+qiRJsUaE2Er+pYb3siUeA= +github.com/decred/base58 v1.0.4/go.mod h1:jJswKPEdvpFpvf7dsDvFZyLT22xZ9lWqEByX38oGd9E= github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 h1:18HurQ6DfHeNvwIjvOmrgr44bPdtVaQAe/WWwHg9goM= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1/go.mod h1:XmyzkaXBy7ZvHdrTAlXAjpog8qKSAWa3ze7yqzWmgmc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= -github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg= -github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/go-ethereum v1.11.6 h1:2VF8Mf7XiSUfmoNOy3D+ocfl9Qu8baQBrCNbo2CXQ8E= -github.com/ethereum/go-ethereum v1.11.6/go.mod h1:+a8pUj1tOyJ2RinsNQD4326YS+leSoKGiG/uVVb0x6Y= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= +github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/faddat/go-substrate-rpc-client/v4 v4.0.1-0.20240402155230-48db8c110afe h1:63rMpjrCwbJVYoz1XFOzRXCZd8frLSuChg5XSo3tKg4= +github.com/faddat/go-substrate-rpc-client/v4 v4.0.1-0.20240402155230-48db8c110afe/go.mod h1:enTNfc1aCsOpHnOqlDEDAGr3SzacyTh/VX/nL+5YBs4= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= -github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= +github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= -github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -305,7 +554,9 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -322,13 +573,14 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -344,16 +596,25 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -363,25 +624,57 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230405160723-4a4c7d95572b h1:Qcx5LM0fSiks9uCyFZwDBUasd3lxd1RM0GYpL+Li5o4= +github.com/google/pprof v0.0.0-20230405160723-4a4c7d95572b/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -391,199 +684,278 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= +github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= -github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= -github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= +github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= +github.com/holiman/uint256 v1.2.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= +github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 h1:H+uM0Bv88eur3ZSsd2NGKg3YIiuXxwxtlN7HjE66UTU= github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845/go.mod h1:c1tRKs5Tx7E2+uHGSyyncziFjvGpgv4H2HrqXeUQ/Uk= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/informalsystems/tendermint v0.34.23 h1:lZhFEDSmK6xWDyKhcJNqiB1xh2Gt/3FufF1FNQ+vVn4= -github.com/informalsystems/tendermint v0.34.23/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= +github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-libp2p-core v0.15.1 h1:0RY+Mi/ARK9DgG1g9xVQLb8dDaaU8tCePMtGALEfBnM= -github.com/libp2p/go-libp2p-core v0.15.1/go.mod h1:agSaboYM4hzB1cWekgVReqV5M4g5M+2eNNejV+1EEhs= -github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/linxGnu/grocksdb v1.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= -github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= +github.com/libp2p/go-libp2p v0.27.8 h1:IX5x/4yKwyPQeVS2AXHZ3J4YATM9oHBGH1gBc23jBAI= +github.com/libp2p/go-libp2p v0.27.8/go.mod h1:eCFFtd0s5i/EVKR7+5Ki8bM7qwkNW3TPTTSSW9sz8NE= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= +github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b h1:QrHweqAtyJ9EwCaGHBu1fghwxIPiopAHV06JlXrMHjk= +github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b/go.mod h1:xxLb2ip6sSUts3g1irPVHyk/DGslwQsNOo9I7smJfNU= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multiaddr v0.4.1 h1:Pq37uLx3hsyNlTDir7FZyU8+cFCTqd5y1KiM2IzOutI= -github.com/multiformats/go-multiaddr v0.4.1/go.mod h1:3afI9HfVW8csiF8UZqtpYRiDyew8pRX7qLIGHu9FLuM= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multicodec v0.4.1 h1:BSJbf+zpghcZMZrwTYBGwy0CPcVZGWiC72Cp8bBd4R4= -github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA= -github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= +github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multiaddr v0.9.0 h1:3h4V1LHIk5w4hJHekMKWALPXErDfz/sggzwC/NcqbDQ= +github.com/multiformats/go-multiaddr v0.9.0/go.mod h1:mI67Lb1EeTOYb8GQfL/7wpIZwc46ElrvzhYnoJOmTT0= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multicodec v0.8.1 h1:ycepHwavHafh3grIbR1jIXnKCsFm0fqsfEOsJ8NtKE8= +github.com/multiformats/go-multicodec v0.8.1/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= +github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= +github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= +github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= +github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/xxHash v0.1.5 h1:n/jBpwTHiER4xYvK3/CdPVnLDPchj8eTJFFLUb4QHBo= github.com/pierrec/xxHash v0.1.5/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= -github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0/go.mod h1:4xpMLz7RBWyB+ElzHu8Llua96TRCB3YwX+l5EP1wmHk= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -591,97 +963,127 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= -github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= -github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/robertkrimen/godocdown v0.0.0-20130622164427-0bfa04905481/go.mod h1:C9WhFzY47SzYBIvzFqSvHIR6ROgDo4TtdTuRaOMjF/s= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/strangelove-ventures/go-subkey v1.0.7 h1:cOP/Lajg3uxV/tvspu0m6+0Cu+DJgygkEAbx/s+f35I= -github.com/strangelove-ventures/go-subkey v1.0.7/go.mod h1:E34izOIEm+sZ1YmYawYRquqBQWeZBjVB4pF7bMuhc1c= -github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20230815125617-67bc301715ea h1:31LPl6bizRVD0djX9VcyaJ6Tj7zphM0dWT72QaWIZgc= -github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20230815125617-67bc301715ea/go.mod h1:pZEZL7eKFk6gauxedsFP1UpkNug4TKX4HxkHY1ITfeo= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/strangelove-ventures/interchaintest/v7 v7.1.1-0.20240821202709-c51068e51c79 h1:qM9rcrYUsfwitLgpdjF6dKXHPIplhfiJ+Agw/4GaC98= +github.com/strangelove-ventures/interchaintest/v7 v7.1.1-0.20240821202709-c51068e51c79/go.mod h1:f5XHr2Pb7Mnmsa/xyW8NPCRXLL60xztQ+vf/s1rzr9w= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240726190703-f29ecc00bc0e h1:pVpVGXBxCgeziw4TzQ53zXpnEeNFQt0uxs/VoeB6gBY= +github.com/strangelove-ventures/wh-cosmos-sdk v0.0.0-20240726190703-f29ecc00bc0e/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -689,106 +1091,130 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= -github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= -github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= +github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE= +github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vedhavyas/go-subkey/v2 v2.0.0 h1:LemDIsrVtRSOkp0FA8HxP6ynfKjeOj3BY2U9UNfeDMA= +github.com/vedhavyas/go-subkey/v2 v2.0.0/go.mod h1:95aZ+XDCWAUUynjlmi7BtPExjXgXxByE0WfBwbmIRH4= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -801,29 +1227,30 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -832,7 +1259,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -840,6 +1267,7 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -851,14 +1279,29 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -868,6 +1311,24 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -879,17 +1340,22 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -898,14 +1364,15 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -915,44 +1382,72 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -962,21 +1457,21 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -984,9 +1479,10 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -994,11 +1490,11 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1015,22 +1511,32 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1050,20 +1556,52 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1096,17 +1634,89 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa h1:qQPhfbPO23fwm/9lQr91L1u62Zo6cm+zI+slZT+uf+o= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY= +google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1116,13 +1726,32 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1135,42 +1764,49 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1178,45 +1814,47 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= -lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= -lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0 h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6 h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= +lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.7 h1:qzQtHhsZNpVPpeCu+aMIQldXeV1P0vRhSqCL0nOIJOA= -modernc.org/libc v1.16.7/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1 h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.17.3 h1:iE+coC5g17LtByDYDWKpR6m2Z9022YrSh3bumwOnIrI= -modernc.org/sqlite v1.17.3/go.mod h1:10hPVYar9C0kfXuTWGz8s0XtB8uAGymUy51ZzStYe3k= -modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= +modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= +modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/wormchain/interchaintest/helpers/bank.go b/wormchain/interchaintest/helpers/bank.go index 488a853d50..87ea5c94f6 100644 --- a/wormchain/interchaintest/helpers/bank.go +++ b/wormchain/interchaintest/helpers/bank.go @@ -7,12 +7,12 @@ import ( "testing" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/stretchr/testify/require" ) func GetDenomsMetadata(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) QueryDenomsMetadataResponse { - node := chain.GetFullNode() + node := chain.FullNodes[0] stdoutBz, _, err := node.ExecQuery(ctx, "bank", "denom-metadata") require.NoError(t, err) diff --git a/wormchain/interchaintest/helpers/gateway_governance_vaa.go b/wormchain/interchaintest/helpers/gateway_governance_vaa.go index c2f1feb561..31f05d985e 100644 --- a/wormchain/interchaintest/helpers/gateway_governance_vaa.go +++ b/wormchain/interchaintest/helpers/gateway_governance_vaa.go @@ -5,8 +5,8 @@ import ( "encoding/hex" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" @@ -17,7 +17,7 @@ func GetMiddlewareContract( ctx context.Context, chain *cosmos.CosmosChain, ) string { - node := chain.GetFullNode() + node := chain.FullNodes[0] stdout, _, err := node.ExecQuery(ctx, "wormhole", "show-ibc-composability-mw-contract") require.NoError(t, err) return string(stdout) @@ -32,7 +32,7 @@ func SetMiddlewareContract( contractBech32Addr string, guardians *guardians.ValSet, ) { - node := chain.GetFullNode() + node := chain.FullNodes[0] contractAddr := [32]byte{} copy(contractAddr[:], MustAccAddressFromBech32(contractBech32Addr, cfg.Bech32Prefix).Bytes()) @@ -41,7 +41,7 @@ func SetMiddlewareContract( } payloadBz, err := payload.Serialize() require.NoError(t, err) - v := generateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) + v := GenerateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) @@ -59,7 +59,7 @@ func ScheduleUpgrade( height uint64, guardians *guardians.ValSet, ) { - node := chain.GetFullNode() + node := chain.FullNodes[0] payload := vaa.BodyGatewayScheduleUpgrade{ Name: name, @@ -67,7 +67,7 @@ func ScheduleUpgrade( } payloadBz, err := payload.Serialize() require.NoError(t, err) - v := generateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payloadBz) + v := GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payloadBz) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) @@ -83,11 +83,11 @@ func CancelUpgrade( keyName string, guardians *guardians.ValSet, ) { - node := chain.GetFullNode() + node := chain.FullNodes[0] payloadBz, err := vaa.EmptyPayloadVaa(vaa.GatewayModuleStr, vaa.ActionCancelUpgrade, vaa.ChainIDWormchain) require.NoError(t, err) - v := generateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) + v := GenerateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) diff --git a/wormchain/interchaintest/helpers/ibc_translator.go b/wormchain/interchaintest/helpers/ibc_translator.go index 56edd9cf5c..ef74fa063b 100644 --- a/wormchain/interchaintest/helpers/ibc_translator.go +++ b/wormchain/interchaintest/helpers/ibc_translator.go @@ -10,8 +10,8 @@ import ( "strconv" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" @@ -27,7 +27,7 @@ func SubmitAllowlistInstantiateContract( codeIdStr string, guardians *guardians.ValSet, ) { - node := chain.GetFullNode() + node := chain.FullNodes[0] codeId, err := strconv.ParseUint(codeIdStr, 10, 64) require.NoError(t, err) @@ -39,7 +39,7 @@ func SubmitAllowlistInstantiateContract( } payloadBz, err := payload.Serialize(vaa.ActionAddWasmInstantiateAllowlist) require.NoError(t, err) - v := generateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) + v := GenerateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payloadBz) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) @@ -83,7 +83,7 @@ func SubmitUpdateChainToChannelMapMsg(t *testing.T, allowlistChainID uint16, all payload.Write(channelPadded.Bytes()) vaa.MustWrite(payload, binary.BigEndian, allowlistChainID) - v := generateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payload.Bytes()) + v := GenerateVaa(0, guardians, vaa.GovernanceChain, vaa.GovernanceEmitter, payload.Bytes()) vBz, err := v.Marshal() require.NoError(t, err) @@ -162,7 +162,7 @@ func IbcTranslatorCompleteTransferAndConvertMsg(t *testing.T, emitterChainID uin emitterBz[eIndex-1] = emitterAddr[i-1] eIndex-- } - v := generateVaa(0, guardians, vaa.ChainID(emitterChainID), vaa.Address(emitterBz), payload) + v := GenerateVaa(0, guardians, vaa.ChainID(emitterChainID), vaa.Address(emitterBz), payload) vBz, err := v.Marshal() require.NoError(t, err) diff --git a/wormchain/interchaintest/helpers/instantiate_contract.go b/wormchain/interchaintest/helpers/instantiate_contract.go index 9a0c427f60..954727b87d 100644 --- a/wormchain/interchaintest/helpers/instantiate_contract.go +++ b/wormchain/interchaintest/helpers/instantiate_contract.go @@ -9,7 +9,7 @@ import ( "strconv" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" @@ -42,12 +42,12 @@ func InstantiateContract( guardians *guardians.ValSet, ) (contract string) { - node := chain.GetFullNode() + node := chain.FullNodes[0] code_id, err := strconv.ParseUint(codeId, 10, 64) require.NoError(t, err) payload := createWasmInstantiatePayload(code_id, label, message) - v := generateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) + v := GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) diff --git a/wormchain/interchaintest/helpers/migrate_contract.go b/wormchain/interchaintest/helpers/migrate_contract.go index b488f462ee..36f9729c3d 100644 --- a/wormchain/interchaintest/helpers/migrate_contract.go +++ b/wormchain/interchaintest/helpers/migrate_contract.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" @@ -37,12 +37,12 @@ func MigrateContract( guardians *guardians.ValSet, ) { - node := chain.GetFullNode() + node := chain.FullNodes[0] code_id, err := strconv.ParseUint(codeId, 10, 64) require.NoError(t, err) payload := createWasmMigrationPayload(code_id, contractAddr, message) - v := generateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) + v := GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) vBz, err := v.Marshal() require.NoError(t, err) vHex := hex.EncodeToString(vBz) diff --git a/wormchain/interchaintest/helpers/store_contract.go b/wormchain/interchaintest/helpers/store_contract.go index b26665eafd..93d474072c 100644 --- a/wormchain/interchaintest/helpers/store_contract.go +++ b/wormchain/interchaintest/helpers/store_contract.go @@ -12,8 +12,8 @@ import ( "path/filepath" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/tendermint/crypto/sha3" @@ -22,7 +22,7 @@ import ( "github.com/wormhole-foundation/wormhole/sdk/vaa" ) -func createWasmStoreCodePayload(wasmBytes []byte) []byte { +func CreateWasmStoreCodePayload(wasmBytes []byte) []byte { // governance message with sha3 of wasmBytes as the payload var hashWasm [32]byte keccak := sha3.NewLegacyKeccak256() @@ -61,14 +61,9 @@ func createIbcReceiverUpdateChannelPayload(payload vaa.BodyIbcUpdateChannelChain return gov_msg.MarshalBinary(), nil } -// func UpgradeCoreContract(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, keyName string, payload vaa.BodyContractUpgrade, guardians *guardians.ValSet) { -// node := chain.GetFullNode() - -// } - // wormchaind tx wormhole store [wasm file] [vaa-hex] [flags] func StoreContract(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, keyName string, fileLoc string, guardians *guardians.ValSet) (codeId string) { - node := chain.GetFullNode() + node := chain.FullNodes[0] _, file := filepath.Split(fileLoc) err := node.CopyFile(ctx, fileLoc, file) @@ -83,8 +78,8 @@ func StoreContract(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, require.NoError(t, err) } - payload := createWasmStoreCodePayload(content) - v := generateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) + payload := CreateWasmStoreCodePayload(content) + v := GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) vBz, err := v.Marshal() require.NoError(t, err) diff --git a/wormchain/interchaintest/helpers/token_bridge.go b/wormchain/interchaintest/helpers/token_bridge.go index bd30134008..dab0e95c50 100644 --- a/wormchain/interchaintest/helpers/token_bridge.go +++ b/wormchain/interchaintest/helpers/token_bridge.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" @@ -69,7 +69,7 @@ func TbRegisterChainMsg(t *testing.T, chainID uint16, emitterAddr string, guardi payload, err := bodyTbRegisterChain.Serialize() require.NoError(t, err) - v := generateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) + v := GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) vBz, err := v.Marshal() require.NoError(t, err) @@ -106,7 +106,7 @@ func TbRegisterForeignAsset(t *testing.T, tokenAddr string, chainID uint16, emit emitterBz[eIndex-1] = emitterAddr[i-1] eIndex-- } - v := generateVaa(0, guardians, vaa.ChainID(chainID), vaa.Address(emitterBz), payload.Bytes()) + v := GenerateVaa(0, guardians, vaa.ChainID(chainID), vaa.Address(emitterBz), payload.Bytes()) vBz, err := v.Marshal() require.NoError(t, err) diff --git a/wormchain/interchaintest/helpers/utils.go b/wormchain/interchaintest/helpers/utils.go index b86e11afe7..b6062ac302 100644 --- a/wormchain/interchaintest/helpers/utils.go +++ b/wormchain/interchaintest/helpers/utils.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" diff --git a/wormchain/interchaintest/helpers/vaa.go b/wormchain/interchaintest/helpers/vaa.go index 452bbce52d..cfbf299a34 100644 --- a/wormchain/interchaintest/helpers/vaa.go +++ b/wormchain/interchaintest/helpers/vaa.go @@ -17,7 +17,7 @@ func signVaa(vaaToSign vaa.VAA, signers *guardians.ValSet) vaa.VAA { return vaaToSign } -func generateVaa(index uint32, signers *guardians.ValSet, emitterChain vaa.ChainID, emitterAddr vaa.Address, payload []byte) vaa.VAA { +func GenerateVaa(index uint32, signers *guardians.ValSet, emitterChain vaa.ChainID, emitterAddr vaa.Address, payload []byte) vaa.VAA { v := vaa.VAA{ Version: uint8(1), GuardianSetIndex: index, diff --git a/wormchain/interchaintest/helpers/wormhole_core.go b/wormchain/interchaintest/helpers/wormhole_core.go index 9615d3ab04..5c73916156 100644 --- a/wormchain/interchaintest/helpers/wormhole_core.go +++ b/wormchain/interchaintest/helpers/wormhole_core.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormhole/sdk/vaa" diff --git a/wormchain/interchaintest/malformed_payload_test.go b/wormchain/interchaintest/malformed_payload_test.go index 871c4c312a..e3d486a8a8 100644 --- a/wormchain/interchaintest/malformed_payload_test.go +++ b/wormchain/interchaintest/malformed_payload_test.go @@ -1,15 +1,16 @@ -package ictest +package interchaintest import ( "encoding/json" "fmt" "testing" + "cosmossdk.io/math" "github.com/btcsuite/btcd/btcutil/base58" - "github.com/strangelove-ventures/interchaintest/v4" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/ibc" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" @@ -17,7 +18,7 @@ import ( "github.com/wormhole-foundation/wormhole/sdk/vaa" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) // TestMalformedPayload tests the state of wormhole/osmosis chains when a GatewayIbcTokenBridge payload is malformed @@ -26,8 +27,10 @@ func TestMalformedPayload(t *testing.T) { // Base setup numVals := 1 guardians := guardians.CreateValSet(t, numVals) - chains := CreateChains(t, "v2.23.0", *guardians) - ctx, r, eRep, _ := BuildInterchain(t, chains) + + chains := CreateLocalChain(t, *guardians) + + _, ctx, r, eRep, _, _ := BuildInterchain(t, chains) // Chains wormchain := chains[0].(*cosmos.CosmosChain) @@ -41,15 +44,16 @@ func TestMalformedPayload(t *testing.T) { require.NoError(t, err) wormToGaiaChannel := gaiaToWormChannel.Counterparty - users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(10_000_000_000), wormchain, gaia, osmosis, osmosis) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", math.NewInt(10_000_000_000), wormchain, gaia, osmosis, osmosis) + gaiaUser1 := users[1] osmoUser1 := users[2] osmoUser2 := users[3] - ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName, "./contracts/ibc_hooks.wasm") + ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName(), "./contracts/ibc_hooks.wasm") require.NoError(t, err) fmt.Println("IBC hooks code id: ", ibcHooksCodeId) - ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName, ibcHooksCodeId, "{}", true) + ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName(), ibcHooksCodeId, "{}", true) require.NoError(t, err) fmt.Println("IBC hooks contract addr: ", ibcHooksContractAddr) @@ -58,7 +62,7 @@ func TestMalformedPayload(t *testing.T) { fmt.Println("Core contract code id: ", coreContractCodeId) // Instantiate wormhole core contract - coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, wormchainConfig, guardians) + coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, WormchainConfig, guardians) coreContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", coreContractCodeId, "wormhole_core", coreInstantiateMsg, guardians) fmt.Println("Core contract address: ", coreContractAddr) @@ -71,7 +75,7 @@ func TestMalformedPayload(t *testing.T) { fmt.Println("Token bridge contract code id: ", tbContractCodeId) // Instantiate token bridge contract - tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, wormchainConfig, coreContractAddr, wrappedAssetCodeId) + tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, WormchainConfig, coreContractAddr, wrappedAssetCodeId) tbContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", tbContractCodeId, "token_bridge", tbInstantiateMsg, guardians) fmt.Println("Token bridge contract address: ", tbContractAddr) @@ -140,12 +144,12 @@ func TestMalformedPayload(t *testing.T) { // ----------------------------------------------------------------------------------------------------------------------------------------- // Test 1 (GW Tranfer has 100 added to osmo chain id to make it denied / no chain id -> channel mapping) - simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID+100, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), 0, 1) + simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID+100, osmoUser1.FormattedAddress(), 0, 1) externalSender := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8} payload3 := helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg := helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) - require.NoError(t, err) + require.Error(t, err) err = testutil.WaitForBlocks(ctx, 1, wormchain, osmosis) require.NoError(t, err) @@ -156,10 +160,10 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err := wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(0), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 0") + require.Equal(t, int64(0), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 0") // Test 2 (GW Transfer has a cosmos/gaia prefix for recipient address) - simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, osmoUser1.Bech32Address(gaia.Config().Bech32Prefix), 0, 1) + simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, gaiaUser1.FormattedAddress(), 0, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) @@ -174,11 +178,11 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(100), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 100") + require.Equal(t, int64(100), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 100") // Test 3 (GW TransferWithPayload has osmo user1 as recipient and not a contract) - ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) - contractControlledPayload := helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), ibcHooksPayload, 1) + ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) + contractControlledPayload := helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, osmoUser1.FormattedAddress(), ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) @@ -193,10 +197,10 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(200), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 200") + require.Equal(t, int64(200), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 200") // Test 4 (GW TransferWithPayload - change wasm root in memo) - ibcHooksPayload = CreateInvalidIbcHooksMsgWasm(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload = CreateInvalidIbcHooksMsgWasm(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) contractControlledPayload = helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) @@ -212,11 +216,11 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = osmosis.GetBalance(ctx, ibcHooksContractAddr, osmoIbcAsset1Denom) require.NoError(t, err) - require.Equal(t, int64(100), asset1DenomBalance, "Ibchooks asset 1 denom balance should be 100") + require.Equal(t, int64(100), asset1DenomBalance.Int64(), "Ibchooks asset 1 denom balance should be 100") // Test 5 (GW TransferWithPayload's ibc hook payload has osmo user1 as recipient and not a contract) cosmosIbcHooksContractAddr := swapBech32Prefix(ibcHooksContractAddr, osmosis.Config().Bech32Prefix, gaia.Config().Bech32Prefix) - ibcHooksPayload = helpers.CreateIbcHooksMsg(t, cosmosIbcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload = helpers.CreateIbcHooksMsg(t, cosmosIbcHooksContractAddr, osmoUser2.FormattedAddress()) contractControlledPayload = helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) @@ -232,10 +236,10 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(300), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 300") + require.Equal(t, int64(300), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 300") // Test 6 (GW TransferWithPayload's ibc hook payload has osmo user1 as recipient and not a contract) - ibcHooksPayload = helpers.CreateIbcHooksMsg(t, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload = helpers.CreateIbcHooksMsg(t, osmoUser1.FormattedAddress(), osmoUser2.FormattedAddress()) contractControlledPayload = helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) @@ -251,10 +255,10 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(400), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 400") + require.Equal(t, int64(400), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 400") // Test 7 (GW TransferWithPayload has invalid execute method for ibc hooks contract) - ibcHooksPayload = CreateInvalidIbcHooksMsgExecute(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload = CreateInvalidIbcHooksMsgExecute(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) contractControlledPayload = helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) @@ -270,10 +274,10 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(500), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 500") + require.Equal(t, int64(500), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 500") // Test 8 (GW TransferWithPayload's ibc hook payload has recipient with cosmos/gaia bech32 prefix) - ibcHooksPayload = helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(gaia.Config().Bech32Prefix)) + ibcHooksPayload = helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, gaiaUser1.FormattedAddress()) contractControlledPayload = helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) payload3 = helpers.CreatePayload3(wormchain.Config(), 100, Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) @@ -289,7 +293,7 @@ func TestMalformedPayload(t *testing.T) { // Check ibc-translator asset 1 denom balance asset1DenomBalance, err = wormchain.GetBalance(ctx, ibcTranslatorContractAddr, asset1TokenFactoryDenom) require.NoError(t, err) - require.Equal(t, int64(600), asset1DenomBalance, "Ibc translator asset 1 denom balance should be 600") + require.Equal(t, int64(600), asset1DenomBalance.Int64(), "Ibc translator asset 1 denom balance should be 600") } type IbcHooksWasm struct { diff --git a/wormchain/interchaintest/proposal_msg_test.go b/wormchain/interchaintest/proposal_msg_test.go new file mode 100644 index 0000000000..1b455a2314 --- /dev/null +++ b/wormchain/interchaintest/proposal_msg_test.go @@ -0,0 +1,182 @@ +package interchaintest + +import ( + "context" + "encoding/hex" + "fmt" + "os" + "path" + "path/filepath" + "strconv" + "testing" + + "cosmossdk.io/math" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + cosmosproto "github.com/cosmos/gogoproto/proto" + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/interchaintest/guardians" + "github.com/wormhole-foundation/wormchain/interchaintest/helpers" + wormholetypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// haltHeightDelta is the number of blocks to wait for a proposal to pass +var ( + haltHeightDelta = int64(10) + numGuardians = 2 +) + +// setupProposalTest is a helper function to setup a wormchain test with 2 users: +// the first capable of submitting proposals, the second not. +func setupProposalTest(t *testing.T) (context.Context, *cosmos.CosmosChain, *guardians.ValSet, ibc.Wallet, ibc.Wallet) { + // Base setup + guardians := guardians.CreateValSet(t, numGuardians) + chains := CreateLocalChain(t, *guardians) + _, ctx, _, _, _, _ := BuildInterchain(t, chains) + + wormchain := chains[0].(*cosmos.CosmosChain) + + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", math.NewInt(10_000_000_000), wormchain, wormchain) + user1 := users[0] + user2 := users[1] + + val := wormchain.Validators[0] + _, err := val.ExecTx(ctx, "validator", "wormhole", "create-allowed-address", user1.FormattedAddress(), "UserProposalSubmitter") + require.NoError(t, err, "error creating allowed address") + + return ctx, wormchain, guardians, user1, user2 +} + +func storeContractAllowErrors(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, keyName string, fileLoc string, guardians *guardians.ValSet) error { + node := chain.FullNodes[0] + + _, file := filepath.Split(fileLoc) + err := node.CopyFile(ctx, fileLoc, file) + require.NoError(t, err, fmt.Errorf("writing contract file to docker volume: %w", err)) + + content, err := os.ReadFile(fileLoc) + require.NoError(t, err) + + // gzip the wasm file + if helpers.IsWasm(content) { + content, err = helpers.GzipIt(content) + require.NoError(t, err) + } + + payload := helpers.CreateWasmStoreCodePayload(content) + v := helpers.GenerateVaa(0, guardians, vaa.ChainID(vaa.GovernanceChain), vaa.Address(vaa.GovernanceEmitter), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + vHex := hex.EncodeToString(vBz) + + _, err = node.ExecTx(ctx, keyName, "wormhole", "store", path.Join(node.HomeDir(), file), vHex, "--gas", "auto") + return err +} + +// TestGuardianSetUpdateProposal tests the process of submitting a guardian set update proposal +func TestGuardianSetUpdateProposal(t *testing.T) { + ctx, wormchain, oldGuardians, user1, user2 := setupProposalTest(t) + + var keys [][]byte + updatedGuardians := guardians.CreateValSet(t, numGuardians) + + for i := range numGuardians { + keys = append(keys, updatedGuardians.Vals[i].Addr) + } + + emitMsgProposal := []cosmosproto.Message{ + &wormholetypes.MsgGuardianSetUpdateProposal{ + Authority: "wormhole10d07y265gmmuvt4z0w9aw880jnsr700j5x7ea3", + NewGuardianSet: wormholetypes.GuardianSet{ + Index: 1, + Keys: keys, + }, + }, + } + + proposalDraft, err := wormchain.BuildProposal(emitMsgProposal, "Emit Wormhole Message", "emit msg", "ipfs://CID", fmt.Sprintf(`500000000%s`, wormchain.Config().Denom)) + require.NoError(t, err, "error building proposal") + + // First attempt (should fail because user2 is not allowed to submit proposals) + _, err = wormchain.SubmitProposal(ctx, user2.FormattedAddress(), proposalDraft) + require.Error(t, err, "expected error submitting proposal") + + // Second attempt (should succeed because user1 is allowed to submit proposals) + txProp, err := wormchain.SubmitProposal(ctx, user1.FormattedAddress(), proposalDraft) + t.Log("txProp", txProp) + require.NoError(t, err, "error submitting proposal") + + // Get height after proposal submission + height, _ := wormchain.Height(ctx) + + proposalID, err := strconv.ParseInt(txProp.ProposalID, 10, 64) + require.NoError(t, err, "failed to parse proposal ID") + + // Force all validators vote on proposal + err = wormchain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes) + require.NoError(t, err, "failed to submit votes") + + // Poll for proposal status to change to passed + proposal, err := cosmos.PollForProposalStatus(ctx, wormchain, height, height+haltHeightDelta, proposalID, govv1beta1.StatusPassed) + require.NoError(t, err, "proposal status did not change to passed in expected number of blocks") + require.NotEmpty(t, proposal, "proposal not found") + + // Wait for blocks + err = testutil.WaitForBlocks(ctx, 5, wormchain) + require.NoError(t, err, "error waiting for blocks") + + // Try to store contract with new guardian set (fails because validators do not exist per the new guardian set) + err = storeContractAllowErrors(t, ctx, wormchain, "faucet", "./contracts/wormhole_core.wasm", updatedGuardians) + require.Error(t, err, "expected error storing contract with new guardian set") + + // Try to store contract with old guardian set (passes as the current consensus index is still the old guardian set) + err = storeContractAllowErrors(t, ctx, wormchain, "faucet", "./contracts/wormhole_core.wasm", oldGuardians) + require.NoError(t, err, "error storing contract with old guardian set") +} + +// TestGovernanceWormholeMessageProposal tests the process of submitting a governance proposal to emit a wormhole message +func TestGovernanceWormholeMessageProposal(t *testing.T) { + ctx, wormchain, _, user1, user2 := setupProposalTest(t) + + emitMsgProposal := []cosmosproto.Message{ + &wormholetypes.MsgGovernanceWormholeMessageProposal{ + Authority: "wormhole10d07y265gmmuvt4z0w9aw880jnsr700j5x7ea3", + Action: 1, + Module: vaa.CoreModule, + Payload: []byte("payload"), + TargetChain: 1, + }, + } + + proposalDraft, err := wormchain.BuildProposal(emitMsgProposal, "Emit Wormhole Message", "emit msg", "ipfs://CID", fmt.Sprintf(`500000000%s`, wormchain.Config().Denom)) + require.NoError(t, err, "error building proposal") + + // First attempt (should fail because user2 is not allowed to submit proposals) + _, err = wormchain.SubmitProposal(ctx, user2.FormattedAddress(), proposalDraft) + require.Error(t, err, "expected error submitting proposal") + + // Second attempt (should succeed because user1 is allowed to submit proposals) + txProp, err := wormchain.SubmitProposal(ctx, user1.FormattedAddress(), proposalDraft) + t.Log("txProp", txProp) + require.NoError(t, err, "error submitting proposal") + + // Get height after proposal submission + height, _ := wormchain.Height(ctx) + + proposalID, err := strconv.ParseInt(txProp.ProposalID, 10, 64) + require.NoError(t, err, "failed to parse proposal ID") + + // Force all validators vote on proposal + err = wormchain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes) + require.NoError(t, err, "failed to submit votes") + + // Poll for proposal status to change to passed + proposal, err := cosmos.PollForProposalStatus(ctx, wormchain, height, height+haltHeightDelta, proposalID, govv1beta1.StatusPassed) + require.NoError(t, err, "proposal status did not change to passed in expected number of blocks") + require.NotEmpty(t, proposal, "proposal not found") +} diff --git a/wormchain/interchaintest/setup.go b/wormchain/interchaintest/setup.go index 6cc5dbc5ed..ade0355022 100644 --- a/wormchain/interchaintest/setup.go +++ b/wormchain/interchaintest/setup.go @@ -1,62 +1,75 @@ -package ictest +package interchaintest import ( "context" "encoding/json" "fmt" + "strings" "testing" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" + testutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/docker/docker/client" "github.com/icza/dyno" - - interchaintest "github.com/strangelove-ventures/interchaintest/v4" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos/wasm" - "github.com/strangelove-ventures/interchaintest/v4/ibc" - "github.com/strangelove-ventures/interchaintest/v4/testreporter" + interchaintest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos/wasm" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + interchaintestrelayer "github.com/strangelove-ventures/interchaintest/v7/relayer" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormchain/interchaintest/helpers" wormholetypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" "github.com/wormhole-foundation/wormhole/sdk/vaa" - - "github.com/docker/docker/client" - "github.com/stretchr/testify/require" - "go.uber.org/zap/zaptest" ) var ( - // pathWormchainGaia = "wormchain-gaia" // Replace with 2nd cosmos chain supporting wormchain - // genesisWalletAmount = int64(10_000_000) - votingPeriod = "10s" - maxDepositPeriod = "10s" - coinType = "118" - wormchainConfig = ibc.ChainConfig{ - Type: "cosmos", - Name: "wormchain", - ChainID: "wormchain-1", - Images: []ibc.DockerImage{ - { - Repository: "ghcr.io/strangelove-ventures/heighliner/wormchain", - UidGid: "1025:1025", - }, - }, - Bin: "wormchaind", - Bech32Prefix: "wormhole", - Denom: "uworm", - CoinType: coinType, - GasPrices: "0.00uworm", + IBCRelayerImage = "ghcr.io/cosmos/relayer" + IBCRelayerVersion = "v2.5.0" + + WormchainName = "wormchain" + WormchainRemoteRepo = "ghcr.io/strangelove-ventures/heighliner/wormchain" + WormchainLocalRepo = WormchainName + WormchainLocalVersion = "local" + WormchainDenom = "uworm" + + WormchainBechPrefix = "wormhole" + + VotingPeriod = "10s" + MaxDepositPeriod = "10s" + MinDepositAount = "1000000" + CoinType = "118" + + WormchainImage = ibc.DockerImage{ + Repository: WormchainName, + Version: WormchainLocalVersion, + UidGid: "1025:1025", + } + + WormchainConfig = ibc.ChainConfig{ + Type: "cosmos", + Name: WormchainName, + ChainID: fmt.Sprintf("%s-1", WormchainName), + Images: []ibc.DockerImage{WormchainImage}, + Bin: WormchainName + "d", + Bech32Prefix: WormchainBechPrefix, + Denom: WormchainDenom, + CoinType: CoinType, + GasPrices: fmt.Sprintf("0.0%s", WormchainDenom), + Gas: "auto", GasAdjustment: 1.8, TrustingPeriod: "112h", NoHostMount: false, - EncodingConfig: wormchainEncoding(), + EncodingConfig: WormchainEncoding(), } - numFullNodes = 1 + + numFull = 1 ) -// wormchainEncoding registers the Wormchain specific module codecs so that the associated types and msgs -// will be supported when writing to the blocksdb sqlite database. -func wormchainEncoding() *simappparams.EncodingConfig { +// WormchainEncoding returns the encoding config for the chain +func WormchainEncoding() *testutil.TestEncodingConfig { cfg := wasm.WasmEncoding() // register custom types @@ -65,27 +78,51 @@ func wormchainEncoding() *simappparams.EncodingConfig { return cfg } -func CreateChains(t *testing.T, wormchainVersion string, guardians guardians.ValSet) []ibc.Chain { - numWormchainVals := len(guardians.Vals) - wormchainConfig.Images[0].Version = wormchainVersion +// CreateChain generates a new chain with a custom image (useful for upgrades) +func CreateChain(t *testing.T, guardians guardians.ValSet, img ibc.DockerImage) []ibc.Chain { + cfg := WormchainConfig + cfg.ModifyGenesis = ModifyGenesis(VotingPeriod, MaxDepositPeriod, guardians) + cfg.Images = []ibc.DockerImage{img} + + // Append env variable to flag chain as sdk 47 or not + if img.Version == WormchainLocalVersion || strings.Contains(img.Version, "v3") { + cfg.Env = []string{"ICT_ABOVE_SDK_47=true"} + } else { + cfg.Env = []string{"ICT_ABOVE_SDK_47=false"} + } - // Create chain factory with wormchain - wormchainConfig.ModifyGenesis = ModifyGenesis(votingPeriod, maxDepositPeriod, guardians) + return CreateChainWithCustomConfig(t, guardians, cfg) +} + +// CreateLocalChain generates a new chain with the local image of Wormchain +func CreateLocalChain(t *testing.T, guardians guardians.ValSet) []ibc.Chain { + return CreateChain(t, guardians, WormchainImage) +} + +func CreateChainWithCustomConfig(t *testing.T, guardians guardians.ValSet, config ibc.ChainConfig) []ibc.Chain { + numVals := len(guardians.Vals) cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ { - ChainName: "wormchain", - ChainConfig: wormchainConfig, - NumValidators: &numWormchainVals, - NumFullNodes: &numFullNodes, + ChainName: WormchainName, + Version: config.Images[0].Version, + ChainConfig: config, + NumValidators: &numVals, + NumFullNodes: &numFull, + }, + { + Name: "gaia", + Version: "v10.0.1", + ChainConfig: ibc.ChainConfig{ + Bech32Prefix: "cosmos", + GasPrices: "0.0uatom", + }, }, - {Name: "gaia", Version: "v10.0.1", ChainConfig: ibc.ChainConfig{ - GasPrices: "0.0uatom", - }}, { Name: "osmosis", Version: "v15.1.2", ChainConfig: ibc.ChainConfig{ + Bech32Prefix: "osmo", ChainID: "osmosis-1002", // hardcoded handling in osmosis binary for osmosis-1, so need to override to something different. GasPrices: "1.0uosmo", EncodingConfig: wasm.WasmEncoding(), @@ -100,7 +137,7 @@ func CreateChains(t *testing.T, wormchainVersion string, guardians guardians.Val return chains } -func BuildInterchain(t *testing.T, chains []ibc.Chain) (context.Context, ibc.Relayer, *testreporter.RelayerExecReporter, *client.Client) { +func BuildInterchain(t *testing.T, chains []ibc.Chain) (*interchaintest.Interchain, context.Context, ibc.Relayer, *testreporter.RelayerExecReporter, *client.Client, string) { // Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use ic := interchaintest.NewInterchain() @@ -115,8 +152,13 @@ func BuildInterchain(t *testing.T, chains []ibc.Chain) (context.Context, ibc.Rel wormOsmoPath := "wormosmo" ctx := context.Background() client, network := interchaintest.DockerSetup(t) - r := interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t)).Build( - t, client, network) + + r := interchaintest.NewBuiltinRelayerFactory( + ibc.CosmosRly, + zaptest.NewLogger(t), + interchaintestrelayer.CustomDockerImage(IBCRelayerImage, IBCRelayerVersion, "100:1000"), + ).Build(t, client, network) + ic.AddRelayer(r, "relayer") ic.AddLink(interchaintest.InterchainLink{ Chain1: chains[0], // Wormchain @@ -132,11 +174,10 @@ func BuildInterchain(t *testing.T, chains []ibc.Chain) (context.Context, ibc.Rel }) err := ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ - TestName: t.Name(), - Client: client, - NetworkID: network, - SkipPathCreation: false, - BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: false, }) require.NoError(t, err) @@ -157,7 +198,7 @@ func BuildInterchain(t *testing.T, chains []ibc.Chain) (context.Context, ibc.Rel }, ) - return ctx, r, eRep, client + return ic, ctx, r, eRep, client, network } // Modify the genesis file: @@ -175,16 +216,33 @@ func ModifyGenesis(votingPeriod string, maxDepositPeriod string, guardians guard return nil, fmt.Errorf("failed to unmarshal genesis file: %w", err) } + isSdk47 := true + + for _, env := range chainConfig.Env { + if env == "ICT_ABOVE_SDK_47=false" { + isSdk47 = false + } + } + + votingParams := "params" + depositParams := "params" + + if !isSdk47 { + votingParams = "voting_params" + depositParams = "deposit_params" + } + // Modify gov - if err := dyno.Set(g, votingPeriod, "app_state", "gov", "voting_params", "voting_period"); err != nil { + if err := dyno.Set(g, votingPeriod, "app_state", "gov", votingParams, "voting_period"); err != nil { return nil, fmt.Errorf("failed to set voting period in genesis json: %w", err) } - if err := dyno.Set(g, maxDepositPeriod, "app_state", "gov", "deposit_params", "max_deposit_period"); err != nil { + if err := dyno.Set(g, maxDepositPeriod, "app_state", "gov", depositParams, "max_deposit_period"); err != nil { return nil, fmt.Errorf("failed to set max deposit period in genesis json: %w", err) } - if err := dyno.Set(g, chainConfig.Denom, "app_state", "gov", "deposit_params", "min_deposit", 0, "denom"); err != nil { + if err := dyno.Set(g, chainConfig.Denom, "app_state", "gov", depositParams, "min_deposit", 0, "denom"); err != nil { return nil, fmt.Errorf("failed to set min deposit in genesis json: %w", err) } + // Get validators var validators [][]byte for i := 0; i < numVals; i++ { @@ -209,15 +267,15 @@ func ModifyGenesis(votingPeriod string, maxDepositPeriod string, guardians guard } // Set guardian set list and validators - guardianSetList := []GuardianSet{} - guardianSet := GuardianSet{ + guardianSetList := []wormholetypes.GuardianSet{} + guardianSet := wormholetypes.GuardianSet{ Index: 0, Keys: [][]byte{}, } - guardianValidators := []GuardianValidator{} + guardianValidators := []wormholetypes.GuardianValidator{} for i := 0; i < numVals; i++ { guardianSet.Keys = append(guardianSet.Keys, guardians.Vals[i].Addr) - guardianValidators = append(guardianValidators, GuardianValidator{ + guardianValidators = append(guardianValidators, wormholetypes.GuardianValidator{ GuardianKey: guardians.Vals[i].Addr, ValidatorAddr: validators[i], }) @@ -230,13 +288,13 @@ func ModifyGenesis(votingPeriod string, maxDepositPeriod string, guardians guard return nil, fmt.Errorf("failed to set guardian validator list: %w", err) } - allowedAddresses := []ValidatorAllowedAddress{} - allowedAddresses = append(allowedAddresses, ValidatorAllowedAddress{ + allowedAddresses := []wormholetypes.ValidatorAllowedAddress{} + allowedAddresses = append(allowedAddresses, wormholetypes.ValidatorAllowedAddress{ ValidatorAddress: sdk.MustBech32ifyAddressBytes(chainConfig.Bech32Prefix, validators[0]), AllowedAddress: faucetAddress.(string), Name: "Faucet", }) - allowedAddresses = append(allowedAddresses, ValidatorAllowedAddress{ + allowedAddresses = append(allowedAddresses, wormholetypes.ValidatorAllowedAddress{ ValidatorAddress: sdk.MustBech32ifyAddressBytes(chainConfig.Bech32Prefix, validators[0]), AllowedAddress: relayerAddress.(string), Name: "Relayer", @@ -262,24 +320,3 @@ func ModifyGenesis(votingPeriod string, maxDepositPeriod string, guardians guard return out, nil } } - -// Replace these with reference to x/wormchain/types -type GuardianSet struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` - ExpirationTime uint64 `protobuf:"varint,3,opt,name=expirationTime,proto3" json:"expirationTime,omitempty"` -} - -type ValidatorAllowedAddress struct { - // the validator/guardian that controls this entry - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // the allowlisted account - AllowedAddress string `protobuf:"bytes,2,opt,name=allowed_address,json=allowedAddress,proto3" json:"allowed_address,omitempty"` - // human readable name - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` -} - -type GuardianValidator struct { - GuardianKey []byte `protobuf:"bytes,1,opt,name=guardianKey,proto3" json:"guardianKey,omitempty"` - ValidatorAddr []byte `protobuf:"bytes,2,opt,name=validatorAddr,proto3" json:"validatorAddr,omitempty"` -} diff --git a/wormchain/interchaintest/upgrade_failure_test.go b/wormchain/interchaintest/upgrade_failure_test.go index 4a4e5c35b8..84a6799266 100644 --- a/wormchain/interchaintest/upgrade_failure_test.go +++ b/wormchain/interchaintest/upgrade_failure_test.go @@ -1,75 +1,59 @@ -package ictest +package interchaintest import ( "context" - "fmt" "testing" "time" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" ) -// TestUpgradeFailure starts wormchain on v2.18.1, then attempts to upgrade 1 validator at a time to v2.23.0 +// TestUpgradeFailure starts wormchain on v2.24.3.2, then attempts to re-start with version v3.0.0 by bypassing the upgrade handler logic. +// Test will fail because it did not successfully migrate stores properly. func TestUpgradeFailure(t *testing.T) { // Base setup numVals := 5 guardians := guardians.CreateValSet(t, numVals) - chains := CreateChains(t, "v2.18.1", *guardians) - ctx, _, _, client := BuildInterchain(t, chains) - // Chains + chains := CreateChain(t, *guardians, ibc.DockerImage{ + Repository: WormchainRemoteRepo, + Version: "v2.24.3.2", + UidGid: WormchainImage.UidGid, + }) + wormchain := chains[0].(*cosmos.CosmosChain) + _, ctx, _, _, client, _ := BuildInterchain(t, chains) + blocksAfterUpgrade := uint64(5) + err := wormchain.StopAllNodes(ctx) + require.NoError(t, err, "error stopping node(s)") + // upgrade version on all nodes - wormchain.UpgradeVersion(ctx, client, "v2.23.0") - - for i := 0; i < numVals; i++ { - haltHeight, err := wormchain.Height(ctx) - require.NoError(t, err) - fmt.Println("Halt height:", i, " : ", haltHeight) - - // bring down node to prepare for upgrade - err = wormchain.StopANode(ctx, i) - require.NoError(t, err, "error stopping node(s)") - - // start node back up with new binary - err = wormchain.StartANode(ctx, i) - require.NoError(t, err, "error starting upgraded node(s)") - - // Restart the fullnode with the last validator - if i+1 == numVals { - err = wormchain.StopANode(ctx, i+1) - require.NoError(t, err, "error stopping node(s)") - err = wormchain.StartANode(ctx, i+1) - require.NoError(t, err, "error starting upgraded node(s)") - } - - timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*20) - defer timeoutCtxCancel() - - // Wait for 5 blocks (2sec/block) or 20 seconds - testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) - } - // Get current height - height1, err := wormchain.Height(ctx) - require.NoError(t, err) + wormchain.UpgradeVersion(ctx, client, WormchainLocalRepo, WormchainLocalVersion) + + err = wormchain.StartAllNodes(ctx) + require.Error(t, err) timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*20) defer timeoutCtxCancel() - // Wait for 5 blocks (2sec/block) or 20 seconds - testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) + // Wait for blocks + err = testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) + require.Error(t, err) + + // Get current height + _, err = wormchain.Height(ctx) + require.Error(t, err) - height2, err := wormchain.Height(ctx) - require.NoError(t, err, "error fetching height after upgrade") - fmt.Println("Checked height: ", height2) + testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) - // height1 and height2 should be equal since we don't produce blocks with this upgrade path - require.Equal(t, height1, height2, "height incremented after upgrade, so upgrade succeeded and test failed") + _, err = wormchain.Height(ctx) + require.Error(t, err) } diff --git a/wormchain/interchaintest/upgrade_test.go b/wormchain/interchaintest/upgrade_test.go index 2ce7440f84..b60b8e2822 100644 --- a/wormchain/interchaintest/upgrade_test.go +++ b/wormchain/interchaintest/upgrade_test.go @@ -1,4 +1,4 @@ -package ictest +package interchaintest import ( "context" @@ -7,19 +7,19 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/btcsuite/btcd/btcutil/base58" - "github.com/strangelove-ventures/interchaintest/v4" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/ibc" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" "github.com/wormhole-foundation/wormchain/interchaintest/helpers" "github.com/wormhole-foundation/wormhole/sdk/vaa" - - sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ) // TestUpgradeTest upgrades from v2.18.1 -> v2.18.1.1 -> V2.23.0 and: @@ -42,8 +42,14 @@ func TestUpgrade(t *testing.T) { // Base setup numVals := 5 guardians := guardians.CreateValSet(t, numVals) - chains := CreateChains(t, "v2.18.1", *guardians) - ctx, r, eRep, client := BuildInterchain(t, chains) + + chains := CreateChain(t, *guardians, ibc.DockerImage{ + Repository: WormchainRemoteRepo, + Version: "v2.24.3.2", + UidGid: WormchainImage.UidGid, + }) + + _, ctx, r, eRep, client, _ := BuildInterchain(t, chains) // Chains wormchain := chains[0].(*cosmos.CosmosChain) @@ -62,71 +68,56 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err) wormToGaiaChannel := gaiaToWormChannel.Counterparty - users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(10_000_000_000), wormchain, gaia, osmosis, osmosis) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", math.NewInt(10_000_000_000), wormchain, gaia, osmosis, osmosis) _ = users[0] // Wormchain user gaiaUser := users[1] osmoUser1 := users[2] osmoUser2 := users[3] - // ************************************************************* - // ********* Upgrade to new version of wormchain *************** - // ************************************************************* + // ****************************************************************************************** + // ********* Upgrade to new version of wormchain (non-state breaking upgrade) *************** + // ****************************************************************************************** + + blocksAfterUpgrade := int64(5) - blocksAfterUpgrade := uint64(5) + haltHeight, err := wormchain.Height(ctx) + require.NoError(t, err, "error fetching height before upgrade1") + + err = wormchain.StopAllNodes(ctx) + require.NoError(t, err, "error stopping node(s)") // upgrade version on all nodes - wormchain.UpgradeVersion(ctx, client, "v2.18.1.1") - - for i := 0; i < numVals; i++ { - haltHeight, err := wormchain.Height(ctx) - require.NoError(t, err) - fmt.Println("Halt height:", i, " : ", haltHeight) - - // bring down nodes to prepare for upgrade - err = wormchain.StopANode(ctx, i) - require.NoError(t, err, "error stopping node(s)") - - // start all nodes back up. - // validators reach consensus on first block after upgrade height - // and chain block production resumes. - err = wormchain.StartANode(ctx, i) - require.NoError(t, err, "error starting upgraded node(s)") - - // Restart the fullnode with the last validator - if i+1 == numVals { - err = wormchain.StopANode(ctx, i+1) - require.NoError(t, err, "error stopping node(s)") - err = wormchain.StartANode(ctx, i+1) - require.NoError(t, err, "error starting upgraded node(s)") - } - - timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45) - defer timeoutCtxCancel() - - err = testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) - require.NoError(t, err, "chain did not produce blocks after upgrade1") - - height, err := wormchain.Height(ctx) - require.NoError(t, err, "error fetching height after upgrade") - fmt.Println("Checked height: ", height) - - require.GreaterOrEqual(t, height, haltHeight+blocksAfterUpgrade, "height did not increment enough after upgrade") - } + wormchain.UpgradeVersion(ctx, client, WormchainRemoteRepo, "v2.24.9") + + err = wormchain.StartAllNodes(ctx) + require.NoError(t, err, "error starting upgraded node(s)") + + timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*20) + defer timeoutCtxCancel() + + err = testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), wormchain) + require.NoError(t, err, "chain did not produce blocks after upgrade1") + + height, err := wormchain.Height(ctx) + require.NoError(t, err, "error fetching height after upgrade1") + fmt.Println("Checked height: ", height) + + require.GreaterOrEqual(t, height, haltHeight+blocksAfterUpgrade, "height did not increment enough after upgrade1") fmt.Println("***** PASS upgrade #1 **********") // -------------------------------------------------------------------------------------- // upgrade version on all nodes - blocksAfterUpgrade = uint64(10) + blocksAfterUpgrade = int64(10) - height, err := wormchain.Height(ctx) - require.NoError(t, err, "error fetching height before upgrade") + height, err = wormchain.Height(ctx) + require.NoError(t, err, "error fetching height before upgrade2") fmt.Println("Height at sending schedule upgrade: ", height) - haltHeight := height + blocksAfterUpgrade - fmt.Println("Height for scheduled upgrade: ", haltHeight) + haltHeight = height + blocksAfterUpgrade + fmt.Println("Height for scheduled upgrade2: ", haltHeight) - helpers.ScheduleUpgrade(t, ctx, wormchain, "faucet", "v2.23.0", haltHeight, guardians) + helpers.ScheduleUpgrade(t, ctx, wormchain, "faucet", "v3.0.0", uint64(haltHeight), guardians) timeoutCtx3, timeoutCtxCancel3 := context.WithTimeout(ctx, time.Second*45) defer timeoutCtxCancel3() @@ -145,7 +136,7 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err, "error stopping node(s)") // upgrade version on all nodes - wormchain.UpgradeVersion(ctx, client, "v2.23.0") + wormchain.UpgradeVersion(ctx, client, WormchainLocalRepo, WormchainLocalVersion) // start all nodes back up. // validators reach consensus on first block after upgrade height @@ -170,11 +161,11 @@ func TestUpgrade(t *testing.T) { // ******************* Continue with test ********************** // ************************************************************* - ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName, "./contracts/ibc_hooks.wasm") + ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName(), "./contracts/ibc_hooks.wasm") require.NoError(t, err) fmt.Println("IBC hooks code id: ", ibcHooksCodeId) - ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName, ibcHooksCodeId, "{}", true) + ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName(), ibcHooksCodeId, "{}", true) require.NoError(t, err) fmt.Println("IBC hooks contract addr: ", ibcHooksContractAddr) @@ -186,7 +177,7 @@ func TestUpgrade(t *testing.T) { fmt.Println("Core contract code id: ", coreContractCodeId) // Instantiate wormhole core contract - coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, wormchainConfig, guardians) + coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, WormchainConfig, guardians) coreContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", coreContractCodeId, "wormhole_core", coreInstantiateMsg, guardians) fmt.Println("Core contract address: ", coreContractAddr) @@ -199,7 +190,7 @@ func TestUpgrade(t *testing.T) { fmt.Println("Token bridge contract code id: ", tbContractCodeId) // Instantiate token bridge contract - tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, wormchainConfig, coreContractAddr, wrappedAssetCodeId) + tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, WormchainConfig, coreContractAddr, wrappedAssetCodeId) tbContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", tbContractCodeId, "token_bridge", tbInstantiateMsg, guardians) fmt.Println("Token bridge contract address: ", tbContractAddr) @@ -237,16 +228,16 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err) // Create and process a simple ibc payload3: Transfers 10.000_018 of asset1 from external chain through wormchain to gaia user - simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, GaiaChainID, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), 0, 1) + simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, GaiaChainID, gaiaUser.FormattedAddress(), 0, 1) externalSender := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8} - payload3 := helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToGaiaUser1), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) + payload3 := helpers.CreatePayload3(wormchain.Config(), AmountExternalToGaiaUser1.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg := helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) // Create and process a simple ibc payload3: Transfers 1.000_001 of asset1 from external chain through wormchain to osmo user1 - simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), 0, 1) - payload3 = helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToOsmoUser1), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) + simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, osmoUser1.FormattedAddress(), 0, 1) + payload3 = helpers.CreatePayload3(wormchain.Config(), AmountExternalToOsmoUser1.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) @@ -254,9 +245,9 @@ func TestUpgrade(t *testing.T) { // Create and process a contract controlled ibc payload3 // Transfers 1.000_002 of asset1 from external chain through wormchain to ibc hooks contract addr // IBC hooks is used to route the contract controlled payload to a test contract which forwards tokens to osmo user2 - ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) contractControlledPayload := helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) - payload3 = helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToOsmoUser2), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) + payload3 = helpers.CreatePayload3(wormchain.Config(), AmountExternalToOsmoUser2.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) @@ -284,7 +275,7 @@ func TestUpgrade(t *testing.T) { osmoIbcAsset1Denom := transfertypes.ParseDenomTrace(osmoAsset1Denom).IBCDenom() // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1BalanceTemp, err := gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1BalanceTemp, err := gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1BalanceTemp) @@ -293,7 +284,7 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err) // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1BalanceTemp, err = gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1BalanceTemp, err = gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1BalanceTemp) @@ -303,9 +294,9 @@ func TestUpgrade(t *testing.T) { transfer := ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToExternalSimple), + Amount: AmountGaiaUser1ToExternalSimple, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{Memo: simpleMemo}) + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{Memo: simpleMemo}) require.NoError(t, err) // wait for transfer to ack @@ -318,9 +309,9 @@ func TestUpgrade(t *testing.T) { transfer = ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToExternalCC), + Amount: AmountGaiaUser1ToExternalCC, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{Memo: ccIbcHooksMsg}) + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{Memo: ccIbcHooksMsg}) require.NoError(t, err) // wait for transfer to ack @@ -329,13 +320,13 @@ func TestUpgrade(t *testing.T) { // ************** Cosmos->Cosmos: Simple payload (wormhole-mw + PFM) **************** // Send 1.000_005 asset 1 from gaia user 1 to osmo user 1 - simplePfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransfer(t, OsmoChainID, []byte(osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix)), 0, 1) + simplePfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransfer(t, OsmoChainID, []byte(osmoUser1.FormattedAddress()), 0, 1) transfer = ibc.WalletAmount{ Address: wormchainFaucetAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToOsmoUser1), + Amount: AmountGaiaUser1ToOsmoUser1, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{ + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{ Timeout: &ibc.IBCTimeout{ NanoSeconds: 30_000_000_000, }, @@ -349,14 +340,14 @@ func TestUpgrade(t *testing.T) { // ************** Cosmos->Cosmos: Contract controlled payload (wormhole-mw + PFM) **************** // Send 1.000_006 asset 1 from gaia user 1 to osmo user 2 - ccPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ccPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) ccPfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransferWithPayload(t, OsmoChainID, []byte(ibcHooksContractAddr), ccPayload, 1) transfer = ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToOsmoUser2), + Amount: AmountGaiaUser1ToOsmoUser2, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{ + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{ Timeout: &ibc.IBCTimeout{ NanoSeconds: 30_000_000_000, }, @@ -369,22 +360,22 @@ func TestUpgrade(t *testing.T) { require.NoError(t, err) // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1Balance, err := gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1Balance, err := gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) - expectedGaiaUser1Amount := AmountExternalToGaiaUser1 - AmountGaiaUser1ToExternalCC - AmountGaiaUser1ToExternalSimple - AmountGaiaUser1ToOsmoUser1 - AmountGaiaUser1ToOsmoUser2 - require.Equal(t, int64(expectedGaiaUser1Amount), gaiaUser1Asset1Balance) + expectedGaiaUser1Amount := AmountExternalToGaiaUser1.Sub(AmountGaiaUser1ToExternalCC).Sub(AmountGaiaUser1ToExternalSimple).Sub(AmountGaiaUser1ToOsmoUser1).Sub(AmountGaiaUser1ToOsmoUser2) + require.Equal(t, expectedGaiaUser1Amount.Int64(), gaiaUser1Asset1Balance.Int64()) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1Balance) // Verify osmo user 1 has expected asset 1 balance - osmoUser1Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), osmoIbcAsset1Denom) + osmoUser1Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser1.FormattedAddress(), osmoIbcAsset1Denom) require.NoError(t, err) - require.Equal(t, int64(AmountExternalToOsmoUser1+AmountGaiaUser1ToOsmoUser1), osmoUser1Asset1Balance) + require.Equal(t, AmountExternalToOsmoUser1.Add(AmountGaiaUser1ToOsmoUser1).Int64(), osmoUser1Asset1Balance.Int64()) fmt.Println("Osmo user1 asset1 coins: ", osmoUser1Asset1Balance) // Verify osmo user 2 has expected asset 1 balance - osmoUser2Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix), osmoIbcAsset1Denom) + osmoUser2Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser2.FormattedAddress(), osmoIbcAsset1Denom) require.NoError(t, err) - require.Equal(t, int64(AmountExternalToOsmoUser2+AmountGaiaUser1ToOsmoUser2), osmoUser2Asset1Balance) + require.Equal(t, AmountExternalToOsmoUser2.Add(AmountGaiaUser1ToOsmoUser2).Int64(), osmoUser2Asset1Balance.Int64()) fmt.Println("Osmo user2 asset1 coins: ", osmoUser2Asset1Balance) // Verify asset 1 cw20 contract has expected final total supply @@ -394,6 +385,6 @@ func TestUpgrade(t *testing.T) { fmt.Println("Asset1 supply: ", cw20QueryRsp.Data.TotalSupply) totalSupply, err := strconv.ParseUint(cw20QueryRsp.Data.TotalSupply, 10, 64) require.NoError(t, err) - expectedTotalSupply := AmountExternalToGaiaUser1 + AmountExternalToOsmoUser1 + AmountExternalToOsmoUser2 - AmountGaiaUser1ToExternalSimple - AmountGaiaUser1ToExternalCC - require.Equal(t, uint64(expectedTotalSupply), totalSupply) + expectedTotalSupply := AmountExternalToGaiaUser1.Add(AmountExternalToOsmoUser1).Add(AmountExternalToOsmoUser2).Sub(AmountGaiaUser1ToExternalSimple).Sub(AmountGaiaUser1ToExternalCC) + require.Equal(t, expectedTotalSupply.Uint64(), totalSupply) } diff --git a/wormchain/interchaintest/wasmd_ante_test.go b/wormchain/interchaintest/wasmd_ante_test.go new file mode 100644 index 0000000000..d6bb14e58e --- /dev/null +++ b/wormchain/interchaintest/wasmd_ante_test.go @@ -0,0 +1,107 @@ +package interchaintest + +import ( + "fmt" + "testing" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/interchaintest/guardians" + "github.com/wormhole-foundation/wormchain/interchaintest/helpers" + wasmdante "github.com/wormhole-foundation/wormchain/x/wormhole/ante" +) + +func TestWasmdAnteDecorator(t *testing.T) { + // Base setup + numVals := 2 + guardians := guardians.CreateValSet(t, numVals) + chains := CreateLocalChain(t, *guardians) + _, ctx, _, _, _, _ := BuildInterchain(t, chains) + + // Chains + wormchain := chains[0].(*cosmos.CosmosChain) + + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", math.NewInt(10_000_000_000), wormchain) + user := users[0] + + // === PART #1 === + // Store contract via wasm (fails) + // + _, err := wormchain.StoreContract(ctx, "faucet", "./contracts/ibc_hooks.wasm") + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) + + // === PART #2 === + // Store wormhole core contract via Wormhole (pass) + // + coreContractCodeId := helpers.StoreContract(t, ctx, wormchain, "faucet", "./contracts/wormhole_core.wasm", guardians) + fmt.Println("Core contract code id: ", coreContractCodeId) + + // === PART #3 === + // Instantiate contract via wasm (fails) + _, err = wormchain.InstantiateContract(ctx, "faucet", coreContractCodeId, "{}", true) + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) + + // === PART #4 === + // Instantiate contract via Wormhole (pass) + coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, WormchainConfig, guardians) + coreContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", coreContractCodeId, "wormhole_core", coreInstantiateMsg, guardians) + fmt.Println("Core contract address: ", coreContractAddr) + + // === PART #5 === + // Add helper contracts for executing wormchain core contract + + // Store cw20_wrapped_2 contract + wrappedAssetCodeId := helpers.StoreContract(t, ctx, wormchain, "faucet", "./contracts/cw20_wrapped_2.wasm", guardians) + fmt.Println("CW20 wrapped_2 code id: ", wrappedAssetCodeId) + + // Store token bridge contract + tbContractCodeId := helpers.StoreContract(t, ctx, wormchain, "faucet", "./contracts/token_bridge.wasm", guardians) + fmt.Println("Token bridge contract code id: ", tbContractCodeId) + + // Instantiate token bridge contract + tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, WormchainConfig, coreContractAddr, wrappedAssetCodeId) + tbContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", tbContractCodeId, "token_bridge", tbInstantiateMsg, guardians) + fmt.Println("Token bridge contract address: ", tbContractAddr) + + // === PART #6 === + // Execute contract via wasm (pass) + tbRegisterChainMsg := helpers.TbRegisterChainMsg(t, ExternalChainId, ExternalChainEmitterAddr, guardians) + _, err = wormchain.ExecuteContract(ctx, "faucet", tbContractAddr, string(tbRegisterChainMsg)) + require.NoError(t, err) + + // === PART #7 === + // Test misc wasm messages (all should fail) + _, err = wormchain.MigrateContract(ctx, "faucet", coreContractAddr, coreContractCodeId, "{}") + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) + + node := wormchain.FullNodes[0] + + // Clear contract admin (fails) + cmd := []string{"wasm", "clear-contract-admin", coreContractAddr} + _, err = node.ExecTx(ctx, user.KeyName(), cmd...) + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) + + faucetBz, err := wormchain.GetAddress(ctx, "faucet") + require.NoError(t, err) + faucetAddr := sdk.MustBech32ifyAddressBytes(wormchain.Config().Bech32Prefix, faucetBz) + fmt.Println("Wormchain faucet addr: ", faucetAddr) + + // Set contract admin (fails) + cmd = []string{"wasm", "set-contract-admin", coreContractAddr, faucetAddr} + _, err = node.ExecTx(ctx, user.KeyName(), cmd...) + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) + + // Set contract label (fails) + cmd = []string{"wasm", "set-contract-label", coreContractAddr, "label"} + _, err = node.ExecTx(ctx, user.KeyName(), cmd...) + require.Error(t, err) + require.Contains(t, err.Error(), wasmdante.ErrNotSupported().Error()) +} diff --git a/wormchain/interchaintest/wormchain_test.go b/wormchain/interchaintest/wormchain_test.go index cec5d30cac..f2cbaab5fd 100644 --- a/wormchain/interchaintest/wormchain_test.go +++ b/wormchain/interchaintest/wormchain_test.go @@ -1,15 +1,16 @@ -package ictest +package interchaintest import ( "fmt" "strconv" "testing" + "cosmossdk.io/math" "github.com/btcsuite/btcd/btcutil/base58" - "github.com/strangelove-ventures/interchaintest/v4" - "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v4/ibc" - "github.com/strangelove-ventures/interchaintest/v4/testutil" + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormchain/interchaintest/guardians" @@ -17,7 +18,7 @@ import ( "github.com/wormhole-foundation/wormhole/sdk/vaa" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) var ( @@ -33,13 +34,13 @@ var ( Asset1ChainID = ExternalChainId Asset1Decimals = uint8(6) - AmountExternalToGaiaUser1 = 10_000_018 - AmountExternalToOsmoUser1 = 1_000_001 - AmountExternalToOsmoUser2 = 1_000_002 - AmountGaiaUser1ToExternalSimple = 1_000_003 - AmountGaiaUser1ToExternalCC = 1_000_004 - AmountGaiaUser1ToOsmoUser1 = 1_000_005 - AmountGaiaUser1ToOsmoUser2 = 1_000_006 + AmountExternalToGaiaUser1 = math.NewInt(10_000_018) + AmountExternalToOsmoUser1 = math.NewInt(1_000_001) + AmountExternalToOsmoUser2 = math.NewInt(1_000_002) + AmountGaiaUser1ToExternalSimple = math.NewInt(1_000_003) + AmountGaiaUser1ToExternalCC = math.NewInt(1_000_004) + AmountGaiaUser1ToOsmoUser1 = math.NewInt(1_000_005) + AmountGaiaUser1ToOsmoUser2 = math.NewInt(1_000_006) ) // TestWormchain runs through a simple test case for each deliverable @@ -62,8 +63,8 @@ func TestWormchain(t *testing.T) { // Base setup numVals := 2 guardians := guardians.CreateValSet(t, numVals) - chains := CreateChains(t, "v2.24.2", *guardians) - ctx, r, eRep, _ := BuildInterchain(t, chains) + chains := CreateLocalChain(t, *guardians) + _, ctx, r, eRep, _, _ := BuildInterchain(t, chains) // Chains wormchain := chains[0].(*cosmos.CosmosChain) @@ -82,17 +83,17 @@ func TestWormchain(t *testing.T) { require.NoError(t, err) wormToGaiaChannel := gaiaToWormChannel.Counterparty - users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(10_000_000_000), wormchain, gaia, osmosis, osmosis) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", math.NewInt(10_000_000_000), wormchain, gaia, osmosis, osmosis) _ = users[0] // Wormchain user gaiaUser := users[1] osmoUser1 := users[2] osmoUser2 := users[3] - ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName, "./contracts/ibc_hooks.wasm") + ibcHooksCodeId, err := osmosis.StoreContract(ctx, osmoUser1.KeyName(), "./contracts/ibc_hooks.wasm") require.NoError(t, err) fmt.Println("IBC hooks code id: ", ibcHooksCodeId) - ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName, ibcHooksCodeId, "{}", true) + ibcHooksContractAddr, err := osmosis.InstantiateContract(ctx, osmoUser1.KeyName(), ibcHooksCodeId, "{}", true) require.NoError(t, err) fmt.Println("IBC hooks contract addr: ", ibcHooksContractAddr) @@ -104,7 +105,7 @@ func TestWormchain(t *testing.T) { fmt.Println("Core contract code id: ", coreContractCodeId) // Instantiate wormhole core contract - coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, wormchainConfig, guardians) + coreInstantiateMsg := helpers.CoreContractInstantiateMsg(t, WormchainConfig, guardians) coreContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", coreContractCodeId, "wormhole_core", coreInstantiateMsg, guardians) fmt.Println("Core contract address: ", coreContractAddr) @@ -117,7 +118,7 @@ func TestWormchain(t *testing.T) { fmt.Println("Token bridge contract code id: ", tbContractCodeId) // Instantiate token bridge contract - tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, wormchainConfig, coreContractAddr, wrappedAssetCodeId) + tbInstantiateMsg := helpers.TbContractInstantiateMsg(t, WormchainConfig, coreContractAddr, wrappedAssetCodeId) tbContractAddr := helpers.InstantiateContract(t, ctx, wormchain, "faucet", tbContractCodeId, "token_bridge", tbInstantiateMsg, guardians) fmt.Println("Token bridge contract address: ", tbContractAddr) @@ -155,16 +156,16 @@ func TestWormchain(t *testing.T) { require.NoError(t, err) // Create and process a simple ibc payload3: Transfers 10.000_018 of asset1 from external chain through wormchain to gaia user - simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, GaiaChainID, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), 0, 1) + simplePayload := helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, GaiaChainID, gaiaUser.FormattedAddress(), 0, 1) externalSender := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8} - payload3 := helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToGaiaUser1), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) + payload3 := helpers.CreatePayload3(wormchain.Config(), AmountExternalToGaiaUser1.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg := helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) // Create and process a simple ibc payload3: Transfers 1.000_001 of asset1 from external chain through wormchain to osmo user1 - simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), 0, 1) - payload3 = helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToOsmoUser1), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) + simplePayload = helpers.CreateGatewayIbcTokenBridgePayloadTransfer(t, OsmoChainID, osmoUser1.FormattedAddress(), 0, 1) + payload3 = helpers.CreatePayload3(wormchain.Config(), AmountExternalToOsmoUser1.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, simplePayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) @@ -172,9 +173,9 @@ func TestWormchain(t *testing.T) { // Create and process a contract controlled ibc payload3 // Transfers 1.000_002 of asset1 from external chain through wormchain to ibc hooks contract addr // IBC hooks is used to route the contract controlled payload to a test contract which forwards tokens to osmo user2 - ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ibcHooksPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) contractControlledPayload := helpers.CreateGatewayIbcTokenBridgePayloadTransferWithPayload(t, OsmoChainID, ibcHooksContractAddr, ibcHooksPayload, 1) - payload3 = helpers.CreatePayload3(wormchain.Config(), uint64(AmountExternalToOsmoUser2), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) + payload3 = helpers.CreatePayload3(wormchain.Config(), AmountExternalToOsmoUser2.Uint64(), Asset1ContractAddr, Asset1ChainID, ibcTranslatorContractAddr, uint16(vaa.ChainIDWormchain), externalSender, contractControlledPayload) completeTransferAndConvertMsg = helpers.IbcTranslatorCompleteTransferAndConvertMsg(t, ExternalChainId, ExternalChainEmitterAddr, payload3, guardians) _, err = wormchain.ExecuteContract(ctx, "faucet", ibcTranslatorContractAddr, completeTransferAndConvertMsg) require.NoError(t, err) @@ -202,7 +203,7 @@ func TestWormchain(t *testing.T) { osmoIbcAsset1Denom := transfertypes.ParseDenomTrace(osmoAsset1Denom).IBCDenom() // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1BalanceTemp, err := gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1BalanceTemp, err := gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1BalanceTemp) @@ -211,7 +212,7 @@ func TestWormchain(t *testing.T) { require.NoError(t, err) // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1BalanceTemp, err = gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1BalanceTemp, err = gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1BalanceTemp) @@ -221,9 +222,9 @@ func TestWormchain(t *testing.T) { transfer := ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToExternalSimple), + Amount: AmountGaiaUser1ToExternalSimple, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{Memo: simpleMemo}) + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{Memo: simpleMemo}) require.NoError(t, err) // wait for transfer to ack @@ -236,9 +237,9 @@ func TestWormchain(t *testing.T) { transfer = ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToExternalCC), + Amount: AmountGaiaUser1ToExternalCC, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{Memo: ccIbcHooksMsg}) + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{Memo: ccIbcHooksMsg}) require.NoError(t, err) // wait for transfer to ack @@ -247,13 +248,13 @@ func TestWormchain(t *testing.T) { // ************** Cosmos->Cosmos: Simple payload (wormhole-mw + PFM) **************** // Send 1.000_005 asset 1 from gaia user 1 to osmo user 1 - simplePfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransfer(t, OsmoChainID, []byte(osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix)), 0, 1) + simplePfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransfer(t, OsmoChainID, []byte(osmoUser1.FormattedAddress()), 0, 1) transfer = ibc.WalletAmount{ Address: wormchainFaucetAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToOsmoUser1), + Amount: AmountGaiaUser1ToOsmoUser1, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{ + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{ Timeout: &ibc.IBCTimeout{ NanoSeconds: 30_000_000_000, }, @@ -267,14 +268,14 @@ func TestWormchain(t *testing.T) { // ************** Cosmos->Cosmos: Contract controlled payload (wormhole-mw + PFM) **************** // Send 1.000_006 asset 1 from gaia user 1 to osmo user 2 - ccPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix)) + ccPayload := helpers.CreateIbcHooksMsg(t, ibcHooksContractAddr, osmoUser2.FormattedAddress()) ccPfmMsg := helpers.CreateIbcComposabilityMwMemoGatewayTransferWithPayload(t, OsmoChainID, []byte(ibcHooksContractAddr), ccPayload, 1) transfer = ibc.WalletAmount{ Address: ibcTranslatorContractAddr, Denom: gaiaIbcAsset1Denom, - Amount: int64(AmountGaiaUser1ToOsmoUser2), + Amount: AmountGaiaUser1ToOsmoUser2, } - _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{ + _, err = gaia.SendIBCTransfer(ctx, gaiaToWormChannel.ChannelID, gaiaUser.KeyName(), transfer, ibc.TransferOptions{ Timeout: &ibc.IBCTimeout{ NanoSeconds: 30_000_000_000, }, @@ -287,22 +288,22 @@ func TestWormchain(t *testing.T) { require.NoError(t, err) // Verify Gaia user 1 has expected asset 1 balance - gaiaUser1Asset1Balance, err := gaia.GetBalance(ctx, gaiaUser.Bech32Address(gaia.Config().Bech32Prefix), gaiaIbcAsset1Denom) + gaiaUser1Asset1Balance, err := gaia.GetBalance(ctx, gaiaUser.FormattedAddress(), gaiaIbcAsset1Denom) require.NoError(t, err) - expectedGaiaUser1Amount := AmountExternalToGaiaUser1 - AmountGaiaUser1ToExternalCC - AmountGaiaUser1ToExternalSimple - AmountGaiaUser1ToOsmoUser1 - AmountGaiaUser1ToOsmoUser2 - require.Equal(t, int64(expectedGaiaUser1Amount), gaiaUser1Asset1Balance) + expectedGaiaUser1Amount := AmountExternalToGaiaUser1.Sub(AmountGaiaUser1ToExternalCC).Sub(AmountGaiaUser1ToExternalSimple).Sub(AmountGaiaUser1ToOsmoUser1).Sub(AmountGaiaUser1ToOsmoUser2) + require.Equal(t, expectedGaiaUser1Amount.Int64(), gaiaUser1Asset1Balance.Int64()) fmt.Println("Gaia user asset1 coins: ", gaiaUser1Asset1Balance) // Verify osmo user 1 has expected asset 1 balance - osmoUser1Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser1.Bech32Address(osmosis.Config().Bech32Prefix), osmoIbcAsset1Denom) + osmoUser1Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser1.FormattedAddress(), osmoIbcAsset1Denom) require.NoError(t, err) - require.Equal(t, int64(AmountExternalToOsmoUser1+AmountGaiaUser1ToOsmoUser1), osmoUser1Asset1Balance) + require.Equal(t, AmountExternalToOsmoUser1.Add(AmountGaiaUser1ToOsmoUser1).Int64(), osmoUser1Asset1Balance.Int64()) fmt.Println("Osmo user1 asset1 coins: ", osmoUser1Asset1Balance) // Verify osmo user 2 has expected asset 1 balance - osmoUser2Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser2.Bech32Address(osmosis.Config().Bech32Prefix), osmoIbcAsset1Denom) + osmoUser2Asset1Balance, err := osmosis.GetBalance(ctx, osmoUser2.FormattedAddress(), osmoIbcAsset1Denom) require.NoError(t, err) - require.Equal(t, int64(AmountExternalToOsmoUser2+AmountGaiaUser1ToOsmoUser2), osmoUser2Asset1Balance) + require.Equal(t, AmountExternalToOsmoUser2.Add(AmountGaiaUser1ToOsmoUser2).Int64(), osmoUser2Asset1Balance.Int64()) fmt.Println("Osmo user2 asset1 coins: ", osmoUser2Asset1Balance) // Verify asset 1 cw20 contract has expected final total supply @@ -312,8 +313,8 @@ func TestWormchain(t *testing.T) { fmt.Println("Asset1 supply: ", cw20QueryRsp.Data.TotalSupply) totalSupply, err := strconv.ParseUint(cw20QueryRsp.Data.TotalSupply, 10, 64) require.NoError(t, err) - expectedTotalSupply := AmountExternalToGaiaUser1 + AmountExternalToOsmoUser1 + AmountExternalToOsmoUser2 - AmountGaiaUser1ToExternalSimple - AmountGaiaUser1ToExternalCC - require.Equal(t, uint64(expectedTotalSupply), totalSupply) + expectedTotalSupply := AmountExternalToGaiaUser1.Add(AmountExternalToOsmoUser1).Add(AmountExternalToOsmoUser2).Sub(AmountGaiaUser1ToExternalSimple).Sub(AmountGaiaUser1ToExternalCC) + require.Equal(t, expectedTotalSupply.Uint64(), totalSupply) denomsMetadata := helpers.GetDenomsMetadata(t, ctx, wormchain) fmt.Println("Denoms metadata: ", denomsMetadata) diff --git a/wormchain/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/wormchain/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index 4892889e2d..a457303a28 100755 --- a/wormchain/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto +++ b/wormchain/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/wormhole-foundation/wormchain/x/tokenfactory/types"; diff --git a/wormchain/proto/osmosis/tokenfactory/v1beta1/params.proto b/wormchain/proto/osmosis/tokenfactory/v1beta1/params.proto old mode 100755 new mode 100644 index 5fc7df0563..8a662b0ff5 --- a/wormchain/proto/osmosis/tokenfactory/v1beta1/params.proto +++ b/wormchain/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; -import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; -import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/wormhole-foundation/wormchain/x/tokenfactory/types"; @@ -16,10 +14,10 @@ message Params { (gogoproto.nullable) = false ]; - // if denom_creation_fee is an empty array, then this field is used to add more gas consumption - // to the base cost. + // if denom_creation_fee is an empty array, then this field is used to add + // more gas consumption to the base cost. // https://github.com/CosmWasm/token-factory/issues/11 - uint64 denom_creation_gas_consume = 2 [ + uint64 denom_creation_gas_consume = 2 [ (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", (gogoproto.nullable) = true ]; diff --git a/wormchain/proto/osmosis/tokenfactory/v1beta1/query.proto b/wormchain/proto/osmosis/tokenfactory/v1beta1/query.proto index 0366a7d635..81dad2f00f 100755 --- a/wormchain/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/wormchain/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -3,7 +3,6 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "osmosis/tokenfactory/v1beta1/params.proto"; diff --git a/wormchain/proto/osmosis/tokenfactory/v1beta1/tx.proto b/wormchain/proto/osmosis/tokenfactory/v1beta1/tx.proto index 08412c943e..ef524bd01b 100755 --- a/wormchain/proto/osmosis/tokenfactory/v1beta1/tx.proto +++ b/wormchain/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -4,6 +4,9 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/wormhole-foundation/wormchain/x/tokenfactory/types"; @@ -16,6 +19,12 @@ service Msg { rpc SetDenomMetadata(MsgSetDenomMetadata) returns (MsgSetDenomMetadataResponse); rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); + + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgCreateDenom defines the message structure for the CreateDenom gRPC service @@ -106,4 +115,25 @@ message MsgForceTransfer { [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; } -message MsgForceTransferResponse {} \ No newline at end of file +message MsgForceTransferResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/wormchain/proto/ibc-composability-mw/genesis.proto b/wormchain/proto/wormchain/ibc_composability_mw/v1/genesis.proto similarity index 90% rename from wormchain/proto/ibc-composability-mw/genesis.proto rename to wormchain/proto/wormchain/ibc_composability_mw/v1/genesis.proto index a4983a16ba..6aafe58fa6 100644 --- a/wormchain/proto/ibc-composability-mw/genesis.proto +++ b/wormchain/proto/wormchain/ibc_composability_mw/v1/genesis.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.ibc_composability_mw.v1; +package wormchain.ibc_composability_mw.v1; option go_package = "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types"; diff --git a/wormchain/proto/wormhole/config.proto b/wormchain/proto/wormchain/wormhole/config.proto similarity index 75% rename from wormchain/proto/wormhole/config.proto rename to wormchain/proto/wormchain/wormhole/config.proto index ddf62535a7..67752d101b 100644 --- a/wormchain/proto/wormhole/config.proto +++ b/wormchain/proto/wormchain/wormhole/config.proto @@ -1,11 +1,8 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; +package wormchain.wormhole; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; -import "gogoproto/gogo.proto"; - - message Config { uint64 guardian_set_expiration = 1; bytes governance_emitter = 2; diff --git a/wormchain/proto/wormchain/wormhole/consensus_guardian_set_index.proto b/wormchain/proto/wormchain/wormhole/consensus_guardian_set_index.proto new file mode 100644 index 0000000000..8d4881b3a8 --- /dev/null +++ b/wormchain/proto/wormchain/wormhole/consensus_guardian_set_index.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package wormchain.wormhole; + +option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; + +message ConsensusGuardianSetIndex { uint32 index = 1; } diff --git a/wormchain/proto/wormhole/events.proto b/wormchain/proto/wormchain/wormhole/events.proto similarity index 67% rename from wormchain/proto/wormhole/events.proto rename to wormchain/proto/wormchain/wormhole/events.proto index 7e8c3e76d3..8d713ffbc5 100644 --- a/wormchain/proto/wormhole/events.proto +++ b/wormchain/proto/wormchain/wormhole/events.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; +package wormchain.wormhole; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; -message EventGuardianSetUpdate{ +message EventGuardianSetUpdate { uint32 old_index = 1; uint32 new_index = 2; } -message EventPostedMessage{ +message EventPostedMessage { bytes emitter = 1; uint64 sequence = 2; uint32 nonce = 3; @@ -16,12 +16,12 @@ message EventPostedMessage{ bytes payload = 5; } -message EventGuardianRegistered{ +message EventGuardianRegistered { bytes guardian_key = 1; bytes validator_key = 2; } -message EventConsensusSetUpdate{ +message EventConsensusSetUpdate { uint32 old_index = 1; uint32 new_index = 2; } diff --git a/wormchain/proto/wormchain/wormhole/genesis.proto b/wormchain/proto/wormchain/wormhole/genesis.proto new file mode 100644 index 0000000000..6ca96f49ad --- /dev/null +++ b/wormchain/proto/wormchain/wormhole/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package wormchain.wormhole; + +import "wormchain/wormhole/guardian.proto"; +import "wormchain/wormhole/config.proto"; +import "wormchain/wormhole/replay_protection.proto"; +import "wormchain/wormhole/sequence_counter.proto"; +import "wormchain/wormhole/consensus_guardian_set_index.proto"; +// this line is used by starport scaffolding # genesis/proto/import +import "gogoproto/gogo.proto"; + +option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; + +// GenesisState defines the wormhole module's genesis state. +message GenesisState { + repeated GuardianSet guardianSetList = 1 [ (gogoproto.nullable) = false ]; + Config config = 2; + repeated ReplayProtection replayProtectionList = 3 + [ (gogoproto.nullable) = false ]; + repeated SequenceCounter sequenceCounterList = 4 + [ (gogoproto.nullable) = false ]; + ConsensusGuardianSetIndex consensusGuardianSetIndex = 5; + repeated GuardianValidator guardianValidatorList = 6 + [ (gogoproto.nullable) = false ]; + repeated ValidatorAllowedAddress allowedAddresses = 7 + [ (gogoproto.nullable) = false ]; + repeated WasmInstantiateAllowedContractCodeId wasmInstantiateAllowlist = 8 + [ (gogoproto.nullable) = false ]; + IbcComposabilityMwContract ibcComposabilityMwContract = 9 + [ (gogoproto.nullable) = false ]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/wormchain/proto/wormhole/guardian.proto b/wormchain/proto/wormchain/wormhole/guardian.proto similarity index 89% rename from wormchain/proto/wormhole/guardian.proto rename to wormchain/proto/wormchain/wormhole/guardian.proto index 4ad39a5619..1a9d5d2283 100644 --- a/wormchain/proto/wormhole/guardian.proto +++ b/wormchain/proto/wormchain/wormhole/guardian.proto @@ -1,13 +1,11 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; +package wormchain.wormhole; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; import "gogoproto/gogo.proto"; -message GuardianKey { - bytes key = 1; -} +message GuardianKey { bytes key = 1; } message GuardianValidator { bytes guardianKey = 1; @@ -38,6 +36,7 @@ message WasmInstantiateAllowedContractCodeId { } message IbcComposabilityMwContract { - // bech32 address of the contract that is used by the ibc composability middleware + // bech32 address of the contract that is used by the ibc composability + // middleware string contract_address = 1; } diff --git a/wormchain/proto/wormchain/wormhole/query.proto b/wormchain/proto/wormchain/wormhole/query.proto new file mode 100644 index 0000000000..addf7b5e10 --- /dev/null +++ b/wormchain/proto/wormchain/wormhole/query.proto @@ -0,0 +1,235 @@ +syntax = "proto3"; +package wormchain.wormhole; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "wormchain/wormhole/guardian.proto"; +import "wormchain/wormhole/config.proto"; +import "wormchain/wormhole/replay_protection.proto"; +import "wormchain/wormhole/sequence_counter.proto"; +import "wormchain/wormhole/consensus_guardian_set_index.proto"; +// this line is used by starport scaffolding # 1 +import "gogoproto/gogo.proto"; + +option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries a guardianSet by index. + rpc GuardianSet(QueryGetGuardianSetRequest) + returns (QueryGetGuardianSetResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/guardianSet/{index}"; + } + + // Queries a list of guardianSet items. + rpc GuardianSetAll(QueryAllGuardianSetRequest) + returns (QueryAllGuardianSetResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/guardianSet"; + } + + // Queries a config by index. + rpc Config(QueryGetConfigRequest) returns (QueryGetConfigResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/config"; + } + // Queries a replayProtection by index. + rpc ReplayProtection(QueryGetReplayProtectionRequest) + returns (QueryGetReplayProtectionResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/replayProtection/{index}"; + } + + // Queries a list of replayProtection items. + rpc ReplayProtectionAll(QueryAllReplayProtectionRequest) + returns (QueryAllReplayProtectionResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/replayProtection"; + } + + // Queries a sequenceCounter by index. + rpc SequenceCounter(QueryGetSequenceCounterRequest) + returns (QueryGetSequenceCounterResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/sequenceCounter/{index}"; + } + + // Queries a list of sequenceCounter items. + rpc SequenceCounterAll(QueryAllSequenceCounterRequest) + returns (QueryAllSequenceCounterResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/sequenceCounter"; + } + + // Queries a ConsensusGuardianSetIndex by index. + rpc ConsensusGuardianSetIndex(QueryGetConsensusGuardianSetIndexRequest) + returns (QueryGetConsensusGuardianSetIndexResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/consensus_guardian_set_index"; + } + // Queries a GuardianValidator by index. + rpc GuardianValidator(QueryGetGuardianValidatorRequest) + returns (QueryGetGuardianValidatorResponse) { + option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/" + "guardian_validator/{guardianKey}"; + } + + // Queries a list of GuardianValidator items. + rpc GuardianValidatorAll(QueryAllGuardianValidatorRequest) + returns (QueryAllGuardianValidatorResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/guardian_validator"; + } + + // Queries a list of LatestGuardianSetIndex items. + rpc LatestGuardianSetIndex(QueryLatestGuardianSetIndexRequest) + returns (QueryLatestGuardianSetIndexResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/latest_guardian_set_index"; + } + + rpc AllowlistAll(QueryAllValidatorAllowlist) + returns (QueryAllValidatorAllowlistResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/allowlist"; + } + + rpc Allowlist(QueryValidatorAllowlist) + returns (QueryValidatorAllowlistResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/allowlist/{validator_address}"; + } + + rpc IbcComposabilityMwContract(QueryIbcComposabilityMwContractRequest) + returns (QueryIbcComposabilityMwContractResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/ibc_composability_mw_contract"; + } + + rpc WasmInstantiateAllowlistAll(QueryAllWasmInstantiateAllowlist) + returns (QueryAllWasmInstantiateAllowlistResponse) { + option (google.api.http).get = + "/wormhole_foundation/wormchain/wormhole/wasm_instantiate_allowlist"; + } + + // this line is used by starport scaffolding # 2 +} + +message QueryAllValidatorAllowlist { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// all allowlisted entries by all validators +message QueryAllValidatorAllowlistResponse { + repeated ValidatorAllowedAddress allowlist = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryValidatorAllowlist { + string validator_address = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// all allowlisted entries by a specific validator +message QueryValidatorAllowlistResponse { + string validator_address = 1; + repeated ValidatorAllowedAddress allowlist = 2; + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + +message QueryGetGuardianSetRequest { uint32 index = 1; } + +message QueryGetGuardianSetResponse { + GuardianSet GuardianSet = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllGuardianSetRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllGuardianSetResponse { + repeated GuardianSet GuardianSet = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetConfigRequest {} + +message QueryGetConfigResponse { + Config Config = 1 [ (gogoproto.nullable) = false ]; +} +message QueryGetReplayProtectionRequest { string index = 1; } + +message QueryGetReplayProtectionResponse { + ReplayProtection replayProtection = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllReplayProtectionRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllReplayProtectionResponse { + repeated ReplayProtection replayProtection = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetSequenceCounterRequest { string index = 1; } + +message QueryGetSequenceCounterResponse { + SequenceCounter sequenceCounter = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllSequenceCounterRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllSequenceCounterResponse { + repeated SequenceCounter sequenceCounter = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetConsensusGuardianSetIndexRequest {} + +message QueryGetConsensusGuardianSetIndexResponse { + ConsensusGuardianSetIndex ConsensusGuardianSetIndex = 1 + [ (gogoproto.nullable) = false ]; +} +message QueryGetGuardianValidatorRequest { bytes guardianKey = 1; } + +message QueryGetGuardianValidatorResponse { + GuardianValidator guardianValidator = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllGuardianValidatorRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllGuardianValidatorResponse { + repeated GuardianValidator guardianValidator = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryLatestGuardianSetIndexRequest {} + +message QueryLatestGuardianSetIndexResponse { + uint32 latestGuardianSetIndex = 1; +} + +message QueryIbcComposabilityMwContractRequest {} + +message QueryIbcComposabilityMwContractResponse { string contractAddress = 1; } + +message QueryAllWasmInstantiateAllowlist { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// all allowlisted entries by all validators +message QueryAllWasmInstantiateAllowlistResponse { + repeated WasmInstantiateAllowedContractCodeId allowlist = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// this line is used by starport scaffolding # 3 diff --git a/wormchain/proto/wormchain/wormhole/replay_protection.proto b/wormchain/proto/wormchain/wormhole/replay_protection.proto new file mode 100644 index 0000000000..48fc103803 --- /dev/null +++ b/wormchain/proto/wormchain/wormhole/replay_protection.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package wormchain.wormhole; + +option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; + +message ReplayProtection { string index = 1; } diff --git a/wormchain/proto/wormhole/sequence_counter.proto b/wormchain/proto/wormchain/wormhole/sequence_counter.proto similarity index 68% rename from wormchain/proto/wormhole/sequence_counter.proto rename to wormchain/proto/wormchain/wormhole/sequence_counter.proto index eb81f4b3f2..9a6550560e 100644 --- a/wormchain/proto/wormhole/sequence_counter.proto +++ b/wormchain/proto/wormchain/wormhole/sequence_counter.proto @@ -1,12 +1,9 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; +package wormchain.wormhole; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - - message SequenceCounter { - string index = 1; + string index = 1; uint64 sequence = 2; } - diff --git a/wormchain/proto/wormhole/tx.proto b/wormchain/proto/wormchain/wormhole/tx.proto similarity index 60% rename from wormchain/proto/wormhole/tx.proto rename to wormchain/proto/wormchain/wormhole/tx.proto index ffaa0213f2..845bd209ab 100644 --- a/wormchain/proto/wormhole/tx.proto +++ b/wormchain/proto/wormchain/wormhole/tx.proto @@ -1,33 +1,48 @@ syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; +package wormchain.wormhole; +import "wormchain/wormhole/guardian.proto"; import "gogoproto/gogo.proto"; -// this line is used by starport scaffolding # proto/tx/import +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; // Msg defines the Msg service. service Msg { - rpc ExecuteGovernanceVAA(MsgExecuteGovernanceVAA) returns (MsgExecuteGovernanceVAAResponse); - rpc RegisterAccountAsGuardian(MsgRegisterAccountAsGuardian) returns (MsgRegisterAccountAsGuardianResponse); + rpc ExecuteGovernanceVAA(MsgExecuteGovernanceVAA) + returns (MsgExecuteGovernanceVAAResponse); + rpc RegisterAccountAsGuardian(MsgRegisterAccountAsGuardian) + returns (MsgRegisterAccountAsGuardianResponse); - rpc CreateAllowlistEntry(MsgCreateAllowlistEntryRequest) returns (MsgAllowlistResponse); - rpc DeleteAllowlistEntry(MsgDeleteAllowlistEntryRequest) returns (MsgAllowlistResponse); + rpc CreateAllowlistEntry(MsgCreateAllowlistEntryRequest) + returns (MsgAllowlistResponse); + rpc DeleteAllowlistEntry(MsgDeleteAllowlistEntryRequest) + returns (MsgAllowlistResponse); // StoreCode to submit Wasm code to the system rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); // Instantiate creates a new smart contract instance for the given code id. rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse); - - rpc AddWasmInstantiateAllowlist(MsgAddWasmInstantiateAllowlist) returns (MsgWasmInstantiateAllowlistResponse); - rpc DeleteWasmInstantiateAllowlist(MsgDeleteWasmInstantiateAllowlist) returns (MsgWasmInstantiateAllowlistResponse); - rpc MigrateContract(MsgMigrateContract) - returns (MsgMigrateContractResponse); + rpc AddWasmInstantiateAllowlist(MsgAddWasmInstantiateAllowlist) + returns (MsgWasmInstantiateAllowlistResponse); + rpc DeleteWasmInstantiateAllowlist(MsgDeleteWasmInstantiateAllowlist) + returns (MsgWasmInstantiateAllowlistResponse); + + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); + + rpc ExecuteGatewayGovernanceVaa(MsgExecuteGatewayGovernanceVaa) + returns (EmptyResponse); - rpc ExecuteGatewayGovernanceVaa(MsgExecuteGatewayGovernanceVaa) returns (EmptyResponse); -// this line is used by starport scaffolding # proto/tx/rpc + // GuardianSetUpdateProposal processes a proposal to update the guardian set + rpc GuardianSetUpdateProposal(MsgGuardianSetUpdateProposal) returns (EmptyResponse); + + // GovernanceWormholeMessageProposal processes a proposal to emit a generic message + rpc GovernanceWormholeMessageProposal(MsgGovernanceWormholeMessageProposal) returns (EmptyResponse); + + // this line is used by starport scaffolding # proto/tx/rpc } message EmptyResponse {} @@ -48,24 +63,21 @@ message MsgDeleteAllowlistEntryRequest { string address = 2; } -message MsgAllowlistResponse { -} +message MsgAllowlistResponse {} message MsgExecuteGovernanceVAA { bytes vaa = 1; string signer = 2; } -message MsgExecuteGovernanceVAAResponse { -} +message MsgExecuteGovernanceVAAResponse {} message MsgRegisterAccountAsGuardian { string signer = 1; bytes signature = 3; } -message MsgRegisterAccountAsGuardianResponse { -} +message MsgRegisterAccountAsGuardianResponse {} // Same as from x/wasmd but with vaa auth message MsgStoreCode { @@ -73,7 +85,8 @@ message MsgStoreCode { string signer = 1; // WASMByteCode can be raw or gzip compressed bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; - // vaa must be governance msg with payload containing sha3 256 hash of `wasm_byte_code` + // vaa must be governance msg with payload containing sha3 256 hash of + // `wasm_byte_code` bytes vaa = 3; } @@ -94,7 +107,8 @@ message MsgInstantiateContract { string label = 4; // Msg json encoded message to be passed to the contract on instantiation bytes msg = 5; - // vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Label), Msg) + // vaa must be governance msg with payload containing keccak256 + // hash(hash(hash(BigEndian(CodeID)), Label), Msg) bytes vaa = 6; } @@ -108,7 +122,8 @@ message MsgInstantiateContractResponse { message MsgAddWasmInstantiateAllowlist { // Signer is the actor that signed the messages string signer = 1; - // Address is the bech32 address of the contract that can call wasm instantiate without a VAA + // Address is the bech32 address of the contract that can call wasm + // instantiate without a VAA string address = 2; // CodeID is the reference to the stored WASM code that can be instantiated uint64 code_id = 3; @@ -117,16 +132,16 @@ message MsgAddWasmInstantiateAllowlist { } message MsgDeleteWasmInstantiateAllowlist { - // signer should be a guardian validator in a current set or future set. - string signer = 1; - // the pair to remove - string address = 2; - uint64 code_id = 3; - // vaa is the WormchainDeleteWasmInstantiateAllowlist governance message - bytes vaa = 4; + // signer should be a guardian validator in a current set or future set. + string signer = 1; + // the pair to remove + string address = 2; + uint64 code_id = 3; + // vaa is the WormchainDeleteWasmInstantiateAllowlist governance message + bytes vaa = 4; } -message MsgWasmInstantiateAllowlistResponse {} +message MsgWasmInstantiateAllowlistResponse {} // MsgMigrateContract runs a code upgrade/ downgrade for a smart contract message MsgMigrateContract { @@ -139,7 +154,8 @@ message MsgMigrateContract { // Msg json encoded message to be passed to the contract on migration bytes msg = 4; - // vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Contract), Msg) + // vaa must be governance msg with payload containing keccak256 + // hash(hash(hash(BigEndian(CodeID)), Contract), Msg) bytes vaa = 6; } @@ -156,4 +172,24 @@ message MsgExecuteGatewayGovernanceVaa { string signer = 1; // vaa must be governance msg with valid module, action, and payload bytes vaa = 2; -} \ No newline at end of file +} + +// GuardianSetUpdateProposal defines a guardian set update governance proposal +message MsgGuardianSetUpdateProposal { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + GuardianSet newGuardianSet = 2 [ (gogoproto.nullable) = false ]; +} + +// GovernanceWormholeMessageProposal defines a governance proposal to emit a +// generic message in the governance message format. +message MsgGovernanceWormholeMessageProposal { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint32 action = 2; + bytes module = 3; + uint32 targetChain = 4; + bytes payload = 5; +} diff --git a/wormchain/proto/wormhole/consensus_guardian_set_index.proto b/wormchain/proto/wormhole/consensus_guardian_set_index.proto deleted file mode 100644 index 5886fe16ab..0000000000 --- a/wormchain/proto/wormhole/consensus_guardian_set_index.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -message ConsensusGuardianSetIndex { - uint32 index = 1; - -} diff --git a/wormchain/proto/wormhole/genesis.proto b/wormchain/proto/wormhole/genesis.proto deleted file mode 100644 index 263cd5ecb7..0000000000 --- a/wormchain/proto/wormhole/genesis.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -import "wormhole/guardian.proto"; -import "wormhole/config.proto"; -import "wormhole/replay_protection.proto"; -import "wormhole/sequence_counter.proto"; -import "wormhole/consensus_guardian_set_index.proto"; -// this line is used by starport scaffolding # genesis/proto/import -import "gogoproto/gogo.proto"; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -// GenesisState defines the wormhole module's genesis state. -message GenesisState { - repeated GuardianSet guardianSetList = 1 [(gogoproto.nullable) = false]; - Config config = 2; - repeated ReplayProtection replayProtectionList = 3 [(gogoproto.nullable) = false]; - repeated SequenceCounter sequenceCounterList = 4 [(gogoproto.nullable) = false]; - ConsensusGuardianSetIndex consensusGuardianSetIndex = 5; - repeated GuardianValidator guardianValidatorList = 6 [(gogoproto.nullable) = false]; - repeated ValidatorAllowedAddress allowedAddresses = 7 [(gogoproto.nullable) = false]; - repeated WasmInstantiateAllowedContractCodeId wasmInstantiateAllowlist = 8 [(gogoproto.nullable) = false]; - IbcComposabilityMwContract ibcComposabilityMwContract = 9 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state -} diff --git a/wormchain/proto/wormhole/governance.proto b/wormchain/proto/wormhole/governance.proto deleted file mode 100644 index 59c6fb709b..0000000000 --- a/wormchain/proto/wormhole/governance.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -import "wormhole/guardian.proto"; -import "gogoproto/gogo.proto"; -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -// GuardianSetUpdateProposal defines a guardian set update governance proposal -message GuardianSetUpdateProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - GuardianSet newGuardianSet = 3 [(gogoproto.nullable) = false]; -} - -// GovernanceWormholeMessageProposal defines a governance proposal to emit a generic message in the governance message -// format. -message GovernanceWormholeMessageProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - uint32 action = 3; - bytes module = 4; - uint32 targetChain = 5; - bytes payload = 6; -} diff --git a/wormchain/proto/wormhole/query.proto b/wormchain/proto/wormhole/query.proto deleted file mode 100644 index 8d7e20c15f..0000000000 --- a/wormchain/proto/wormhole/query.proto +++ /dev/null @@ -1,217 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "wormhole/guardian.proto"; -import "wormhole/config.proto"; -import "wormhole/replay_protection.proto"; -import "wormhole/sequence_counter.proto"; -import "wormhole/consensus_guardian_set_index.proto"; -// this line is used by starport scaffolding # 1 -import "gogoproto/gogo.proto"; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -// Query defines the gRPC querier service. -service Query { - // Queries a guardianSet by index. - rpc GuardianSet(QueryGetGuardianSetRequest) returns (QueryGetGuardianSetResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardianSet/{index}"; - } - - // Queries a list of guardianSet items. - rpc GuardianSetAll(QueryAllGuardianSetRequest) returns (QueryAllGuardianSetResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardianSet"; - } - -// Queries a config by index. - rpc Config(QueryGetConfigRequest) returns (QueryGetConfigResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/config"; - } -// Queries a replayProtection by index. - rpc ReplayProtection(QueryGetReplayProtectionRequest) returns (QueryGetReplayProtectionResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/replayProtection/{index}"; - } - - // Queries a list of replayProtection items. - rpc ReplayProtectionAll(QueryAllReplayProtectionRequest) returns (QueryAllReplayProtectionResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/replayProtection"; - } - -// Queries a sequenceCounter by index. - rpc SequenceCounter(QueryGetSequenceCounterRequest) returns (QueryGetSequenceCounterResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/sequenceCounter/{index}"; - } - - // Queries a list of sequenceCounter items. - rpc SequenceCounterAll(QueryAllSequenceCounterRequest) returns (QueryAllSequenceCounterResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/sequenceCounter"; - } - -// Queries a ConsensusGuardianSetIndex by index. - rpc ConsensusGuardianSetIndex(QueryGetConsensusGuardianSetIndexRequest) returns (QueryGetConsensusGuardianSetIndexResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/consensus_guardian_set_index"; - } -// Queries a GuardianValidator by index. - rpc GuardianValidator(QueryGetGuardianValidatorRequest) returns (QueryGetGuardianValidatorResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardian_validator/{guardianKey}"; - } - - // Queries a list of GuardianValidator items. - rpc GuardianValidatorAll(QueryAllGuardianValidatorRequest) returns (QueryAllGuardianValidatorResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardian_validator"; - } - -// Queries a list of LatestGuardianSetIndex items. - rpc LatestGuardianSetIndex(QueryLatestGuardianSetIndexRequest) returns (QueryLatestGuardianSetIndexResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/latest_guardian_set_index"; - } - - rpc AllowlistAll(QueryAllValidatorAllowlist) returns (QueryAllValidatorAllowlistResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist"; - } - - rpc Allowlist(QueryValidatorAllowlist) returns (QueryValidatorAllowlistResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist/{validator_address}"; - } - - rpc IbcComposabilityMwContract(QueryIbcComposabilityMwContractRequest) returns (QueryIbcComposabilityMwContractResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/ibc_composability_mw_contract"; - } - - rpc WasmInstantiateAllowlistAll(QueryAllWasmInstantiateAllowlist) returns (QueryAllWasmInstantiateAllowlistResponse) { - option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/wasm_instantiate_allowlist"; - } - -// this line is used by starport scaffolding # 2 -} - -message QueryAllValidatorAllowlist { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// all allowlisted entries by all validators -message QueryAllValidatorAllowlistResponse { - repeated ValidatorAllowedAddress allowlist = 1; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryValidatorAllowlist { - string validator_address = 1; - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// all allowlisted entries by a specific validator -message QueryValidatorAllowlistResponse { - string validator_address = 1; - repeated ValidatorAllowedAddress allowlist = 2; - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -message QueryGetGuardianSetRequest { - uint32 index = 1; -} - -message QueryGetGuardianSetResponse { - GuardianSet GuardianSet = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllGuardianSetRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllGuardianSetResponse { - repeated GuardianSet GuardianSet = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetConfigRequest {} - -message QueryGetConfigResponse { - Config Config = 1 [(gogoproto.nullable) = false]; -} -message QueryGetReplayProtectionRequest { - string index = 1; - -} - -message QueryGetReplayProtectionResponse { - ReplayProtection replayProtection = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllReplayProtectionRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllReplayProtectionResponse { - repeated ReplayProtection replayProtection = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetSequenceCounterRequest { - string index = 1; - -} - -message QueryGetSequenceCounterResponse { - SequenceCounter sequenceCounter = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllSequenceCounterRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllSequenceCounterResponse { - repeated SequenceCounter sequenceCounter = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetConsensusGuardianSetIndexRequest {} - -message QueryGetConsensusGuardianSetIndexResponse { - ConsensusGuardianSetIndex ConsensusGuardianSetIndex = 1 [(gogoproto.nullable) = false]; -} -message QueryGetGuardianValidatorRequest { - bytes guardianKey = 1; - -} - -message QueryGetGuardianValidatorResponse { - GuardianValidator guardianValidator = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllGuardianValidatorRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllGuardianValidatorResponse { - repeated GuardianValidator guardianValidator = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryLatestGuardianSetIndexRequest { -} - -message QueryLatestGuardianSetIndexResponse { - uint32 latestGuardianSetIndex = 1; -} - -message QueryIbcComposabilityMwContractRequest { -} - -message QueryIbcComposabilityMwContractResponse { - string contractAddress = 1; -} - -message QueryAllWasmInstantiateAllowlist { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// all allowlisted entries by all validators -message QueryAllWasmInstantiateAllowlistResponse { - repeated WasmInstantiateAllowedContractCodeId allowlist = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// this line is used by starport scaffolding # 3 diff --git a/wormchain/proto/wormhole/replay_protection.proto b/wormchain/proto/wormhole/replay_protection.proto deleted file mode 100644 index b9a16fb2d7..0000000000 --- a/wormchain/proto/wormhole/replay_protection.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - - - -message ReplayProtection { - string index = 1; - -} - diff --git a/wormchain/testutil/keeper/wormhole.go b/wormchain/testutil/keeper/wormhole.go index dcc9a80164..134b819871 100644 --- a/wormchain/testutil/keeper/wormhole.go +++ b/wormchain/testutil/keeper/wormhole.go @@ -1,140 +1,45 @@ package keeper import ( - "os" "testing" "time" - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/wormhole-foundation/wormchain/app" - "github.com/wormhole-foundation/wormchain/app/wasm_handlers" - "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormchain/app/apptesting" + wormholekeeper "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" ) -func WormholeKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { - k, _, _, ctx := WormholeKeeperAndWasmd(t) - return k, ctx +func WormholeKeeper(t *testing.T) (*wormholekeeper.Keeper, sdk.Context) { + app, ctx := SetupWormchainAndContext(t) + return &app.WormholeKeeper, ctx } -func WormholeKeeperAndWasmd(t testing.TB) (*keeper.Keeper, wasmkeeper.Keeper, *wasmkeeper.PermissionedKeeper, sdk.Context) { - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, - paramstypes.StoreKey, - capabilitytypes.StoreKey, - types.StoreKey, - wasmtypes.StoreKey, - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, types.MemStoreKey) - maccPerms := map[string][]string{} +func WormholeKeeperAndWasmd(t *testing.T) (*wormholekeeper.Keeper, *wasmkeeper.Keeper, *wasmkeeper.PermissionedKeeper, sdk.Context) { + app, ctx := SetupWormchainAndContext(t) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - stateStore.MountStoreWithDB(keys[authtypes.StoreKey], sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(keys[paramstypes.StoreKey], sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(keys[capabilitytypes.StoreKey], sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(keys[types.StoreKey], sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(keys[wasmtypes.StoreKey], sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memKeys[types.MemStoreKey], sdk.StoreTypeMemory, nil) - stateStore.MountStoreWithDB(tkeys[paramstypes.TStoreKey], sdk.StoreTypeTransient, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - encodingConfig := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) - appCodec := encodingConfig.Marshaler - amino := encodingConfig.Amino - - paramsKeeper := paramskeeper.NewKeeper(appCodec, amino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - paramsKeeper.Subspace(types.ModuleName) - paramsKeeper.Subspace(wasm.ModuleName) - - paramsKeeper.Subspace(authtypes.ModuleName) - subspace_auth, _ := paramsKeeper.GetSubspace(authtypes.ModuleName) - accountKeeper := authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], subspace_auth, authtypes.ProtoBaseAccount, maccPerms, - ) - // this line is used by starport scaffolding # stargate/app/paramSubspace - - subspaceWasmd, _ := paramsKeeper.GetSubspace(wasmtypes.ModuleName) - - bApp := baseapp.NewBaseApp("wormchain", log.NewNopLogger(), db, encodingConfig.TxConfig.TxDecoder()) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(encodingConfig.InterfaceRegistry) - - appapp := &app.App{ - BaseApp: bApp, - } - - k := keeper.NewKeeper( - appCodec, - keys[types.StoreKey], - memKeys[types.MemStoreKey], - accountKeeper, - nil, - ) + wasmGenState := wasmtypes.GenesisState{} + wasmGenState.Params.CodeUploadAccess = wasmtypes.DefaultUploadAccess + wasmGenState.Params.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody + app.GetWasmKeeper().SetParams(ctx, wasmGenState.Params) - supportedFeatures := "iterator,staking,stargate,wormhole" - appapp.WormholeKeeper = *k + return &app.WormholeKeeper, app.GetWasmKeeper(), app.ContractKeeper, ctx +} - appapp.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - scopedWasmKeeper := appapp.CapabilityKeeper.ScopeToModule(wasm.ModuleName) +func SetupWormchainAndContext(t *testing.T) (*app.App, sdk.Context) { + app := apptesting.Setup(t, false, 0) - wasmDir := os.TempDir() - wasmKeeper := wasm.NewKeeper( - appCodec, - keys[wasmtypes.StoreKey], - subspaceWasmd, - accountKeeper, - &wasm_handlers.BankKeeperHandler{}, - &wasm_handlers.StakingKeeperHandler{}, - &wasm_handlers.DistributionKeeperHandler{}, - &wasm_handlers.ChannelKeeperHandler{}, - &wasm_handlers.PortKeeperHandler{}, - scopedWasmKeeper, - &wasm_handlers.ICS20TransferPortSourceHandler{}, - appapp.WormholeKeeper, - appapp.MsgServiceRouter(), - appapp.GRPCQueryRouter(), - wasmDir, - wasm.DefaultWasmConfig(), - supportedFeatures, - wasmkeeper.WithQueryPlugins(keeper.NewCustomQueryHandler(appapp.WormholeKeeper)), - ) - ctx := sdk.NewContext(stateStore, tmproto.Header{ - Time: time.Now(), + ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ChainID: apptesting.SimAppChainID, // The height should be at least 1, because the allowlist antehandler // passes everything at height 0 for gen tx's. Height: 1, - }, false, log.NewNopLogger()) - appapp.MountKVStores(keys) - appapp.MountTransientStores(tkeys) - appapp.MountMemoryStores(memKeys) - - wasmGenState := wasmtypes.GenesisState{} - wasmGenState.Params.CodeUploadAccess = wasmtypes.DefaultUploadAccess - wasmGenState.Params.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody - wasmKeeper.SetParams(ctx, wasmGenState.Params) - permissionedWasmKeeper := wasmkeeper.NewDefaultPermissionKeeper(wasmKeeper) - appapp.WormholeKeeper.SetWasmdKeeper(permissionedWasmKeeper) - k.SetWasmdKeeper(permissionedWasmKeeper) + Time: time.Now(), + }) - return k, wasmKeeper, permissionedWasmKeeper, ctx + return app, ctx } diff --git a/wormchain/testutil/network/network.go b/wormchain/testutil/network/network.go index 195de958f1..2fcb0fac40 100644 --- a/wormchain/testutil/network/network.go +++ b/wormchain/testutil/network/network.go @@ -5,20 +5,18 @@ import ( "testing" "time" + tmdb "github.com/cometbft/cometbft-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/tendermint/spm/cosmoscmd" - tmrand "github.com/tendermint/tendermint/libs/rand" - tmdb "github.com/tendermint/tm-db" "github.com/wormhole-foundation/wormchain/app" + "github.com/wormhole-foundation/wormchain/app/apptesting" ) type ( @@ -38,7 +36,10 @@ func New(t *testing.T, configs ...network.Config) *network.Network { } else { cfg = configs[0] } - net := network.New(t, cfg) + net, err := network.New(t, t.TempDir(), cfg) + if err != nil { + panic(fmt.Sprintf("failed to create network: %s", err)) + } t.Cleanup(net.Cleanup) return net } @@ -46,32 +47,38 @@ func New(t *testing.T, configs ...network.Config) *network.Network { // DefaultConfig will initialize config for the network with custom application, // genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig func DefaultConfig() network.Config { - encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) + encoding := app.MakeEncodingConfig() return network.Config{ Codec: encoding.Marshaler, TxConfig: encoding.TxConfig, LegacyAmino: encoding.Amino, InterfaceRegistry: encoding.InterfaceRegistry, AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: func(val network.Validator) servertypes.Application { + AppConstructor: func(val network.ValidatorI) servertypes.Application { return app.New( - val.Ctx.Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.Ctx.Config.RootDir, 0, + val.GetCtx().Logger, + tmdb.NewMemDB(), + nil, + true, + map[int64]bool{}, + 0, encoding, - simapp.EmptyAppOptions{}, - baseapp.SetPruning(storetypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), - baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), + apptesting.EmptyAppOptions{}, + baseapp.SetChainID(apptesting.SimAppChainID), + baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), + baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), ) }, GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler), TimeoutCommit: 2 * time.Second, - ChainID: "chain-" + tmrand.NewRand().Str(6), + ChainID: apptesting.SimAppChainID, NumValidators: 1, BondDenom: sdk.DefaultBondDenom, MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), - PruningStrategy: storetypes.PruningOptionNothing, + PruningStrategy: pruningtypes.PruningOptionNothing, CleanupDir: true, SigningAlgo: string(hd.Secp256k1Type), KeyringOptions: []keyring.Option{}, diff --git a/wormchain/testutil/simapp/simapp.go b/wormchain/testutil/simapp/simapp.go index fc07df31f8..6070786f8c 100644 --- a/wormchain/testutil/simapp/simapp.go +++ b/wormchain/testutil/simapp/simapp.go @@ -3,26 +3,25 @@ package simapp import ( "time" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/tendermint/spm/cosmoscmd" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - tmdb "github.com/tendermint/tm-db" + tmdb "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/wormhole-foundation/wormchain/app" ) // New creates application instance with in-memory database and disabled logging. -func New(dir string) cosmoscmd.App { +func New() runtime.AppI { db := tmdb.NewMemDB() logger := log.NewNopLogger() - encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) + encoding := app.MakeEncodingConfig() - a := app.New(logger, db, nil, true, map[int64]bool{}, dir, 0, encoding, - simapp.EmptyAppOptions{}) + a := app.New(logger, db, nil, true, map[int64]bool{}, 0, encoding, + nil) // InitChain updates deliverState which is required when app.NewContext is called a.InitChain(abci.RequestInitChain{ ConsensusParams: defaultConsensusParams, @@ -31,8 +30,8 @@ func New(dir string) cosmoscmd.App { return a } -var defaultConsensusParams = &abci.ConsensusParams{ - Block: &abci.BlockParams{ +var defaultConsensusParams = &tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, diff --git a/wormchain/tools/tools.go b/wormchain/tools/tools.go new file mode 100644 index 0000000000..6e7a12d40c --- /dev/null +++ b/wormchain/tools/tools.go @@ -0,0 +1,11 @@ +//go:build tools + +package tools + +import ( + _ "github.com/cosmos/gogoproto/protoc-gen-gocosmos" + _ "github.com/golang/protobuf/protoc-gen-go" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" +) diff --git a/wormchain/ts-sdk/package-lock.json b/wormchain/ts-sdk/package-lock.json index b6136b5ae9..609ed48794 100644 --- a/wormchain/ts-sdk/package-lock.json +++ b/wormchain/ts-sdk/package-lock.json @@ -10,12 +10,10 @@ "license": "ISC", "dependencies": { "@certusone/wormhole-sdk": "^0.2.0", - "@cosmjs/cosmwasm-stargate": "^0.27.1", - "@cosmjs/launchpad": "^0.27.1", - "@cosmjs/math": "^0.27.1", - "@cosmjs/proto-signing": "^0.27.1", - "@cosmjs/stargate": "^0.27.1", - "@cosmjs/tendermint-rpc": "^0.27.1", + "@cosmjs/cosmwasm-stargate": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", "axios": "^0.26.0", "bech32": "^2.0.0", "elliptic": "^6.5.4", @@ -588,281 +586,320 @@ "version": "0.6.8", "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "license": "Apache-2.0", "dependencies": { "@noble/hashes": "^1.0.0", "protobufjs": "^6.8.8" } }, - "node_modules/@cosmjs/amino": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz", - "integrity": "sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA==", - "dependencies": { - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1" - } - }, "node_modules/@cosmjs/cosmwasm-stargate": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.27.1.tgz", - "integrity": "sha512-miEAYH4k0YPHRGmp5NTN93lrMg2opxZjr2d4fpRD8H3VVngP4+uUmiI2aUZpHTejlPjqrSTGQnPyycRVMHEFsw==", - "dependencies": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/proto-signing": "0.27.1", - "@cosmjs/stargate": "0.27.1", - "@cosmjs/tendermint-rpc": "0.27.1", - "@cosmjs/utils": "0.27.1", - "cosmjs-types": "^0.4.0", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz", + "integrity": "sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", - "pako": "^2.0.2", - "protobufjs": "~6.10.2" + "pako": "^2.0.2" } }, - "node_modules/@cosmjs/cosmwasm-stargate/node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" - }, - "node_modules/@cosmjs/cosmwasm-stargate/node_modules/protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "hasInstallScript": true, + "node_modules/@cosmjs/cosmwasm-stargate/node_modules/@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "license": "Apache-2.0", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" } }, - "node_modules/@cosmjs/crypto": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz", - "integrity": "sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg==", + "node_modules/@cosmjs/cosmwasm-stargate/node_modules/@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "license": "Apache-2.0", "dependencies": { - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "bip39": "^3.0.2", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" } }, - "node_modules/@cosmjs/encoding": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz", - "integrity": "sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw==", + "node_modules/@cosmjs/cosmwasm-stargate/node_modules/@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "license": "Apache-2.0", "dependencies": { "base64-js": "^1.3.0", "bech32": "^1.1.4", "readonly-date": "^1.0.0" } }, - "node_modules/@cosmjs/encoding/node_modules/bech32": { + "node_modules/@cosmjs/cosmwasm-stargate/node_modules/@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", + "license": "Apache-2.0" + }, + "node_modules/@cosmjs/cosmwasm-stargate/node_modules/bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" }, "node_modules/@cosmjs/json-rpc": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.1.tgz", - "integrity": "sha512-AKvsllGr6oN5kiroatIeIIxRdCFetLd8LCWV04RRNkoJ2OefDNb46VlWEQ+gI3ay5GgfVjB9qAcfvbJyrcEv+A==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", + "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", + "license": "Apache-2.0", "dependencies": { - "@cosmjs/stream": "0.27.1", + "@cosmjs/stream": "^0.30.1", "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/launchpad": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz", - "integrity": "sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw==", + "node_modules/@cosmjs/math": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", + "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", + "license": "Apache-2.0", "dependencies": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" + "bn.js": "^5.2.0" } }, - "node_modules/@cosmjs/launchpad/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" + "node_modules/@cosmjs/proto-signing": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", + "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", + "long": "^4.0.0" } }, - "node_modules/@cosmjs/math": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz", - "integrity": "sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ==", + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "license": "Apache-2.0", "dependencies": { - "bn.js": "^5.2.0" + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" } }, - "node_modules/@cosmjs/proto-signing": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.1.tgz", - "integrity": "sha512-t7/VvQivMdM1KgKWai/9ZCEcGFXJtr9Xo0hGcPLTn9wGkh9tmOsUXINYVMsf5D/jWIm1MDPbGCYfdb9V1Od4hw==", - "dependencies": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/math": "0.27.1", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" } }, - "node_modules/@cosmjs/proto-signing/node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" - }, - "node_modules/@cosmjs/proto-signing/node_modules/protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "hasInstallScript": true, + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "license": "Apache-2.0", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" } }, + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", + "license": "Apache-2.0" + }, + "node_modules/@cosmjs/proto-signing/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" + }, "node_modules/@cosmjs/socket": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.1.tgz", - "integrity": "sha512-bKCRsaSXh/TA7efxVCogzS2K3cgC40Ge2itFYmTfgpOE+++52FchCblVCsCYwMNDLS497RP4P0GbeC1VEBToMA==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", + "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", + "license": "Apache-2.0", "dependencies": { - "@cosmjs/stream": "0.27.1", + "@cosmjs/stream": "^0.30.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "node_modules/@cosmjs/stargate": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.1.tgz", - "integrity": "sha512-7hAIyNd6NbhQA51w9mPVyMYw515Hpj0o7SXMaqbc7nxs3hkJNMONQ9RakyMm0U/WeCd6ObcSaPEcdkqbfkc+mg==", - "dependencies": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/proto-signing": "0.27.1", - "@cosmjs/stream": "0.27.1", - "@cosmjs/tendermint-rpc": "0.27.1", - "@cosmjs/utils": "0.27.1", - "cosmjs-types": "^0.4.0", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", + "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", + "license": "Apache-2.0", + "dependencies": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", - "protobufjs": "~6.10.2", + "protobufjs": "~6.11.3", "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/stargate/node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" + } }, - "node_modules/@cosmjs/stargate/node_modules/protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "hasInstallScript": true, + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "license": "Apache-2.0", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" + } + }, + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" } }, + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", + "license": "Apache-2.0" + }, + "node_modules/@cosmjs/stargate/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" + }, "node_modules/@cosmjs/stream": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.1.tgz", - "integrity": "sha512-cEyEAVfXEyuUpKYBeEJrOj8Dp/c+M6a0oGJHxvDdhP5gSsaeCPgQXrh7qZFBiUfu3Brmqd+e/bKZm+068l9bBw==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", + "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", + "license": "Apache-2.0", "dependencies": { "xstream": "^11.14.0" } }, "node_modules/@cosmjs/tendermint-rpc": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.1.tgz", - "integrity": "sha512-eN1NyBYIiFutDNleEaTfvIJ3S3KA1gP45UHaLhSETm8KyiaUqg/b0Mj6sp7J3h4BhgwLq2zn/TDtIn0k5luedg==", - "dependencies": { - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/json-rpc": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/socket": "0.27.1", - "@cosmjs/stream": "0.27.1", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", + "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/json-rpc": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/socket": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" } }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==", + "license": "Apache-2.0" + }, "node_modules/@cosmjs/tendermint-rpc/node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.14.0" } }, - "node_modules/@cosmjs/utils": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz", - "integrity": "sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg==" + "node_modules/@cosmjs/tendermint-rpc/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" }, "node_modules/@ethersproject/abi": { "version": "5.5.0", @@ -1854,9 +1891,16 @@ } }, "node_modules/@noble/hashes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", - "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", + "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", @@ -2807,9 +2851,10 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/cosmjs-types": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", - "integrity": "sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", + "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", + "license": "Apache-2.0", "dependencies": { "long": "^4.0.0", "protobufjs": "~6.11.2" @@ -2934,15 +2979,38 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "license": "MIT", "dependencies": { - "object-keys": "^1.0.12" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/delay": { @@ -3063,6 +3131,27 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -3245,11 +3334,6 @@ "node": "> 0.1.90" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -3334,9 +3418,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -3354,6 +3442,25 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -3401,11 +3508,13 @@ } }, "node_modules/globalthis": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", - "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3419,6 +3528,18 @@ "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.19.4.tgz", "integrity": "sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg==" }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", @@ -3443,6 +3564,42 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -3465,6 +3622,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4853,6 +5022,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -5079,10 +5249,11 @@ } }, "node_modules/protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -5522,6 +5693,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -6087,6 +6259,7 @@ "version": "11.14.0", "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "license": "MIT", "dependencies": { "globalthis": "^1.0.1", "symbol-observable": "^2.0.3" @@ -6555,90 +6728,64 @@ "protobufjs": "^6.8.8" } }, - "@cosmjs/amino": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz", - "integrity": "sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA==", - "requires": { - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1" - } - }, "@cosmjs/cosmwasm-stargate": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.27.1.tgz", - "integrity": "sha512-miEAYH4k0YPHRGmp5NTN93lrMg2opxZjr2d4fpRD8H3VVngP4+uUmiI2aUZpHTejlPjqrSTGQnPyycRVMHEFsw==", - "requires": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/proto-signing": "0.27.1", - "@cosmjs/stargate": "0.27.1", - "@cosmjs/tendermint-rpc": "0.27.1", - "@cosmjs/utils": "0.27.1", - "cosmjs-types": "^0.4.0", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz", + "integrity": "sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A==", + "requires": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", - "pako": "^2.0.2", - "protobufjs": "~6.10.2" + "pako": "^2.0.2" }, "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + "@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "requires": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" + } }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", + "@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" } - } - } - }, - "@cosmjs/crypto": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz", - "integrity": "sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg==", - "requires": { - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "bip39": "^3.0.2", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@cosmjs/encoding": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz", - "integrity": "sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - }, - "dependencies": { + }, + "@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==" + }, "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", @@ -6647,167 +6794,214 @@ } }, "@cosmjs/json-rpc": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.1.tgz", - "integrity": "sha512-AKvsllGr6oN5kiroatIeIIxRdCFetLd8LCWV04RRNkoJ2OefDNb46VlWEQ+gI3ay5GgfVjB9qAcfvbJyrcEv+A==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz", + "integrity": "sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==", "requires": { - "@cosmjs/stream": "0.27.1", + "@cosmjs/stream": "^0.30.1", "xstream": "^11.14.0" } }, - "@cosmjs/launchpad": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz", - "integrity": "sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw==", - "requires": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/utils": "0.27.1", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - } - } - }, "@cosmjs/math": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz", - "integrity": "sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz", + "integrity": "sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q==", "requires": { "bn.js": "^5.2.0" } }, "@cosmjs/proto-signing": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.1.tgz", - "integrity": "sha512-t7/VvQivMdM1KgKWai/9ZCEcGFXJtr9Xo0hGcPLTn9wGkh9tmOsUXINYVMsf5D/jWIm1MDPbGCYfdb9V1Od4hw==", - "requires": { - "@cosmjs/amino": "0.27.1", - "@cosmjs/crypto": "0.27.1", - "@cosmjs/math": "0.27.1", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz", + "integrity": "sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ==", + "requires": { + "@cosmjs/amino": "^0.30.1", + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", + "long": "^4.0.0" }, "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + "@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "requires": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" + } }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", + "@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" } + }, + "@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==" + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" } } }, "@cosmjs/socket": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.1.tgz", - "integrity": "sha512-bKCRsaSXh/TA7efxVCogzS2K3cgC40Ge2itFYmTfgpOE+++52FchCblVCsCYwMNDLS497RP4P0GbeC1VEBToMA==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz", + "integrity": "sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow==", "requires": { - "@cosmjs/stream": "0.27.1", + "@cosmjs/stream": "^0.30.1", "isomorphic-ws": "^4.0.1", "ws": "^7", "xstream": "^11.14.0" } }, "@cosmjs/stargate": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.1.tgz", - "integrity": "sha512-7hAIyNd6NbhQA51w9mPVyMYw515Hpj0o7SXMaqbc7nxs3hkJNMONQ9RakyMm0U/WeCd6ObcSaPEcdkqbfkc+mg==", - "requires": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/proto-signing": "0.27.1", - "@cosmjs/stream": "0.27.1", - "@cosmjs/tendermint-rpc": "0.27.1", - "@cosmjs/utils": "0.27.1", - "cosmjs-types": "^0.4.0", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz", + "integrity": "sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog==", + "requires": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/tendermint-rpc": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "cosmjs-types": "^0.7.1", "long": "^4.0.0", - "protobufjs": "~6.10.2", + "protobufjs": "~6.11.3", "xstream": "^11.14.0" }, "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + "@cosmjs/amino": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz", + "integrity": "sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w==", + "requires": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1" + } + }, + "@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "requires": { + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" + } }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", + "@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" } + }, + "@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==" + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" } } }, "@cosmjs/stream": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.1.tgz", - "integrity": "sha512-cEyEAVfXEyuUpKYBeEJrOj8Dp/c+M6a0oGJHxvDdhP5gSsaeCPgQXrh7qZFBiUfu3Brmqd+e/bKZm+068l9bBw==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz", + "integrity": "sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==", "requires": { "xstream": "^11.14.0" } }, "@cosmjs/tendermint-rpc": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.1.tgz", - "integrity": "sha512-eN1NyBYIiFutDNleEaTfvIJ3S3KA1gP45UHaLhSETm8KyiaUqg/b0Mj6sp7J3h4BhgwLq2zn/TDtIn0k5luedg==", - "requires": { - "@cosmjs/crypto": "0.27.1", - "@cosmjs/encoding": "0.27.1", - "@cosmjs/json-rpc": "0.27.1", - "@cosmjs/math": "0.27.1", - "@cosmjs/socket": "0.27.1", - "@cosmjs/stream": "0.27.1", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz", + "integrity": "sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ==", + "requires": { + "@cosmjs/crypto": "^0.30.1", + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/json-rpc": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/socket": "^0.30.1", + "@cosmjs/stream": "^0.30.1", + "@cosmjs/utils": "^0.30.1", "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" }, "dependencies": { + "@cosmjs/crypto": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz", + "integrity": "sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ==", + "requires": { + "@cosmjs/encoding": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/utils": "^0.30.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers": "^0.7.6" + } + }, + "@cosmjs/encoding": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz", + "integrity": "sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/utils": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz", + "integrity": "sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g==" + }, "axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -6815,14 +7009,14 @@ "requires": { "follow-redirects": "^1.14.0" } + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" } } }, - "@cosmjs/utils": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz", - "integrity": "sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg==" - }, "@ethersproject/abi": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", @@ -7444,9 +7638,9 @@ } }, "@noble/hashes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", - "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", + "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==" }, "@protobufjs/aspromise": { "version": "1.1.2", @@ -8234,9 +8428,9 @@ } }, "cosmjs-types": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", - "integrity": "sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz", + "integrity": "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA==", "requires": { "long": "^4.0.0", "protobufjs": "~6.11.2" @@ -8343,12 +8537,24 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "requires": { - "object-keys": "^1.0.12" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "delay": { @@ -8440,6 +8646,19 @@ "is-arrayish": "^0.2.1" } }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -8569,11 +8788,6 @@ "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -8631,9 +8845,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "gensync": { "version": "1.0.0-beta.2", @@ -8645,6 +8859,18 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -8674,11 +8900,12 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "globalthis": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", - "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "requires": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" } }, "google-protobuf": { @@ -8686,6 +8913,14 @@ "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.19.4.tgz", "integrity": "sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg==" }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", @@ -8704,6 +8939,24 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -8723,6 +8976,14 @@ "minimalistic-assert": "^1.0.1" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -9947,9 +10208,9 @@ } }, "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", diff --git a/wormchain/ts-sdk/package.json b/wormchain/ts-sdk/package.json index 13bfda2303..6cd13631b5 100644 --- a/wormchain/ts-sdk/package.json +++ b/wormchain/ts-sdk/package.json @@ -8,8 +8,8 @@ ], "scripts": { "test": "jest --config jestconfig.json --verbose", - "build": "npm run genTypes && tsc", - "genTypes": "echo \"disabled: node src/buildHelper.cjs\"" + "build": "npm run genTypes && NODE_OPTIONS=--max-old-space-size=8192 npx tsc", + "genTypes": "node src/buildHelper.cjs" }, "repository": { "type": "git", @@ -23,12 +23,10 @@ "homepage": "https://github.com/wormhole-foundation/wormchain#readme", "dependencies": { "@certusone/wormhole-sdk": "^0.2.0", - "@cosmjs/cosmwasm-stargate": "^0.27.1", - "@cosmjs/launchpad": "^0.27.1", - "@cosmjs/math": "^0.27.1", - "@cosmjs/proto-signing": "^0.27.1", - "@cosmjs/stargate": "^0.27.1", - "@cosmjs/tendermint-rpc": "^0.27.1", + "@cosmjs/cosmwasm-stargate": "^0.30.1", + "@cosmjs/math": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", "axios": "^0.26.0", "bech32": "^2.0.0", "elliptic": "^6.5.4", diff --git a/wormchain/ts-sdk/src/buildHelper.cjs b/wormchain/ts-sdk/src/buildHelper.cjs index 3f3dcfa96b..7636bead92 100644 --- a/wormchain/ts-sdk/src/buildHelper.cjs +++ b/wormchain/ts-sdk/src/buildHelper.cjs @@ -6,10 +6,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); const path = require("path"); -const CERTUS_DIRECTORY = - "../vue/src/store/generated/wormhole-foundation/wormchain/"; -const COSMOS_DIRECTORY = "../vue/src/store/generated/cosmos/cosmos-sdk/"; -const WASMD_DIRECTORY = "../vue/src/store/generated/CosmWasm/wasmd/"; +const TS_CLIENT_DIRECTORY = "../ts-client/"; const MODULE_DIRECTORY = "../ts-sdk/src/modules/"; function execWrapper(command) { @@ -28,36 +25,18 @@ function execWrapper(command) { }); } -const certusFiles = fs.readdirSync(CERTUS_DIRECTORY, { withFileTypes: true }); //should only contain directories for the modules -const cosmosFiles = fs.readdirSync(COSMOS_DIRECTORY, { withFileTypes: true }); -const wasmdFiles = fs.readdirSync(WASMD_DIRECTORY, { withFileTypes: true }); +const clientFiles = fs.readdirSync(TS_CLIENT_DIRECTORY, { withFileTypes: true }); -certusFiles.forEach((directory) => { - execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`); - execWrapper( - `cp -R ${CERTUS_DIRECTORY + directory.name}/module/* ${ - MODULE_DIRECTORY + directory.name - }/` - ); //move all the files from the vue module into the sdk -}); - -cosmosFiles.forEach((directory) => { - execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`); - execWrapper( - `cp -R ${COSMOS_DIRECTORY + directory.name}/module/* ${ - MODULE_DIRECTORY + directory.name - }/` - ); //move all the files from the vue module into the sdk -}); - -wasmdFiles.forEach((directory) => { - execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`); - execWrapper( - `cp -R ${WASMD_DIRECTORY + directory.name}/module/* ${ - MODULE_DIRECTORY + directory.name - }/` - ); //move all the files from the vue module into the sdk -}); +// Move all module directories from Ignite's ts-client to the ts-sdk +clientFiles + .filter(directory => directory.isDirectory()) + .forEach((directory) => { + execWrapper(`mkdir -p ${MODULE_DIRECTORY + directory.name}/`); + execWrapper( + `cp -R ${TS_CLIENT_DIRECTORY + directory.name}/* ${MODULE_DIRECTORY + directory.name + }/` + ); + }); //As of 19.5 javascript isn't emitted //execWrapper(`find ${MODULE_DIRECTORY} -name "*.js" | xargs rm `); //delete all javascript files, so they can be cleanly created based on our tsconfig diff --git a/wormchain/ts-sdk/src/core/queryClient.ts b/wormchain/ts-sdk/src/core/queryClient.ts index 51ab810033..5d3ee47d84 100644 --- a/wormchain/ts-sdk/src/core/queryClient.ts +++ b/wormchain/ts-sdk/src/core/queryClient.ts @@ -14,7 +14,8 @@ import { Api as txApi } from "../modules/cosmos.tx.v1beta1/rest"; import { Api as upgradeApi } from "../modules/cosmos.upgrade.v1beta1/rest"; import { Api as vestingApi } from "../modules/cosmos.vesting.v1beta1/rest"; import { Api as wasmApi } from "../modules/cosmwasm.wasm.v1/rest"; -import { Api as coreApi } from "../modules/wormhole_foundation.wormchain.wormhole/rest"; +import { Api as coreApi } from "../modules/wormchain.wormhole/rest"; + export type WormchainQueryClient = { core: coreApi; @@ -45,23 +46,24 @@ export function getWormholeQueryClient( //@ts-ignore globalThis.fetch = fetch; } - const core = new coreApi({ baseUrl: lcdAddress }); - const auth = new authApi({ baseUrl: lcdAddress }); - const bank = new bankApi({ baseUrl: lcdAddress }); - const base = new baseApi({ baseUrl: lcdAddress }); - const crisis = new crisisApi({ baseUrl: lcdAddress }); - const distribution = new distributionApi({ baseUrl: lcdAddress }); - const evidence = new evidenceApi({ baseUrl: lcdAddress }); - const feegrant = new feegrantApi({ baseUrl: lcdAddress }); - const gov = new govApi({ baseUrl: lcdAddress }); - const mint = new mintApi({ baseUrl: lcdAddress }); - const params = new paramsApi({ baseUrl: lcdAddress }); - const slashing = new slashingApi({ baseUrl: lcdAddress }); - const staking = new stakingApi({ baseUrl: lcdAddress }); - const tx = new txApi({ baseUrl: lcdAddress }); - const upgrade = new upgradeApi({ baseUrl: lcdAddress }); - const vesting = new vestingApi({ baseUrl: lcdAddress }); - const wasm = new wasmApi({ baseUrl: lcdAddress }); + + const core = new coreApi({ baseURL: lcdAddress }); + const auth = new authApi({ baseURL: lcdAddress }); + const bank = new bankApi({ baseURL: lcdAddress }); + const base = new baseApi({ baseURL: lcdAddress }); + const crisis = new crisisApi({ baseURL: lcdAddress }); + const distribution = new distributionApi({ baseURL: lcdAddress }); + const evidence = new evidenceApi({ baseURL: lcdAddress }); + const feegrant = new feegrantApi({ baseURL: lcdAddress }); + const gov = new govApi({ baseURL: lcdAddress }); + const mint = new mintApi({ baseURL: lcdAddress }); + const params = new paramsApi({ baseURL: lcdAddress }); + const slashing = new slashingApi({ baseURL: lcdAddress }); + const staking = new stakingApi({ baseURL: lcdAddress }); + const tx = new txApi({ baseURL: lcdAddress }); + const upgrade = new upgradeApi({ baseURL: lcdAddress }); + const vesting = new vestingApi({ baseURL: lcdAddress }); + const wasm = new wasmApi({ baseURL: lcdAddress }); return { core, diff --git a/wormchain/ts-sdk/src/core/scratch.ts b/wormchain/ts-sdk/src/core/scratch.ts index c6266d9800..107d1e2af5 100644 --- a/wormchain/ts-sdk/src/core/scratch.ts +++ b/wormchain/ts-sdk/src/core/scratch.ts @@ -6,7 +6,6 @@ import { bech32 } from "bech32"; import { coins, DirectSecp256k1HdWallet, - EncodeObject, OfflineSigner, } from "@cosmjs/proto-signing"; import { @@ -22,29 +21,28 @@ import { StargateClient, StdFee, } from "@cosmjs/stargate"; -import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; +import { Tendermint37Client } from "@cosmjs/tendermint-rpc"; import { RpcStatus, - HttpResponse, -} from "../modules/wormhole_foundation.wormchain.wormhole/rest"; +} from "../modules/wormchain.wormhole/rest"; import { txClient, queryClient, -} from "../modules/wormhole_foundation.wormchain.wormhole"; +} from "../modules/wormchain.wormhole"; import { keccak256 } from "ethers/lib/utils"; -import { MsgRegisterAccountAsGuardian } from "../modules/wormhole_foundation.wormchain.wormhole/types/wormhole/tx"; -import { GuardianKey } from "../modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_key"; +import { MsgRegisterAccountAsGuardian } from "../modules/wormchain.wormhole/types/wormchain/wormhole/tx"; +import { AxiosResponse } from "axios"; +import { ADDRESS_PREFIX } from "./consts"; let elliptic = require("elliptic"); //No TS defs? //https://tutorials.cosmos.network/academy/4-my-own-chain/cosmjs.html -const ADDRESS_PREFIX = "wormhole"; const OPERATOR_PREFIX = "wormholevaloper"; export const TENDERMINT_URL = "http://localhost:26658"; export const WORM_DENOM = "uworm"; export const LCD_URL = "http://localhost:1318"; export async function getStargateQueryClient() { - const tmClient = await Tendermint34Client.connect(TENDERMINT_URL); + const tmClient = await Tendermint37Client.connect(TENDERMINT_URL); const client = QueryClient.withExtensions( tmClient, setupTxExtension, @@ -95,10 +93,13 @@ export async function executeGovernanceVAA( ) { const offline: OfflineSigner = wallet; - const client = await txClient(offline, { addr: TENDERMINT_URL }); + const client = await txClient({ signer: offline, addr: TENDERMINT_URL, prefix: ADDRESS_PREFIX }); + const msg = client.msgExecuteGovernanceVAA({ - vaa: new Uint8Array(), - signer: await getAddress(wallet), + value: { + vaa: new Uint8Array(), + signer: await getAddress(wallet), + }, }); //TODO convert type const signingClient = await SigningStargateClient.connectWithSigner( @@ -156,7 +157,7 @@ export async function getGuardianValidatorRegistrations() { } export async function unpackHttpReponse( - response: Promise> + response: Promise> ) { const http = await response; //TODO check rpc status @@ -188,10 +189,12 @@ export async function registerGuardianValidator( }; const offline: OfflineSigner = wallet; - const client = await txClient(offline, { addr: TENDERMINT_URL }); - const msg = client.msgRegisterAccountAsGuardian(args); + const client = await txClient({ signer: offline, addr: TENDERMINT_URL, prefix: ADDRESS_PREFIX }); + const msg = client.msgRegisterAccountAsGuardian({ + value: args + }); - const output = await client.signAndBroadcast([msg]); + const output = await client.sendMsgRegisterAccountAsGuardian(msg); return output; } diff --git a/wormchain/ts-sdk/src/core/signingClient.ts b/wormchain/ts-sdk/src/core/signingClient.ts index 2653a1a098..d7ab8e40d0 100644 --- a/wormchain/ts-sdk/src/core/signingClient.ts +++ b/wormchain/ts-sdk/src/core/signingClient.ts @@ -3,6 +3,7 @@ import { SigningStargateClient, SigningStargateClientOptions, } from "@cosmjs/stargate"; +import { Tendermint37Client } from "@cosmjs/tendermint-rpc"; import * as authModule from "../modules/cosmos.auth.v1beta1"; import * as bankModule from "../modules/cosmos.bank.v1beta1"; import * as baseModule from "../modules/cosmos.base.tendermint.v1beta1"; @@ -19,7 +20,8 @@ import * as txModule from "../modules/cosmos.tx.v1beta1"; import * as upgradeModule from "../modules/cosmos.upgrade.v1beta1"; import * as vestingModule from "../modules/cosmos.vesting.v1beta1"; import * as wasmModule from "../modules/cosmwasm.wasm.v1"; -import * as coreModule from "../modules/wormhole_foundation.wormchain.wormhole"; +import * as coreModule from "../modules/wormchain.wormhole"; +import { ADDRESS_PREFIX } from "./consts"; //protobuf isn't guaranteed to have long support, which is used by the stargate signing client, //so we're going to use an independent long module and shove it into the globals of protobuf @@ -95,76 +97,112 @@ export const getWormchainSigningClient = async ( ) => { if (!wallet) throw MissingWalletError; - const coreClient = await coreModule.txClient(wallet, { + const coreClient = await coreModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const authClient = await authModule.txClient(wallet, { + const authClient = await authModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const bankClient = await bankModule.txClient(wallet, { + const bankClient = await bankModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const baseClient = await baseModule.txClient(wallet, { + const baseClient = await baseModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const crisisClient = await crisisModule.txClient(wallet, { + const crisisClient = await crisisModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const distributionClient = await distributionModule.txClient(wallet, { + const distributionClient = await distributionModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const evidenceClient = await evidenceModule.txClient(wallet, { + const evidenceClient = await evidenceModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const feegrantClient = await feegrantModule.txClient(wallet, { + const feegrantClient = await feegrantModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const govClient = await govModule.txClient(wallet, { + const govClient = await govModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const mintClient = await mintModule.txClient(wallet, { + const mintClient = await mintModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const paramsClient = await paramsModule.txClient(wallet, { + const paramsClient = await paramsModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const slashingClient = await slashingModule.txClient(wallet, { + const slashingClient = await slashingModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const stakingClient = await stakingModule.txClient(wallet, { + const stakingClient = await stakingModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const txClient = await txModule.txClient(wallet, { + const txClient = await txModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const upgradeClient = await upgradeModule.txClient(wallet, { + const upgradeClient = await upgradeModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const vestingClient = await vestingModule.txClient(wallet, { + const vestingClient = await vestingModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const wasmClient = await wasmModule.txClient(wallet, { + const wasmClient = await wasmModule.txClient({ + signer: wallet, + prefix: ADDRESS_PREFIX, addr: tendermintAddress, }); - const client = await SigningStargateClient.connectWithSigner( - tendermintAddress, + let tendermintClient = await Tendermint37Client.connect(tendermintAddress); + + const client = await SigningStargateClient.createWithSigner( + tendermintClient, wallet, { ...options, diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/module.ts new file mode 100755 index 0000000000..8f26995cf4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/module.ts @@ -0,0 +1,105 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { BaseAccount as typeBaseAccount} from "./types" +import { ModuleAccount as typeModuleAccount} from "./types" +import { ModuleCredential as typeModuleCredential} from "./types" +import { Params as typeParams} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + BaseAccount: getStructure(typeBaseAccount.fromPartial({})), + ModuleAccount: getStructure(typeModuleAccount.fromPartial({})), + ModuleCredential: getStructure(typeModuleCredential.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosAuthV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/rest.ts index a94846644d..109842f801 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/rest.ts @@ -10,6 +10,26 @@ * --------------------------------------------------------------- */ +/** + * Params defines the parameters for the auth module. + */ +export interface Authv1Beta1Params { + /** @format uint64 */ + max_memo_characters?: string; + + /** @format uint64 */ + tx_sig_limit?: string; + + /** @format uint64 */ + tx_size_cost_per_byte?: string; + + /** @format uint64 */ + sig_verify_cost_ed25519?: string; + + /** @format uint64 */ + sig_verify_cost_secp256k1?: string; +} + /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -107,7 +127,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +135,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -134,6 +151,117 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* AddressBytesToStringResponse is the response type for AddressString rpc method. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1AddressBytesToStringResponse { + address_string?: string; +} + +/** +* AddressStringToBytesResponse is the response type for AddressBytes rpc method. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1AddressStringToBytesResponse { + /** @format byte */ + address_bytes?: string; +} + +/** +* BaseAccount defines a base account type. It contains all the necessary fields +for basic account functionality. Any custom account type should extend this +type for additional functionality (e.g. vesting). +*/ +export interface V1Beta1BaseAccount { + address?: string; + + /** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + pub_key?: ProtobufAny; + + /** @format uint64 */ + account_number?: string; + + /** @format uint64 */ + sequence?: string; +} + +/** +* Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1Bech32PrefixResponse { + bech32_prefix?: string; +} + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * message SomeRequest { Foo some_parameter = 1; @@ -190,31 +318,37 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } /** - * Params defines the parameters for the auth module. + * Since: cosmos-sdk 0.46.2 */ -export interface V1Beta1Params { - /** @format uint64 */ - max_memo_characters?: string; - - /** @format uint64 */ - tx_sig_limit?: string; - - /** @format uint64 */ - tx_size_cost_per_byte?: string; +export interface V1Beta1QueryAccountAddressByIDResponse { + account_address?: string; +} - /** @format uint64 */ - sig_verify_cost_ed25519?: string; +/** +* QueryAccountInfoResponse is the Query/AccountInfo response type. - /** @format uint64 */ - sig_verify_cost_secp256k1?: string; +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1QueryAccountInfoResponse { + /** info is the account info which is represented by BaseAccount. */ + info?: V1Beta1BaseAccount; } /** @@ -231,24 +365,100 @@ export interface V1Beta1QueryAccountResponse { Since: cosmos-sdk 0.43 */ export interface V1Beta1QueryAccountsResponse { + /** accounts are the existing accounts */ accounts?: ProtobufAny[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; } +/** + * QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. + */ +export interface V1Beta1QueryModuleAccountByNameResponse { + /** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + account?: ProtobufAny; +} + +/** +* QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1QueryModuleAccountsResponse { + accounts?: ProtobufAny[]; +} + /** * QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: V1Beta1Params; + params?: Authv1Beta1Params; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -258,30 +468,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -289,149 +490,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -442,11 +580,27 @@ export class HttpClient { */ export class Api extends HttpClient { /** - * @description Since: cosmos-sdk 0.43 + * @description Since: cosmos-sdk 0.47 + * + * @tags Query + * @name QueryAccountInfo + * @summary AccountInfo queries account info which is common to all account types. + * @request GET:/cosmos/auth/v1beta1/account_info/{address} + */ + queryAccountInfo = (address: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/account_info/${address}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.43 * * @tags Query * @name QueryAccounts - * @summary Accounts returns all the existing accounts + * @summary Accounts returns all the existing accounts. * @request GET:/cosmos/auth/v1beta1/accounts */ queryAccounts = ( @@ -483,6 +637,103 @@ export class Api extends HttpClient + this.request({ + path: `/cosmos/auth/v1beta1/address_by_id/${id}`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Query + * @name QueryBech32Prefix + * @summary Bech32Prefix queries bech32Prefix + * @request GET:/cosmos/auth/v1beta1/bech32 + */ + queryBech32Prefix = (params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/bech32`, + method: "GET", + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Query + * @name QueryAddressBytesToString + * @summary AddressBytesToString converts Account Address bytes to string + * @request GET:/cosmos/auth/v1beta1/bech32/{address_bytes} + */ + queryAddressBytesToString = (addressBytes: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/bech32/${addressBytes}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Query + * @name QueryAddressStringToBytes + * @summary AddressStringToBytes converts Address string to bytes + * @request GET:/cosmos/auth/v1beta1/bech32/{address_string} + */ + queryAddressStringToBytes = (addressString: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/bech32/${addressString}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Query + * @name QueryModuleAccounts + * @summary ModuleAccounts returns all the existing module accounts. + * @request GET:/cosmos/auth/v1beta1/module_accounts + */ + queryModuleAccounts = (params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/module_accounts`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryModuleAccountByName + * @summary ModuleAccountByName returns the module account info by module name + * @request GET:/cosmos/auth/v1beta1/module_accounts/{name} + */ + queryModuleAccountByName = (name: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/auth/v1beta1/module_accounts/${name}`, + method: "GET", + format: "json", + ...params, + }); + /** * No description * diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types.ts new file mode 100755 index 0000000000..c2aa6fcb82 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { BaseAccount } from "./types/cosmos/auth/v1beta1/auth" +import { ModuleAccount } from "./types/cosmos/auth/v1beta1/auth" +import { ModuleCredential } from "./types/cosmos/auth/v1beta1/auth" +import { Params } from "./types/cosmos/auth/v1beta1/auth" + + +export { + BaseAccount, + ModuleAccount, + ModuleCredential, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts index 482a7856ae..ac3ae19a1d 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; export const protobufPackage = "cosmos.auth.v1beta1"; @@ -13,39 +13,56 @@ export const protobufPackage = "cosmos.auth.v1beta1"; */ export interface BaseAccount { address: string; - pub_key: Any | undefined; - account_number: number; + pubKey: Any | undefined; + accountNumber: number; sequence: number; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - base_account: BaseAccount | undefined; + baseAccount: BaseAccount | undefined; name: string; permissions: string[]; } +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} + /** Params defines the parameters for the auth module. */ export interface Params { - max_memo_characters: number; - tx_sig_limit: number; - tx_size_cost_per_byte: number; - sig_verify_cost_ed25519: number; - sig_verify_cost_secp256k1: number; + maxMemoCharacters: number; + txSigLimit: number; + txSizeCostPerByte: number; + sigVerifyCostEd25519: number; + sigVerifyCostSecp256k1: number; } -const baseBaseAccount: object = { address: "", account_number: 0, sequence: 0 }; +function createBaseBaseAccount(): BaseAccount { + return { address: "", pubKey: undefined, accountNumber: 0, sequence: 0 }; +} export const BaseAccount = { - encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { + encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.account_number !== 0) { - writer.uint32(24).uint64(message.account_number); + if (message.accountNumber !== 0) { + writer.uint32(24).uint64(message.accountNumber); } if (message.sequence !== 0) { writer.uint32(32).uint64(message.sequence); @@ -53,10 +70,10 @@ export const BaseAccount = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseAccount } as BaseAccount; + const message = createBaseBaseAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -64,10 +81,10 @@ export const BaseAccount = { message.address = reader.string(); break; case 2: - message.pub_key = Any.decode(reader, reader.uint32()); + message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.account_number = longToNumber(reader.uint64() as Long); + message.accountNumber = longToNumber(reader.uint64() as Long); break; case 4: message.sequence = longToNumber(reader.uint64() as Long); @@ -81,76 +98,43 @@ export const BaseAccount = { }, fromJSON(object: any): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, + accountNumber: isSet(object.accountNumber) ? Number(object.accountNumber) : 0, + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; }, toJSON(message: BaseAccount): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.account_number !== undefined && - (obj.account_number = message.account_number); - message.sequence !== undefined && (obj.sequence = message.sequence); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.accountNumber !== undefined && (obj.accountNumber = Math.round(message.accountNumber)); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); return obj; }, - fromPartial(object: DeepPartial): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } + fromPartial, I>>(object: I): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ""; + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? Any.fromPartial(object.pubKey) + : undefined; + message.accountNumber = object.accountNumber ?? 0; + message.sequence = object.sequence ?? 0; return message; }, }; -const baseModuleAccount: object = { name: "", permissions: "" }; +function createBaseModuleAccount(): ModuleAccount { + return { baseAccount: undefined, name: "", permissions: [] }; +} export const ModuleAccount = { - encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } if (message.name !== "") { writer.uint32(18).string(message.name); @@ -161,16 +145,15 @@ export const ModuleAccount = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; + const message = createBaseModuleAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); break; case 2: message.name = reader.string(); @@ -187,32 +170,17 @@ export const ModuleAccount = { }, fromJSON(object: any): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(String(e)); - } - } - return message; + return { + baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + name: isSet(object.name) ? String(object.name) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; }, toJSON(message: ModuleAccount): unknown { const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); + message.baseAccount !== undefined + && (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); message.name !== undefined && (obj.name = message.name); if (message.permissions) { obj.permissions = message.permissions.map((e) => e); @@ -222,81 +190,132 @@ export const ModuleAccount = { return obj; }, - fromPartial(object: DeepPartial): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; + fromPartial, I>>(object: I): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = (object.baseAccount !== undefined && object.baseAccount !== null) + ? BaseAccount.fromPartial(object.baseAccount) + : undefined; + message.name = object.name ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +function createBaseModuleCredential(): ModuleCredential { + return { moduleName: "", derivationKeys: [] }; +} + +export const ModuleCredential = { + encode(message: ModuleCredential, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(e); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, -}; -const baseParams: object = { - max_memo_characters: 0, - tx_sig_limit: 0, - tx_size_cost_per_byte: 0, - sig_verify_cost_ed25519: 0, - sig_verify_cost_secp256k1: 0, + fromJSON(object: any): ModuleCredential { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + derivationKeys: Array.isArray(object?.derivationKeys) + ? object.derivationKeys.map((e: any) => bytesFromBase64(e)) + : [], + }; + }, + + toJSON(message: ModuleCredential): unknown { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + if (message.derivationKeys) { + obj.derivationKeys = message.derivationKeys.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.derivationKeys = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ""; + message.derivationKeys = object.derivationKeys?.map((e) => e) || []; + return message; + }, }; +function createBaseParams(): Params { + return { + maxMemoCharacters: 0, + txSigLimit: 0, + txSizeCostPerByte: 0, + sigVerifyCostEd25519: 0, + sigVerifyCostSecp256k1: 0, + }; +} + export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.max_memo_characters !== 0) { - writer.uint32(8).uint64(message.max_memo_characters); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxMemoCharacters !== 0) { + writer.uint32(8).uint64(message.maxMemoCharacters); } - if (message.tx_sig_limit !== 0) { - writer.uint32(16).uint64(message.tx_sig_limit); + if (message.txSigLimit !== 0) { + writer.uint32(16).uint64(message.txSigLimit); } - if (message.tx_size_cost_per_byte !== 0) { - writer.uint32(24).uint64(message.tx_size_cost_per_byte); + if (message.txSizeCostPerByte !== 0) { + writer.uint32(24).uint64(message.txSizeCostPerByte); } - if (message.sig_verify_cost_ed25519 !== 0) { - writer.uint32(32).uint64(message.sig_verify_cost_ed25519); + if (message.sigVerifyCostEd25519 !== 0) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); } - if (message.sig_verify_cost_secp256k1 !== 0) { - writer.uint32(40).uint64(message.sig_verify_cost_secp256k1); + if (message.sigVerifyCostSecp256k1 !== 0) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_memo_characters = longToNumber(reader.uint64() as Long); + message.maxMemoCharacters = longToNumber(reader.uint64() as Long); break; case 2: - message.tx_sig_limit = longToNumber(reader.uint64() as Long); + message.txSigLimit = longToNumber(reader.uint64() as Long); break; case 3: - message.tx_size_cost_per_byte = longToNumber(reader.uint64() as Long); + message.txSizeCostPerByte = longToNumber(reader.uint64() as Long); break; case 4: - message.sig_verify_cost_ed25519 = longToNumber( - reader.uint64() as Long - ); + message.sigVerifyCostEd25519 = longToNumber(reader.uint64() as Long); break; case 5: - message.sig_verify_cost_secp256k1 = longToNumber( - reader.uint64() as Long - ); + message.sigVerifyCostSecp256k1 = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -307,128 +326,92 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = Number(object.max_memo_characters); - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = Number(object.tx_sig_limit); - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = Number(object.tx_size_cost_per_byte); - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = Number(object.sig_verify_cost_ed25519); - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = Number( - object.sig_verify_cost_secp256k1 - ); - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; + return { + maxMemoCharacters: isSet(object.maxMemoCharacters) ? Number(object.maxMemoCharacters) : 0, + txSigLimit: isSet(object.txSigLimit) ? Number(object.txSigLimit) : 0, + txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? Number(object.txSizeCostPerByte) : 0, + sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? Number(object.sigVerifyCostEd25519) : 0, + sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? Number(object.sigVerifyCostSecp256k1) : 0, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.max_memo_characters !== undefined && - (obj.max_memo_characters = message.max_memo_characters); - message.tx_sig_limit !== undefined && - (obj.tx_sig_limit = message.tx_sig_limit); - message.tx_size_cost_per_byte !== undefined && - (obj.tx_size_cost_per_byte = message.tx_size_cost_per_byte); - message.sig_verify_cost_ed25519 !== undefined && - (obj.sig_verify_cost_ed25519 = message.sig_verify_cost_ed25519); - message.sig_verify_cost_secp256k1 !== undefined && - (obj.sig_verify_cost_secp256k1 = message.sig_verify_cost_secp256k1); + message.maxMemoCharacters !== undefined && (obj.maxMemoCharacters = Math.round(message.maxMemoCharacters)); + message.txSigLimit !== undefined && (obj.txSigLimit = Math.round(message.txSigLimit)); + message.txSizeCostPerByte !== undefined && (obj.txSizeCostPerByte = Math.round(message.txSizeCostPerByte)); + message.sigVerifyCostEd25519 !== undefined && (obj.sigVerifyCostEd25519 = Math.round(message.sigVerifyCostEd25519)); + message.sigVerifyCostSecp256k1 !== undefined + && (obj.sigVerifyCostSecp256k1 = Math.round(message.sigVerifyCostSecp256k1)); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = object.max_memo_characters; - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = object.tx_sig_limit; - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - } else { - message.sig_verify_cost_secp256k1 = 0; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.maxMemoCharacters = object.maxMemoCharacters ?? 0; + message.txSigLimit = object.txSigLimit ?? 0; + message.txSizeCostPerByte = object.txSizeCostPerByte ?? 0; + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 ?? 0; + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +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 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -436,7 +419,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts index 308c6cc291..1e8614d0c5 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts @@ -1,23 +1,27 @@ //@ts-nocheck /* eslint-disable */ -import { Params } from "../../../cosmos/auth/v1beta1/auth"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; +import { Params } from "./auth"; export const protobufPackage = "cosmos.auth.v1beta1"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; + /** params defines all the parameters of the module. */ + params: + | Params + | undefined; /** accounts are the accounts present at genesis. */ accounts: Any[]; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { params: undefined, accounts: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -27,11 +31,10 @@ export const GenesisState = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -50,59 +53,44 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromJSON(e)); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromJSON(e)) : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); if (message.accounts) { - obj.accounts = message.accounts.map((e) => - e ? Any.toJSON(e) : undefined - ); + obj.accounts = message.accounts.map((e) => e ? Any.toJSON(e) : undefined); } else { obj.accounts = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.accounts = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts index ff23e46263..bd9039f712 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts @@ -1,12 +1,10 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Params } from "../../../cosmos/auth/v1beta1/auth"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { BaseAccount, Params } from "./auth"; export const protobufPackage = "cosmos.auth.v1beta1"; @@ -45,7 +43,8 @@ export interface QueryAccountResponse { } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -53,23 +52,155 @@ export interface QueryParamsResponse { params: Params | undefined; } -const baseQueryAccountsRequest: object = {}; +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequest { +} + +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponse { + accounts: Any[]; +} + +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} + +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account: Any | undefined; +} + +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequest { +} + +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponse { + bech32Prefix: string; +} + +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequest { + addressBytes: Uint8Array; +} + +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponse { + addressString: string; +} + +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequest { + addressString: string; +} + +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponse { + addressBytes: Uint8Array; +} + +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequest { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + * + * @deprecated + */ + id: number; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + accountId: number; +} + +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponse { + accountAddress: string; +} + +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequest { + /** address is the account address string. */ + address: string; +} + +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponse { + /** info is the account info which is represented by BaseAccount. */ + info: BaseAccount | undefined; +} + +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { pagination: undefined }; +} export const QueryAccountsRequest = { - encode( - message: QueryAccountsRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAccountsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; + const message = createBaseQueryAccountsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -85,59 +216,44 @@ export const QueryAccountsRequest = { }, fromJSON(object: any): QueryAccountsRequest { - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryAccountsRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryAccountsRequest { - const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAccountsResponse: object = {}; +function createBaseQueryAccountsResponse(): QueryAccountsResponse { + return { accounts: [], pagination: undefined }; +} export const QueryAccountsResponse = { - encode( - message: QueryAccountsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.accounts) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAccountsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; + const message = createBaseQueryAccountsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -156,73 +272,50 @@ export const QueryAccountsResponse = { }, fromJSON(object: any): QueryAccountsResponse { - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAccountsResponse): unknown { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map((e) => - e ? Any.toJSON(e) : undefined - ); + obj.accounts = message.accounts.map((e) => e ? Any.toJSON(e) : undefined); } else { obj.accounts = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAccountsResponse { - const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; - message.accounts = []; - if (object.accounts !== undefined && object.accounts !== null) { - for (const e of object.accounts) { - message.accounts.push(Any.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAccountsResponse { + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAccountRequest: object = { address: "" }; +function createBaseQueryAccountRequest(): QueryAccountRequest { + return { address: "" }; +} export const QueryAccountRequest = { - encode( - message: QueryAccountRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAccountRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + const message = createBaseQueryAccountRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -238,13 +331,7 @@ export const QueryAccountRequest = { }, fromJSON(object: any): QueryAccountRequest { - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; + return { address: isSet(object.address) ? String(object.address) : "" }; }, toJSON(message: QueryAccountRequest): unknown { @@ -253,34 +340,29 @@ export const QueryAccountRequest = { return obj; }, - fromPartial(object: DeepPartial): QueryAccountRequest { - const message = { ...baseQueryAccountRequest } as QueryAccountRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } + fromPartial, I>>(object: I): QueryAccountRequest { + const message = createBaseQueryAccountRequest(); + message.address = object.address ?? ""; return message; }, }; -const baseQueryAccountResponse: object = {}; +function createBaseQueryAccountResponse(): QueryAccountResponse { + return { account: undefined }; +} export const QueryAccountResponse = { - encode( - message: QueryAccountResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.account !== undefined) { Any.encode(message.account, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAccountResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + const message = createBaseQueryAccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -296,44 +378,37 @@ export const QueryAccountResponse = { }, fromJSON(object: any): QueryAccountResponse { - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; - if (object.account !== undefined && object.account !== null) { - message.account = Any.fromJSON(object.account); - } else { - message.account = undefined; - } - return message; + return { account: isSet(object.account) ? Any.fromJSON(object.account) : undefined }; }, toJSON(message: QueryAccountResponse): unknown { const obj: any = {}; - message.account !== undefined && - (obj.account = message.account ? Any.toJSON(message.account) : undefined); + message.account !== undefined && (obj.account = message.account ? Any.toJSON(message.account) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryAccountResponse { - const message = { ...baseQueryAccountResponse } as QueryAccountResponse; - if (object.account !== undefined && object.account !== null) { - message.account = Any.fromPartial(object.account); - } else { - message.account = undefined; - } + fromPartial, I>>(object: I): QueryAccountResponse { + const message = createBaseQueryAccountResponse(); + message.account = (object.account !== undefined && object.account !== null) + ? Any.fromPartial(object.account) + : undefined; return message; }, }; -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -346,8 +421,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -355,29 +429,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -393,102 +466,901 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; +} + +export const QueryModuleAccountsRequest = { + encode(_: QueryModuleAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: QueryParamsResponse): unknown { + fromJSON(_: any): QueryModuleAccountsRequest { + return {}; + }, + + toJSON(_: QueryModuleAccountsRequest): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); + fromPartial, I>>(_: I): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); + return message; + }, +}; + +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { + return { accounts: [] }; +} + +export const QueryModuleAccountsResponse = { + encode(message: QueryModuleAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.accounts) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryModuleAccountsResponse { + return { accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromJSON(e)) : [] }; + }, + + toJSON(message: QueryModuleAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map((e) => e ? Any.toJSON(e) : undefined); } else { - message.params = undefined; + obj.accounts = []; } + return obj; + }, + + fromPartial, I>>(object: I): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Accounts returns all the existing accounts - * - * Since: cosmos-sdk 0.43 - */ - Accounts(request: QueryAccountsRequest): Promise; - /** Account returns account details based on address. */ - Account(request: QueryAccountRequest): Promise; - /** Params queries all parameters. */ - Params(request: QueryParamsRequest): Promise; +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { name: "" }; } -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - Accounts(request: QueryAccountsRequest): Promise { - const data = QueryAccountsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Accounts", - data - ); - return promise.then((data) => - QueryAccountsResponse.decode(new Reader(data)) - ); - } +export const QueryModuleAccountByNameRequest = { + encode(message: QueryModuleAccountByNameRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, - Account(request: QueryAccountRequest): Promise { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Account", - data - ); - return promise.then((data) => - QueryAccountResponse.decode(new Reader(data)) - ); - } + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, - Params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.auth.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); - } + fromJSON(object: any): QueryModuleAccountByNameRequest { + return { name: isSet(object.name) ? String(object.name) : "" }; + }, + + toJSON(message: QueryModuleAccountByNameRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { account: undefined }; } -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; +export const QueryModuleAccountByNameResponse = { + encode(message: QueryModuleAccountByNameResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== undefined) { + Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryModuleAccountByNameResponse { + return { account: isSet(object.account) ? Any.fromJSON(object.account) : undefined }; + }, + + toJSON(message: QueryModuleAccountByNameResponse): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account ? Any.toJSON(message.account) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = (object.account !== undefined && object.account !== null) + ? Any.fromPartial(object.account) + : undefined; + return message; + }, +}; + +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} + +export const Bech32PrefixRequest = { + encode(_: Bech32PrefixRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): Bech32PrefixRequest { + return {}; + }, + + toJSON(_: Bech32PrefixRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, +}; + +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { bech32Prefix: "" }; +} + +export const Bech32PrefixResponse = { + encode(message: Bech32PrefixResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bech32Prefix !== "") { + writer.uint32(10).string(message.bech32Prefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Bech32PrefixResponse { + return { bech32Prefix: isSet(object.bech32Prefix) ? String(object.bech32Prefix) : "" }; + }, + + toJSON(message: Bech32PrefixResponse): unknown { + const obj: any = {}; + message.bech32Prefix !== undefined && (obj.bech32Prefix = message.bech32Prefix); + return obj; + }, + + fromPartial, I>>(object: I): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + message.bech32Prefix = object.bech32Prefix ?? ""; + return message; + }, +}; + +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { addressBytes: new Uint8Array() }; +} + +export const AddressBytesToStringRequest = { + encode(message: AddressBytesToStringRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddressBytesToStringRequest { + return { addressBytes: isSet(object.addressBytes) ? bytesFromBase64(object.addressBytes) : new Uint8Array() }; + }, + + toJSON(message: AddressBytesToStringRequest): unknown { + const obj: any = {}; + message.addressBytes !== undefined + && (obj.addressBytes = base64FromBytes( + message.addressBytes !== undefined ? message.addressBytes : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, +}; + +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { addressString: "" }; +} + +export const AddressBytesToStringResponse = { + encode(message: AddressBytesToStringResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddressBytesToStringResponse { + return { addressString: isSet(object.addressString) ? String(object.addressString) : "" }; + }, + + toJSON(message: AddressBytesToStringResponse): unknown { + const obj: any = {}; + message.addressString !== undefined && (obj.addressString = message.addressString); + return obj; + }, + + fromPartial, I>>(object: I): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + message.addressString = object.addressString ?? ""; + return message; + }, +}; + +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { addressString: "" }; +} + +export const AddressStringToBytesRequest = { + encode(message: AddressStringToBytesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddressStringToBytesRequest { + return { addressString: isSet(object.addressString) ? String(object.addressString) : "" }; + }, + + toJSON(message: AddressStringToBytesRequest): unknown { + const obj: any = {}; + message.addressString !== undefined && (obj.addressString = message.addressString); + return obj; + }, + + fromPartial, I>>(object: I): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + message.addressString = object.addressString ?? ""; + return message; + }, +}; + +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { addressBytes: new Uint8Array() }; +} + +export const AddressStringToBytesResponse = { + encode(message: AddressStringToBytesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddressStringToBytesResponse { + return { addressBytes: isSet(object.addressBytes) ? bytesFromBase64(object.addressBytes) : new Uint8Array() }; + }, + + toJSON(message: AddressStringToBytesResponse): unknown { + const obj: any = {}; + message.addressBytes !== undefined + && (obj.addressBytes = base64FromBytes( + message.addressBytes !== undefined ? message.addressBytes : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, +}; + +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { id: 0, accountId: 0 }; +} + +export const QueryAccountAddressByIDRequest = { + encode(message: QueryAccountAddressByIDRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int64(message.id); + } + if (message.accountId !== 0) { + writer.uint32(16).uint64(message.accountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.int64() as Long); + break; + case 2: + message.accountId = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountAddressByIDRequest { + return { + id: isSet(object.id) ? Number(object.id) : 0, + accountId: isSet(object.accountId) ? Number(object.accountId) : 0, + }; + }, + + toJSON(message: QueryAccountAddressByIDRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = Math.round(message.id)); + message.accountId !== undefined && (obj.accountId = Math.round(message.accountId)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + message.id = object.id ?? 0; + message.accountId = object.accountId ?? 0; + return message; + }, +}; + +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { accountAddress: "" }; +} + +export const QueryAccountAddressByIDResponse = { + encode(message: QueryAccountAddressByIDResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountAddressByIDResponse { + return { accountAddress: isSet(object.accountAddress) ? String(object.accountAddress) : "" }; + }, + + toJSON(message: QueryAccountAddressByIDResponse): unknown { + const obj: any = {}; + message.accountAddress !== undefined && (obj.accountAddress = message.accountAddress); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + message.accountAddress = object.accountAddress ?? ""; + return message; + }, +}; + +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { address: "" }; +} + +export const QueryAccountInfoRequest = { + encode(message: QueryAccountInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountInfoRequest { + return { address: isSet(object.address) ? String(object.address) : "" }; + }, + + toJSON(message: QueryAccountInfoRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial, I>>(object: I): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + message.address = object.address ?? ""; + return message; + }, +}; + +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { info: undefined }; +} + +export const QueryAccountInfoResponse = { + encode(message: QueryAccountInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.info !== undefined) { + BaseAccount.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BaseAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountInfoResponse { + return { info: isSet(object.info) ? BaseAccount.fromJSON(object.info) : undefined }; + }, + + toJSON(message: QueryAccountInfoResponse): unknown { + const obj: any = {}; + message.info !== undefined && (obj.info = message.info ? BaseAccount.toJSON(message.info) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + message.info = (object.info !== undefined && object.info !== null) + ? BaseAccount.fromPartial(object.info) + : undefined; + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Accounts returns all the existing accounts. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.43 + */ + Accounts(request: QueryAccountsRequest): Promise; + /** Account returns account details based on address. */ + Account(request: QueryAccountRequest): Promise; + /** + * AccountAddressByID returns account address based on account number. + * + * Since: cosmos-sdk 0.46.2 + */ + AccountAddressByID(request: QueryAccountAddressByIDRequest): Promise; + /** Params queries all parameters. */ + Params(request: QueryParamsRequest): Promise; + /** + * ModuleAccounts returns all the existing module accounts. + * + * Since: cosmos-sdk 0.46 + */ + ModuleAccounts(request: QueryModuleAccountsRequest): Promise; + /** ModuleAccountByName returns the module account info by module name */ + ModuleAccountByName(request: QueryModuleAccountByNameRequest): Promise; + /** + * Bech32Prefix queries bech32Prefix + * + * Since: cosmos-sdk 0.46 + */ + Bech32Prefix(request: Bech32PrefixRequest): Promise; + /** + * AddressBytesToString converts Account Address bytes to string + * + * Since: cosmos-sdk 0.46 + */ + AddressBytesToString(request: AddressBytesToStringRequest): Promise; + /** + * AddressStringToBytes converts Address string to bytes + * + * Since: cosmos-sdk 0.46 + */ + AddressStringToBytes(request: AddressStringToBytesRequest): Promise; + /** + * AccountInfo queries account info which is common to all account types. + * + * Since: cosmos-sdk 0.47 + */ + AccountInfo(request: QueryAccountInfoRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Accounts = this.Accounts.bind(this); + this.Account = this.Account.bind(this); + this.AccountAddressByID = this.AccountAddressByID.bind(this); + this.Params = this.Params.bind(this); + this.ModuleAccounts = this.ModuleAccounts.bind(this); + this.ModuleAccountByName = this.ModuleAccountByName.bind(this); + this.Bech32Prefix = this.Bech32Prefix.bind(this); + this.AddressBytesToString = this.AddressBytesToString.bind(this); + this.AddressStringToBytes = this.AddressStringToBytes.bind(this); + this.AccountInfo = this.AccountInfo.bind(this); + } + Accounts(request: QueryAccountsRequest): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); + return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data))); + } + + Account(request: QueryAccountRequest): Promise { + const data = QueryAccountRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); + return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data))); + } + + AccountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + const data = QueryAccountAddressByIDRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); + return promise.then((data) => QueryAccountAddressByIDResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + ModuleAccounts(request: QueryModuleAccountsRequest): Promise { + const data = QueryModuleAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); + return promise.then((data) => QueryModuleAccountsResponse.decode(new _m0.Reader(data))); + } + + ModuleAccountByName(request: QueryModuleAccountByNameRequest): Promise { + const data = QueryModuleAccountByNameRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccountByName", data); + return promise.then((data) => QueryModuleAccountByNameResponse.decode(new _m0.Reader(data))); + } + + Bech32Prefix(request: Bech32PrefixRequest): Promise { + const data = Bech32PrefixRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); + return promise.then((data) => Bech32PrefixResponse.decode(new _m0.Reader(data))); + } + + AddressBytesToString(request: AddressBytesToStringRequest): Promise { + const data = AddressBytesToStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); + return promise.then((data) => AddressBytesToStringResponse.decode(new _m0.Reader(data))); + } + + AddressStringToBytes(request: AddressStringToBytesRequest): Promise { + const data = AddressStringToBytesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); + return promise.then((data) => AddressStringToBytesResponse.decode(new _m0.Reader(data))); + } + + AccountInfo(request: QueryAccountInfoRequest): Promise { + const data = QueryAccountInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountInfo", data); + return promise.then((data) => QueryAccountInfoResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/tx.ts new file mode 100644 index 0000000000..8beb834d80 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/tx.ts @@ -0,0 +1,173 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Params } from "./auth"; + +export const protobufPackage = "cosmos.auth.v1beta1"; + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +/** Msg defines the x/auth Msg service. */ +export interface Msg { + /** + * UpdateParams defines a (governance) operation for updating the x/auth module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UpdateParams = this.UpdateParams.bind(this); + } + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/query/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/query/v1/query.ts new file mode 100644 index 0000000000..7539aee060 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos/query/v1/query.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.query.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.auth.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/index.ts index 2023218fcf..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/index.ts @@ -1,64 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; -import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; - - -const types = [ - ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], - ["/cosmos.bank.v1beta1.MsgSend", MsgSend], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgMultiSend: (data: MsgMultiSend): EncodeObject => ({ typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( data ) }), - msgSend: (data: MsgSend): EncodeObject => ({ typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/module.ts new file mode 100755 index 0000000000..3d9e1190ad --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/module.ts @@ -0,0 +1,183 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; +import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; + +import { SendAuthorization as typeSendAuthorization} from "./types" +import { Params as typeParams} from "./types" +import { SendEnabled as typeSendEnabled} from "./types" +import { Input as typeInput} from "./types" +import { Output as typeOutput} from "./types" +import { Supply as typeSupply} from "./types" +import { DenomUnit as typeDenomUnit} from "./types" +import { Metadata as typeMetadata} from "./types" +import { Balance as typeBalance} from "./types" +import { DenomOwner as typeDenomOwner} from "./types" + +export { MsgSend, MsgMultiSend }; + +type sendMsgSendParams = { + value: MsgSend, + fee?: StdFee, + memo?: string +}; + +type sendMsgMultiSendParams = { + value: MsgMultiSend, + fee?: StdFee, + memo?: string +}; + + +type msgSendParams = { + value: MsgSend, +}; + +type msgMultiSendParams = { + value: MsgMultiSend, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSend({ value: MsgSend.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSend: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgMultiSend({ value: MsgMultiSend.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgMultiSend: Could not broadcast Tx: '+ e.message) + } + }, + + + msgSend({ value }: msgSendParams): EncodeObject { + try { + return { typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSend: Could not create message: ' + e.message) + } + }, + + msgMultiSend({ value }: msgMultiSendParams): EncodeObject { + try { + return { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgMultiSend: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + SendAuthorization: getStructure(typeSendAuthorization.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + SendEnabled: getStructure(typeSendEnabled.fromPartial({})), + Input: getStructure(typeInput.fromPartial({})), + Output: getStructure(typeOutput.fromPartial({})), + Supply: getStructure(typeSupply.fromPartial({})), + DenomUnit: getStructure(typeDenomUnit.fromPartial({})), + Metadata: getStructure(typeMetadata.fromPartial({})), + Balance: getStructure(typeBalance.fromPartial({})), + DenomOwner: getStructure(typeDenomOwner.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosBankV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/registry.ts new file mode 100755 index 0000000000..b4d7c289b6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/registry.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; +import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.bank.v1beta1.MsgSend", MsgSend], + ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/rest.ts index 46c9ab8c2c..3bbca3dc98 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/rest.ts @@ -10,6 +10,30 @@ * --------------------------------------------------------------- */ +/** + * Params defines the parameters for the bank module. + */ +export interface Bankv1Beta1Params { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + send_enabled?: Bankv1Beta1SendEnabled[]; + default_send_enabled?: boolean; +} + +/** +* SendEnabled maps coin denom to a send_enabled status (whether a denom is +sendable). +*/ +export interface Bankv1Beta1SendEnabled { + denom?: string; + enabled?: boolean; +} + export interface ProtobufAny { "@type"?: string; } @@ -32,6 +56,21 @@ export interface V1Beta1Coin { amount?: string; } +/** +* DenomOwner defines structure representing an account that owns or holds a +particular denominated token. It contains the account address and account +balance of the denominated token. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1DenomOwner { + /** address defines the address that owns a particular denomination. */ + address?: string; + + /** balance is the balance of the denominated coin for an account. */ + balance?: V1Beta1Coin; +} + /** * DenomUnit represents a struct that describes a given denomination unit of the basic token. @@ -43,12 +82,14 @@ export interface V1Beta1DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). * @format int64 */ exponent?: number; + + /** aliases is a list of string aliases for the given denom */ aliases?: string[]; } @@ -66,6 +107,8 @@ a basic token. */ export interface V1Beta1Metadata { description?: string; + + /** denom_units represents the list of DenomUnit's for a given coin */ denom_units?: V1Beta1DenomUnit[]; /** base represents the base denom (should be the DenomUnit with exponent = 0). */ @@ -77,7 +120,10 @@ export interface V1Beta1Metadata { */ display?: string; - /** Since: cosmos-sdk 0.43 */ + /** + * name defines the name of the token (eg: Cosmos Atom) + * Since: cosmos-sdk 0.43 + */ name?: string; /** @@ -87,6 +133,21 @@ export interface V1Beta1Metadata { * Since: cosmos-sdk 0.43 */ symbol?: string; + + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; } /** @@ -99,6 +160,21 @@ export type V1Beta1MsgMultiSendResponse = object; */ export type V1Beta1MsgSendResponse = object; +/** +* MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgSetSendEnabledResponse = object; + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * Output models transaction outputs. */ @@ -163,21 +239,22 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } -/** - * Params defines the parameters for the bank module. - */ -export interface V1Beta1Params { - send_enabled?: V1Beta1SendEnabled[]; - default_send_enabled?: boolean; -} - /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method. @@ -207,6 +284,18 @@ export interface V1Beta1QueryDenomMetadataResponse { metadata?: V1Beta1Metadata; } +/** +* QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1QueryDenomOwnersResponse { + denom_owners?: V1Beta1DenomOwner[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + /** * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC method. @@ -224,12 +313,40 @@ export interface V1Beta1QueryDenomsMetadataResponse { */ export interface V1Beta1QueryParamsResponse { /** Params defines the parameters for the bank module. */ - params?: V1Beta1Params; + params?: Bankv1Beta1Params; +} + +/** +* QuerySendEnabledResponse defines the RPC response of a SendEnable query. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1QuerySendEnabledResponse { + send_enabled?: Bankv1Beta1SendEnabled[]; + + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: V1Beta1PageResponse; +} + +/** +* QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +querying an account's spendable balance for a specific denom. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1QuerySpendableBalanceByDenomResponse { + /** balance is the balance of the coin. */ + balance?: V1Beta1Coin; } /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying an account's spendable balances. + +Since: cosmos-sdk 0.46 */ export interface V1Beta1QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ @@ -248,6 +365,7 @@ export interface V1Beta1QuerySupplyOfResponse { } export interface V1Beta1QueryTotalSupplyResponse { + /** supply is the supply of the coins */ supply?: V1Beta1Coin[]; /** @@ -258,19 +376,11 @@ export interface V1Beta1QueryTotalSupplyResponse { pagination?: V1Beta1PageResponse; } -/** -* SendEnabled maps coin denom to a send_enabled status (whether a denom is -sendable). -*/ -export interface V1Beta1SendEnabled { - denom?: string; - enabled?: boolean; -} +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -280,30 +390,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -311,149 +412,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -464,7 +502,7 @@ export class HttpClient { */ export class Api extends HttpClient { /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryAllBalances @@ -508,13 +546,42 @@ export class Api extends HttpClient + this.request({ + path: `/cosmos/bank/v1beta1/denom_owners/${denom}`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDenomsMetadata + * @summary DenomsMetadata queries the client metadata for all registered coin +denominations. + * @request GET:/cosmos/bank/v1beta1/denoms_metadata + */ queryDenomsMetadata = ( query?: { "pagination.key"?: string; @@ -566,11 +633,38 @@ export class Api extends HttpClient + this.request({ + path: `/cosmos/bank/v1beta1/send_enabled`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.46 * * @tags Query * @name QuerySpendableBalances - * @summary SpendableBalances queries the spenable balance of all coins for a single + * @summary SpendableBalances queries the spendable balance of all coins for a single account. * @request GET:/cosmos/bank/v1beta1/spendable_balances/{address} */ @@ -594,7 +688,25 @@ account. }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.47 + * + * @tags Query + * @name QuerySpendableBalanceByDenom + * @summary SpendableBalanceByDenom queries the spendable balance of a single denom for +a single account. + * @request GET:/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom + */ + querySpendableBalanceByDenom = (address: string, query?: { denom?: string }, params: RequestParams = {}) => + this.request({ + path: `/cosmos/bank/v1beta1/spendable_balances/${address}/by_denom`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryTotalSupply @@ -620,17 +732,18 @@ account. }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QuerySupplyOf * @summary SupplyOf queries the supply of a single coin. - * @request GET:/cosmos/bank/v1beta1/supply/{denom} + * @request GET:/cosmos/bank/v1beta1/supply/by_denom */ - querySupplyOf = (denom: string, params: RequestParams = {}) => + querySupplyOf = (query?: { denom?: string }, params: RequestParams = {}) => this.request({ - path: `/cosmos/bank/v1beta1/supply/${denom}`, + path: `/cosmos/bank/v1beta1/supply/by_denom`, method: "GET", + query: query, format: "json", ...params, }); diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types.ts new file mode 100755 index 0000000000..cd7bc36b68 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types.ts @@ -0,0 +1,26 @@ +//@ts-nocheck +import { SendAuthorization } from "./types/cosmos/bank/v1beta1/authz" +import { Params } from "./types/cosmos/bank/v1beta1/bank" +import { SendEnabled } from "./types/cosmos/bank/v1beta1/bank" +import { Input } from "./types/cosmos/bank/v1beta1/bank" +import { Output } from "./types/cosmos/bank/v1beta1/bank" +import { Supply } from "./types/cosmos/bank/v1beta1/bank" +import { DenomUnit } from "./types/cosmos/bank/v1beta1/bank" +import { Metadata } from "./types/cosmos/bank/v1beta1/bank" +import { Balance } from "./types/cosmos/bank/v1beta1/genesis" +import { DenomOwner } from "./types/cosmos/bank/v1beta1/query" + + +export { + SendAuthorization, + Params, + SendEnabled, + Input, + Output, + Supply, + DenomUnit, + Metadata, + Balance, + DenomOwner, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts index 15ac85d692..17fe921eb6 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.bank.v1beta1"; @@ -12,29 +12,43 @@ export const protobufPackage = "cosmos.bank.v1beta1"; * Since: cosmos-sdk 0.43 */ export interface SendAuthorization { - spend_limit: Coin[]; + spendLimit: Coin[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allowList: string[]; } -const baseSendAuthorization: object = {}; +function createBaseSendAuthorization(): SendAuthorization { + return { spendLimit: [], allowList: [] }; +} export const SendAuthorization = { - encode(message: SendAuthorization, writer: Writer = Writer.create()): Writer { - for (const v of message.spend_limit) { + encode(message: SendAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.allowList) { + writer.uint32(18).string(v!); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SendAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SendAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; + const message = createBaseSendAuthorization(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.spend_limit.push(Coin.decode(reader, reader.uint32())); + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.allowList.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -45,47 +59,42 @@ export const SendAuthorization = { }, fromJSON(object: any): SendAuthorization { - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromJSON(e)); - } - } - return message; + return { + spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], + allowList: Array.isArray(object?.allowList) ? object.allowList.map((e: any) => String(e)) : [], + }; }, toJSON(message: SendAuthorization): unknown { const obj: any = {}; - if (message.spend_limit) { - obj.spend_limit = message.spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.spendLimit) { + obj.spendLimit = message.spendLimit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.spend_limit = []; + obj.spendLimit = []; + } + if (message.allowList) { + obj.allowList = message.allowList.map((e) => e); + } else { + obj.allowList = []; } return obj; }, - fromPartial(object: DeepPartial): SendAuthorization { - const message = { ...baseSendAuthorization } as SendAuthorization; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SendAuthorization { + const message = createBaseSendAuthorization(); + message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map((e) => e) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts index f60bb6ec47..c6195bc484 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts @@ -1,14 +1,23 @@ //@ts-nocheck /* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.bank.v1beta1"; /** Params defines the parameters for the bank module. */ export interface Params { - send_enabled: SendEnabled[]; - default_send_enabled: boolean; + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + * + * @deprecated + */ + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; } /** @@ -53,7 +62,7 @@ export interface DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -69,7 +78,7 @@ export interface DenomUnit { export interface Metadata { description: string; /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnit[]; + denomUnits: DenomUnit[]; /** base represents the base denom (should be the DenomUnit with exponent = 0). */ base: string; /** @@ -90,36 +99,48 @@ export interface Metadata { * Since: cosmos-sdk 0.43 */ symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; } -const baseParams: object = { default_send_enabled: false }; +function createBaseParams(): Params { + return { sendEnabled: [], defaultSendEnabled: false }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.send_enabled) { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.default_send_enabled === true) { - writer.uint32(16).bool(message.default_send_enabled); + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.send_enabled = []; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.send_enabled.push( - SendEnabled.decode(reader, reader.uint32()) - ); + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); break; case 2: - message.default_send_enabled = reader.bool(); + message.defaultSendEnabled = reader.bool(); break; default: reader.skipType(tag & 7); @@ -130,62 +151,39 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromJSON(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = Boolean(object.default_send_enabled); - } else { - message.default_send_enabled = false; - } - return message; + return { + sendEnabled: Array.isArray(object?.sendEnabled) + ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) + : [], + defaultSendEnabled: isSet(object.defaultSendEnabled) ? Boolean(object.defaultSendEnabled) : false, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - if (message.send_enabled) { - obj.send_enabled = message.send_enabled.map((e) => - e ? SendEnabled.toJSON(e) : undefined - ); + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); } else { - obj.send_enabled = []; + obj.sendEnabled = []; } - message.default_send_enabled !== undefined && - (obj.default_send_enabled = message.default_send_enabled); + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromPartial(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = object.default_send_enabled; - } else { - message.default_send_enabled = false; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; return message; }, }; -const baseSendEnabled: object = { denom: "", enabled: false }; +function createBaseSendEnabled(): SendEnabled { + return { denom: "", enabled: false }; +} export const SendEnabled = { - encode(message: SendEnabled, writer: Writer = Writer.create()): Writer { + encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -195,10 +193,10 @@ export const SendEnabled = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSendEnabled } as SendEnabled; + const message = createBaseSendEnabled(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -217,18 +215,10 @@ export const SendEnabled = { }, fromJSON(object: any): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = Boolean(object.enabled); - } else { - message.enabled = false; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, + }; }, toJSON(message: SendEnabled): unknown { @@ -238,26 +228,20 @@ export const SendEnabled = { return obj; }, - fromPartial(object: DeepPartial): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = object.enabled; - } else { - message.enabled = false; - } + fromPartial, I>>(object: I): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ""; + message.enabled = object.enabled ?? false; return message; }, }; -const baseInput: object = { address: "" }; +function createBaseInput(): Input { + return { address: "", coins: [] }; +} export const Input = { - encode(message: Input, writer: Writer = Writer.create()): Writer { + encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -267,11 +251,10 @@ export const Input = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Input { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Input { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseInput } as Input; - message.coins = []; + const message = createBaseInput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -290,53 +273,37 @@ export const Input = { }, fromJSON(object: any): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Input): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.coins = []; } return obj; }, - fromPartial(object: DeepPartial): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Input { + const message = createBaseInput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseOutput: object = { address: "" }; +function createBaseOutput(): Output { + return { address: "", coins: [] }; +} export const Output = { - encode(message: Output, writer: Writer = Writer.create()): Writer { + encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -346,11 +313,10 @@ export const Output = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Output { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Output { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOutput } as Output; - message.coins = []; + const message = createBaseOutput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -369,64 +335,47 @@ export const Output = { }, fromJSON(object: any): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Output): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.coins = []; } return obj; }, - fromPartial(object: DeepPartial): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Output { + const message = createBaseOutput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseSupply: object = {}; +function createBaseSupply(): Supply { + return { total: [] }; +} export const Supply = { - encode(message: Supply, writer: Writer = Writer.create()): Writer { + encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.total) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Supply { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSupply } as Supply; - message.total = []; + const message = createBaseSupply(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -442,42 +391,32 @@ export const Supply = { }, fromJSON(object: any): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromJSON(e)); - } - } - return message; + return { total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: Supply): unknown { const obj: any = {}; if (message.total) { - obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.total = message.total.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.total = []; } return obj; }, - fromPartial(object: DeepPartial): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Supply { + const message = createBaseSupply(); + message.total = object.total?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" }; +function createBaseDenomUnit(): DenomUnit { + return { denom: "", exponent: 0, aliases: [] }; +} export const DenomUnit = { - encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { + encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -490,11 +429,10 @@ export const DenomUnit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; + const message = createBaseDenomUnit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -516,30 +454,17 @@ export const DenomUnit = { }, fromJSON(object: any): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = Number(object.exponent); - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(String(e)); - } - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + exponent: isSet(object.exponent) ? Number(object.exponent) : 0, + aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => String(e)) : [], + }; }, toJSON(message: DenomUnit): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); - message.exponent !== undefined && (obj.exponent = message.exponent); + message.exponent !== undefined && (obj.exponent = Math.round(message.exponent)); if (message.aliases) { obj.aliases = message.aliases.map((e) => e); } else { @@ -548,42 +473,25 @@ export const DenomUnit = { return obj; }, - fromPartial(object: DeepPartial): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = object.exponent; - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(e); - } - } + fromPartial, I>>(object: I): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ""; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map((e) => e) || []; return message; }, }; -const baseMetadata: object = { - description: "", - base: "", - display: "", - name: "", - symbol: "", -}; +function createBaseMetadata(): Metadata { + return { description: "", denomUnits: [], base: "", display: "", name: "", symbol: "", uri: "", uriHash: "" }; +} export const Metadata = { - encode(message: Metadata, writer: Writer = Writer.create()): Writer { + encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.description !== "") { writer.uint32(10).string(message.description); } - for (const v of message.denom_units) { + for (const v of message.denomUnits) { DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.base !== "") { @@ -598,14 +506,19 @@ export const Metadata = { if (message.symbol !== "") { writer.uint32(50).string(message.symbol); } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; + const message = createBaseMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -613,7 +526,7 @@ export const Metadata = { message.description = reader.string(); break; case 2: - message.denom_units.push(DenomUnit.decode(reader, reader.uint32())); + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); break; case 3: message.base = reader.string(); @@ -627,6 +540,12 @@ export const Metadata = { case 6: message.symbol = reader.string(); break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -636,103 +555,60 @@ export const Metadata = { }, fromJSON(object: any): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromJSON(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = String(object.base); - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = String(object.display); - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = String(object.symbol); - } else { - message.symbol = ""; - } - return message; + return { + description: isSet(object.description) ? String(object.description) : "", + denomUnits: Array.isArray(object?.denomUnits) ? object.denomUnits.map((e: any) => DenomUnit.fromJSON(e)) : [], + base: isSet(object.base) ? String(object.base) : "", + display: isSet(object.display) ? String(object.display) : "", + name: isSet(object.name) ? String(object.name) : "", + symbol: isSet(object.symbol) ? String(object.symbol) : "", + uri: isSet(object.uri) ? String(object.uri) : "", + uriHash: isSet(object.uriHash) ? String(object.uriHash) : "", + }; }, toJSON(message: Metadata): unknown { const obj: any = {}; - message.description !== undefined && - (obj.description = message.description); - if (message.denom_units) { - obj.denom_units = message.denom_units.map((e) => - e ? DenomUnit.toJSON(e) : undefined - ); + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map((e) => e ? DenomUnit.toJSON(e) : undefined); } else { - obj.denom_units = []; + obj.denomUnits = []; } message.base !== undefined && (obj.base = message.base); message.display !== undefined && (obj.display = message.display); message.name !== undefined && (obj.name = message.name); message.symbol !== undefined && (obj.symbol = message.symbol); + message.uri !== undefined && (obj.uri = message.uri); + message.uriHash !== undefined && (obj.uriHash = message.uriHash); return obj; }, - fromPartial(object: DeepPartial): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromPartial(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = object.base; - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = object.display; - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = object.symbol; - } else { - message.symbol = ""; - } + fromPartial, I>>(object: I): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ""; + message.denomUnits = object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ""; + message.display = object.display ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts index 033f1f1242..cb0262c6b1 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts @@ -1,15 +1,17 @@ //@ts-nocheck /* eslint-disable */ -import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; +import { Metadata, Params, SendEnabled } from "./bank"; export const protobufPackage = "cosmos.bank.v1beta1"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; + /** params defines all the parameters of the module. */ + params: + | Params + | undefined; /** balances is an array containing the balances of all the accounts. */ balances: Balance[]; /** @@ -17,8 +19,14 @@ export interface GenesisState { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: Coin[]; - /** denom_metadata defines the metadata of the differents coins. */ - denom_metadata: Metadata[]; + /** denom_metadata defines the metadata of the different coins. */ + denomMetadata: Metadata[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled: SendEnabled[]; } /** @@ -32,10 +40,12 @@ export interface Balance { coins: Coin[]; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { params: undefined, balances: [], supply: [], denomMetadata: [], sendEnabled: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -45,19 +55,19 @@ export const GenesisState = { for (const v of message.supply) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.denom_metadata) { + for (const v of message.denomMetadata) { Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(42).fork()).ldelim(); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,7 +81,10 @@ export const GenesisState = { message.supply.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.denom_metadata.push(Metadata.decode(reader, reader.uint32())); + message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); + break; + case 5: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -82,92 +95,64 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Balance.fromJSON(e)); - } - } - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromJSON(e)); - } - } - if (object.denom_metadata !== undefined && object.denom_metadata !== null) { - for (const e of object.denom_metadata) { - message.denom_metadata.push(Metadata.fromJSON(e)); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromJSON(e)) : [], + supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromJSON(e)) : [], + denomMetadata: Array.isArray(object?.denomMetadata) + ? object.denomMetadata.map((e: any) => Metadata.fromJSON(e)) + : [], + sendEnabled: Array.isArray(object?.sendEnabled) + ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) + : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); if (message.balances) { - obj.balances = message.balances.map((e) => - e ? Balance.toJSON(e) : undefined - ); + obj.balances = message.balances.map((e) => e ? Balance.toJSON(e) : undefined); } else { obj.balances = []; } if (message.supply) { - obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.supply = message.supply.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.supply = []; } - if (message.denom_metadata) { - obj.denom_metadata = message.denom_metadata.map((e) => - e ? Metadata.toJSON(e) : undefined - ); + if (message.denomMetadata) { + obj.denomMetadata = message.denomMetadata.map((e) => e ? Metadata.toJSON(e) : undefined); } else { - obj.denom_metadata = []; + obj.denomMetadata = []; + } + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.balances = []; - message.supply = []; - message.denom_metadata = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Balance.fromPartial(e)); - } - } - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromPartial(e)); - } - } - if (object.denom_metadata !== undefined && object.denom_metadata !== null) { - for (const e of object.denom_metadata) { - message.denom_metadata.push(Metadata.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.balances = object.balances?.map((e) => Balance.fromPartial(e)) || []; + message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || []; + message.denomMetadata = object.denomMetadata?.map((e) => Metadata.fromPartial(e)) || []; + message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; return message; }, }; -const baseBalance: object = { address: "" }; +function createBaseBalance(): Balance { + return { address: "", coins: [] }; +} export const Balance = { - encode(message: Balance, writer: Writer = Writer.create()): Writer { + encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -177,11 +162,10 @@ export const Balance = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Balance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBalance } as Balance; - message.coins = []; + const message = createBaseBalance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -200,56 +184,42 @@ export const Balance = { }, fromJSON(object: any): Balance { - const message = { ...baseBalance } as Balance; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Balance): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.coins = []; } return obj; }, - fromPartial(object: DeepPartial): Balance { - const message = { ...baseBalance } as Balance; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Balance { + const message = createBaseBalance(); + message.address = object.address ?? ""; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts index 1d2847303b..80d40acafc 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts @@ -1,12 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Coin } from "../../base/v1beta1/coin"; +import { Metadata, Params, SendEnabled } from "./bank"; export const protobufPackage = "cosmos.bank.v1beta1"; @@ -46,6 +43,8 @@ export interface QueryAllBalancesResponse { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequest { /** address is the address to query spendable balances for. */ @@ -57,6 +56,8 @@ export interface QuerySpendableBalancesRequest { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ @@ -65,6 +66,30 @@ export interface QuerySpendableBalancesResponse { pagination: PageResponse | undefined; } +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} + +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponse { + /** balance is the balance of the coin. */ + balance: Coin | undefined; +} + /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC * method. @@ -106,7 +131,8 @@ export interface QuerySupplyOfResponse { } /** QueryParamsRequest defines the request type for querying x/bank parameters. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponse { @@ -145,13 +171,78 @@ export interface QueryDenomMetadataResponse { metadata: Metadata | undefined; } -const baseQueryBalanceRequest: object = { address: "", denom: "" }; +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequest { + /** denom defines the coin denomination to query all account holders for. */ + denom: string; + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwner { + /** address defines the address that owns a particular denomination. */ + address: string; + /** balance is the balance of the denominated coin for an account. */ + balance: Coin | undefined; +} + +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequest { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination: PageRequest | undefined; +} + +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponse { + sendEnabled: SendEnabled[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination: PageResponse | undefined; +} + +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { address: "", denom: "" }; +} export const QueryBalanceRequest = { - encode( - message: QueryBalanceRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -161,10 +252,10 @@ export const QueryBalanceRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -183,18 +274,10 @@ export const QueryBalanceRequest = { }, fromJSON(object: any): QueryBalanceRequest { - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + }; }, toJSON(message: QueryBalanceRequest): unknown { @@ -204,39 +287,30 @@ export const QueryBalanceRequest = { return obj; }, - fromPartial(object: DeepPartial): QueryBalanceRequest { - const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } + fromPartial, I>>(object: I): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; return message; }, }; -const baseQueryBalanceResponse: object = {}; +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { balance: undefined }; +} export const QueryBalanceResponse = { - encode( - message: QueryBalanceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -252,42 +326,30 @@ export const QueryBalanceResponse = { }, fromJSON(object: any): QueryBalanceResponse { - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromJSON(object.balance); - } else { - message.balance = undefined; - } - return message; + return { balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined }; }, toJSON(message: QueryBalanceResponse): unknown { const obj: any = {}; - message.balance !== undefined && - (obj.balance = message.balance - ? Coin.toJSON(message.balance) - : undefined); + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryBalanceResponse { - const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromPartial(object.balance); - } else { - message.balance = undefined; - } + fromPartial, I>>(object: I): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.balance = (object.balance !== undefined && object.balance !== null) + ? Coin.fromPartial(object.balance) + : undefined; return message; }, }; -const baseQueryAllBalancesRequest: object = { address: "" }; +function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { + return { address: "", pagination: undefined }; +} export const QueryAllBalancesRequest = { - encode( - message: QueryAllBalancesRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -297,12 +359,10 @@ export const QueryAllBalancesRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; + const message = createBaseQueryAllBalancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -321,81 +381,49 @@ export const QueryAllBalancesRequest = { }, fromJSON(object: any): QueryAllBalancesRequest { - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllBalancesRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllBalancesRequest { - const message = { - ...baseQueryAllBalancesRequest, - } as QueryAllBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllBalancesRequest { + const message = createBaseQueryAllBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllBalancesResponse: object = {}; +function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { + return { balances: [], pagination: undefined }; +} export const QueryAllBalancesResponse = { - encode( - message: QueryAllBalancesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllBalancesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; + const message = createBaseQueryAllBalancesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -414,67 +442,40 @@ export const QueryAllBalancesResponse = { }, fromJSON(object: any): QueryAllBalancesResponse { - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllBalancesResponse): unknown { const obj: any = {}; if (message.balances) { - obj.balances = message.balances.map((e) => - e ? Coin.toJSON(e) : undefined - ); + obj.balances = message.balances.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.balances = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllBalancesResponse { - const message = { - ...baseQueryAllBalancesResponse, - } as QueryAllBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQuerySpendableBalancesRequest: object = { address: "" }; +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { + return { address: "", pagination: undefined }; +} export const QuerySpendableBalancesRequest = { - encode( - message: QuerySpendableBalancesRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySpendableBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -484,15 +485,10 @@ export const QuerySpendableBalancesRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySpendableBalancesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySpendableBalancesRequest, - } as QuerySpendableBalancesRequest; + const message = createBaseQuerySpendableBalancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -511,81 +507,51 @@ export const QuerySpendableBalancesRequest = { }, fromJSON(object: any): QuerySpendableBalancesRequest { - const message = { - ...baseQuerySpendableBalancesRequest, - } as QuerySpendableBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QuerySpendableBalancesRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QuerySpendableBalancesRequest { - const message = { - ...baseQuerySpendableBalancesRequest, - } as QuerySpendableBalancesRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQuerySpendableBalancesResponse: object = {}; +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { balances: [], pagination: undefined }; +} export const QuerySpendableBalancesResponse = { - encode( - message: QuerySpendableBalancesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySpendableBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySpendableBalancesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySpendableBalancesResponse, - } as QuerySpendableBalancesResponse; - message.balances = []; + const message = createBaseQuerySpendableBalancesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -604,79 +570,163 @@ export const QuerySpendableBalancesResponse = { }, fromJSON(object: any): QuerySpendableBalancesResponse { - const message = { - ...baseQuerySpendableBalancesResponse, - } as QuerySpendableBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QuerySpendableBalancesResponse): unknown { const obj: any = {}; if (message.balances) { - obj.balances = message.balances.map((e) => - e ? Coin.toJSON(e) : undefined - ); + obj.balances = message.balances.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.balances = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QuerySpendableBalancesResponse { - const message = { - ...baseQuerySpendableBalancesResponse, - } as QuerySpendableBalancesResponse; - message.balances = []; - if (object.balances !== undefined && object.balances !== null) { - for (const e of object.balances) { - message.balances.push(Coin.fromPartial(e)); + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { + return { address: "", denom: "" }; +} + +export const QuerySpendableBalanceByDenomRequest = { + encode(message: QuerySpendableBalanceByDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; + return message; + }, + + fromJSON(object: any): QuerySpendableBalanceByDenomRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + }; + }, + + toJSON(message: QuerySpendableBalanceByDenomRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, +}; + +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { balance: undefined }; +} + +export const QuerySpendableBalanceByDenomResponse = { + encode(message: QuerySpendableBalanceByDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): QuerySpendableBalanceByDenomResponse { + return { balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined }; + }, + + toJSON(message: QuerySpendableBalanceByDenomResponse): unknown { + const obj: any = {}; + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + message.balance = (object.balance !== undefined && object.balance !== null) + ? Coin.fromPartial(object.balance) + : undefined; + return message; + }, }; -const baseQueryTotalSupplyRequest: object = {}; +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { pagination: undefined }; +} export const QueryTotalSupplyRequest = { - encode( - message: QueryTotalSupplyRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryTotalSupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; + const message = createBaseQueryTotalSupplyRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -692,70 +742,44 @@ export const QueryTotalSupplyRequest = { }, fromJSON(object: any): QueryTotalSupplyRequest { - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryTotalSupplyRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryTotalSupplyRequest { - const message = { - ...baseQueryTotalSupplyRequest, - } as QueryTotalSupplyRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryTotalSupplyResponse: object = {}; +function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { + return { supply: [], pagination: undefined }; +} export const QueryTotalSupplyResponse = { - encode( - message: QueryTotalSupplyResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryTotalSupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.supply) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryTotalSupplyResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; + const message = createBaseQueryTotalSupplyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -774,75 +798,50 @@ export const QueryTotalSupplyResponse = { }, fromJSON(object: any): QueryTotalSupplyResponse { - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryTotalSupplyResponse): unknown { const obj: any = {}; if (message.supply) { - obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.supply = message.supply.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.supply = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryTotalSupplyResponse { - const message = { - ...baseQueryTotalSupplyResponse, - } as QueryTotalSupplyResponse; - message.supply = []; - if (object.supply !== undefined && object.supply !== null) { - for (const e of object.supply) { - message.supply.push(Coin.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryTotalSupplyResponse { + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQuerySupplyOfRequest: object = { denom: "" }; +function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { + return { denom: "" }; +} export const QuerySupplyOfRequest = { - encode( - message: QuerySupplyOfRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + const message = createBaseQuerySupplyOfRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -858,13 +857,7 @@ export const QuerySupplyOfRequest = { }, fromJSON(object: any): QuerySupplyOfRequest { - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; + return { denom: isSet(object.denom) ? String(object.denom) : "" }; }, toJSON(message: QuerySupplyOfRequest): unknown { @@ -873,34 +866,29 @@ export const QuerySupplyOfRequest = { return obj; }, - fromPartial(object: DeepPartial): QuerySupplyOfRequest { - const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } + fromPartial, I>>(object: I): QuerySupplyOfRequest { + const message = createBaseQuerySupplyOfRequest(); + message.denom = object.denom ?? ""; return message; }, }; -const baseQuerySupplyOfResponse: object = {}; +function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { + return { amount: undefined }; +} export const QuerySupplyOfResponse = { - encode( - message: QuerySupplyOfResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySupplyOfResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + const message = createBaseQuerySupplyOfResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -916,46 +904,37 @@ export const QuerySupplyOfResponse = { }, fromJSON(object: any): QuerySupplyOfResponse { - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; + return { amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined }; }, toJSON(message: QuerySupplyOfResponse): unknown { const obj: any = {}; - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QuerySupplyOfResponse { - const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } + fromPartial, I>>(object: I): QuerySupplyOfResponse { + const message = createBaseQuerySupplyOfResponse(); + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; return message; }, }; -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -968,8 +947,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -977,29 +955,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1015,55 +992,40 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -const baseQueryDenomsMetadataRequest: object = {}; +function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { + return { pagination: undefined }; +} export const QueryDenomsMetadataRequest = { - encode( - message: QueryDenomsMetadataRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomsMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsMetadataRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; + const message = createBaseQueryDenomsMetadataRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1079,70 +1041,44 @@ export const QueryDenomsMetadataRequest = { }, fromJSON(object: any): QueryDenomsMetadataRequest { - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryDenomsMetadataRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDenomsMetadataRequest { - const message = { - ...baseQueryDenomsMetadataRequest, - } as QueryDenomsMetadataRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryDenomsMetadataRequest { + const message = createBaseQueryDenomsMetadataRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDenomsMetadataResponse: object = {}; +function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { + return { metadatas: [], pagination: undefined }; +} export const QueryDenomsMetadataResponse = { - encode( - message: QueryDenomsMetadataResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomsMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.metadatas) { Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; + const message = createBaseQueryDenomsMetadataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1161,82 +1097,50 @@ export const QueryDenomsMetadataResponse = { }, fromJSON(object: any): QueryDenomsMetadataResponse { - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; - if (object.metadatas !== undefined && object.metadatas !== null) { - for (const e of object.metadatas) { - message.metadatas.push(Metadata.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + metadatas: Array.isArray(object?.metadatas) ? object.metadatas.map((e: any) => Metadata.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDenomsMetadataResponse): unknown { const obj: any = {}; if (message.metadatas) { - obj.metadatas = message.metadatas.map((e) => - e ? Metadata.toJSON(e) : undefined - ); + obj.metadatas = message.metadatas.map((e) => e ? Metadata.toJSON(e) : undefined); } else { obj.metadatas = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDenomsMetadataResponse { - const message = { - ...baseQueryDenomsMetadataResponse, - } as QueryDenomsMetadataResponse; - message.metadatas = []; - if (object.metadatas !== undefined && object.metadatas !== null) { - for (const e of object.metadatas) { - message.metadatas.push(Metadata.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryDenomsMetadataResponse { + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDenomMetadataRequest: object = { denom: "" }; +function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { + return { denom: "" }; +} export const QueryDenomMetadataRequest = { - encode( - message: QueryDenomMetadataRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomMetadataRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; + const message = createBaseQueryDenomMetadataRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1252,15 +1156,7 @@ export const QueryDenomMetadataRequest = { }, fromJSON(object: any): QueryDenomMetadataRequest { - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; + return { denom: isSet(object.denom) ? String(object.denom) : "" }; }, toJSON(message: QueryDenomMetadataRequest): unknown { @@ -1269,43 +1165,29 @@ export const QueryDenomMetadataRequest = { return obj; }, - fromPartial( - object: DeepPartial - ): QueryDenomMetadataRequest { - const message = { - ...baseQueryDenomMetadataRequest, - } as QueryDenomMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } + fromPartial, I>>(object: I): QueryDenomMetadataRequest { + const message = createBaseQueryDenomMetadataRequest(); + message.denom = object.denom ?? ""; return message; }, }; -const baseQueryDenomMetadataResponse: object = {}; +function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { + return { metadata: undefined }; +} export const QueryDenomMetadataResponse = { - encode( - message: QueryDenomMetadataResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; + const message = createBaseQueryDenomMetadataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1321,37 +1203,338 @@ export const QueryDenomMetadataResponse = { }, fromJSON(object: any): QueryDenomMetadataResponse { - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromJSON(object.metadata); + return { metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined }; + }, + + toJSON(message: QueryDenomMetadataResponse): unknown { + const obj: any = {}; + message.metadata !== undefined && (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomMetadataResponse { + const message = createBaseQueryDenomMetadataResponse(); + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? Metadata.fromPartial(object.metadata) + : undefined; + return message; + }, +}; + +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { + return { denom: "", pagination: undefined }; +} + +export const QueryDenomOwnersRequest = { + encode(message: QueryDenomOwnersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomOwnersRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryDenomOwnersRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + message.denom = object.denom ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseDenomOwner(): DenomOwner { + return { address: "", balance: undefined }; +} + +export const DenomOwner = { + encode(message: DenomOwner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DenomOwner { + return { + address: isSet(object.address) ? String(object.address) : "", + balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, + }; + }, + + toJSON(message: DenomOwner): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): DenomOwner { + const message = createBaseDenomOwner(); + message.address = object.address ?? ""; + message.balance = (object.balance !== undefined && object.balance !== null) + ? Coin.fromPartial(object.balance) + : undefined; + return message; + }, +}; + +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { denomOwners: [], pagination: undefined }; +} + +export const QueryDenomOwnersResponse = { + encode(message: QueryDenomOwnersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomOwnersResponse { + return { + denomOwners: Array.isArray(object?.denomOwners) ? object.denomOwners.map((e: any) => DenomOwner.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryDenomOwnersResponse): unknown { + const obj: any = {}; + if (message.denomOwners) { + obj.denomOwners = message.denomOwners.map((e) => e ? DenomOwner.toJSON(e) : undefined); } else { - message.metadata = undefined; + obj.denomOwners = []; } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denomOwners?.map((e) => DenomOwner.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, +}; - toJSON(message: QueryDenomMetadataResponse): unknown { +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { + return { denoms: [], pagination: undefined }; +} + +export const QuerySendEnabledRequest = { + encode(message: QuerySendEnabledRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySendEnabledRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + case 99: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySendEnabledRequest { + return { + denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QuerySendEnabledRequest): unknown { const obj: any = {}; - message.metadata !== undefined && - (obj.metadata = message.metadata - ? Metadata.toJSON(message.metadata) - : undefined); + if (message.denoms) { + obj.denoms = message.denoms.map((e) => e); + } else { + obj.denoms = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDenomMetadataResponse { - const message = { - ...baseQueryDenomMetadataResponse, - } as QueryDenomMetadataResponse; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromPartial(object.metadata); + fromPartial, I>>(object: I): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map((e) => e) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { sendEnabled: [], pagination: undefined }; +} + +export const QuerySendEnabledResponse = { + encode(message: QuerySendEnabledResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySendEnabledResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 99: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySendEnabledResponse { + return { + sendEnabled: Array.isArray(object?.sendEnabled) + ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QuerySendEnabledResponse): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); } else { - message.metadata = undefined; + obj.sendEnabled = []; } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; @@ -1360,160 +1543,176 @@ export const QueryDenomMetadataResponse = { export interface Query { /** Balance queries the balance of a single coin for a single account. */ Balance(request: QueryBalanceRequest): Promise; - /** AllBalances queries the balance of all coins for a single account. */ - AllBalances( - request: QueryAllBalancesRequest - ): Promise; /** - * SpendableBalances queries the spenable balance of all coins for a single + * AllBalances queries the balance of all coins for a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + AllBalances(request: QueryAllBalancesRequest): Promise; + /** + * SpendableBalances queries the spendable balance of all coins for a single * account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + SpendableBalances(request: QuerySpendableBalancesRequest): Promise; + /** + * SpendableBalanceByDenom queries the spendable balance of a single denom for + * a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.47 + */ + SpendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise; + /** + * TotalSupply queries the total supply of all coins. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + TotalSupply(request: QueryTotalSupplyRequest): Promise; + /** + * SupplyOf queries the supply of a single coin. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ - SpendableBalances( - request: QuerySpendableBalancesRequest - ): Promise; - /** TotalSupply queries the total supply of all coins. */ - TotalSupply( - request: QueryTotalSupplyRequest - ): Promise; - /** SupplyOf queries the supply of a single coin. */ SupplyOf(request: QuerySupplyOfRequest): Promise; /** Params queries the parameters of x/bank module. */ Params(request: QueryParamsRequest): Promise; /** DenomsMetadata queries the client metadata of a given coin denomination. */ - DenomMetadata( - request: QueryDenomMetadataRequest - ): Promise; - /** DenomsMetadata queries the client metadata for all registered coin denominations. */ - DenomsMetadata( - request: QueryDenomsMetadataRequest - ): Promise; + DenomMetadata(request: QueryDenomMetadataRequest): Promise; + /** + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ + DenomsMetadata(request: QueryDenomsMetadataRequest): Promise; + /** + * DenomOwners queries for all account addresses that own a particular token + * denomination. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + DenomOwners(request: QueryDenomOwnersRequest): Promise; + /** + * SendEnabled queries for SendEnabled entries. + * + * This query only returns denominations that have specific SendEnabled settings. + * Any denomination that does not have a specific setting will use the default + * params.default_send_enabled, and will not be returned by this query. + * + * Since: cosmos-sdk 0.47 + */ + SendEnabled(request: QuerySendEnabledRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Balance = this.Balance.bind(this); + this.AllBalances = this.AllBalances.bind(this); + this.SpendableBalances = this.SpendableBalances.bind(this); + this.SpendableBalanceByDenom = this.SpendableBalanceByDenom.bind(this); + this.TotalSupply = this.TotalSupply.bind(this); + this.SupplyOf = this.SupplyOf.bind(this); + this.Params = this.Params.bind(this); + this.DenomMetadata = this.DenomMetadata.bind(this); + this.DenomsMetadata = this.DenomsMetadata.bind(this); + this.DenomOwners = this.DenomOwners.bind(this); + this.SendEnabled = this.SendEnabled.bind(this); } Balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "Balance", - data - ); - return promise.then((data) => - QueryBalanceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); + return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); } - AllBalances( - request: QueryAllBalancesRequest - ): Promise { + AllBalances(request: QueryAllBalancesRequest): Promise { const data = QueryAllBalancesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "AllBalances", - data - ); - return promise.then((data) => - QueryAllBalancesResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); + return promise.then((data) => QueryAllBalancesResponse.decode(new _m0.Reader(data))); } - SpendableBalances( - request: QuerySpendableBalancesRequest - ): Promise { + SpendableBalances(request: QuerySpendableBalancesRequest): Promise { const data = QuerySpendableBalancesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "SpendableBalances", - data - ); - return promise.then((data) => - QuerySpendableBalancesResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); + return promise.then((data) => QuerySpendableBalancesResponse.decode(new _m0.Reader(data))); } - TotalSupply( - request: QueryTotalSupplyRequest - ): Promise { + SpendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + const data = QuerySpendableBalanceByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalanceByDenom", data); + return promise.then((data) => QuerySpendableBalanceByDenomResponse.decode(new _m0.Reader(data))); + } + + TotalSupply(request: QueryTotalSupplyRequest): Promise { const data = QueryTotalSupplyRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "TotalSupply", - data - ); - return promise.then((data) => - QueryTotalSupplyResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); + return promise.then((data) => QueryTotalSupplyResponse.decode(new _m0.Reader(data))); } SupplyOf(request: QuerySupplyOfRequest): Promise { const data = QuerySupplyOfRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "SupplyOf", - data - ); - return promise.then((data) => - QuerySupplyOfResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); + return promise.then((data) => QuerySupplyOfResponse.decode(new _m0.Reader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } - DenomMetadata( - request: QueryDenomMetadataRequest - ): Promise { + DenomMetadata(request: QueryDenomMetadataRequest): Promise { const data = QueryDenomMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "DenomMetadata", - data - ); - return promise.then((data) => - QueryDenomMetadataResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); + return promise.then((data) => QueryDenomMetadataResponse.decode(new _m0.Reader(data))); } - DenomsMetadata( - request: QueryDenomsMetadataRequest - ): Promise { + DenomsMetadata(request: QueryDenomsMetadataRequest): Promise { const data = QueryDenomsMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Query", - "DenomsMetadata", - data - ); - return promise.then((data) => - QueryDenomsMetadataResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); + return promise.then((data) => QueryDenomsMetadataResponse.decode(new _m0.Reader(data))); + } + + DenomOwners(request: QueryDenomOwnersRequest): Promise { + const data = QueryDenomOwnersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); + return promise.then((data) => QueryDenomOwnersResponse.decode(new _m0.Reader(data))); + } + + SendEnabled(request: QuerySendEnabledRequest): Promise { + const data = QuerySendEnabledRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SendEnabled", data); + return promise.then((data) => QuerySendEnabledResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts index ae8efa8fe8..8667baaa91 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts @@ -1,39 +1,102 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; +import { Input, Output, Params, SendEnabled } from "./bank"; export const protobufPackage = "cosmos.bank.v1beta1"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { - from_address: string; - to_address: string; + fromAddress: string; + toAddress: string; amount: Coin[]; } /** MsgSendResponse defines the Msg/Send response type. */ -export interface MsgSendResponse {} +export interface MsgSendResponse { +} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: Input[]; outputs: Output[]; } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ -export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponse { +} + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} -const baseMsgSend: object = { from_address: "", to_address: "" }; +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabled { + authority: string; + /** send_enabled is the list of entries to add or update. */ + sendEnabled: SendEnabled[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + useDefaultFor: string[]; +} + +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponse { +} + +function createBaseMsgSend(): MsgSend { + return { fromAddress: "", toAddress: "", amount: [] }; +} export const MsgSend = { - encode(message: MsgSend, writer: Writer = Writer.create()): Writer { - if (message.from_address !== "") { - writer.uint32(10).string(message.from_address); + encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); } - if (message.to_address !== "") { - writer.uint32(18).string(message.to_address); + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); } for (const v of message.amount) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); @@ -41,19 +104,18 @@ export const MsgSend = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; + const message = createBaseMsgSend(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.from_address = reader.string(); + message.fromAddress = reader.string(); break; case 2: - message.to_address = reader.string(); + message.toAddress = reader.string(); break; case 3: message.amount.push(Coin.decode(reader, reader.uint32())); @@ -67,72 +129,47 @@ export const MsgSend = { }, fromJSON(object: any): MsgSend { - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = String(object.from_address); - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = String(object.to_address); - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; + return { + fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", + toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: MsgSend): unknown { const obj: any = {}; - message.from_address !== undefined && - (obj.from_address = message.from_address); - message.to_address !== undefined && (obj.to_address = message.to_address); + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } return obj; }, - fromPartial(object: DeepPartial): MsgSend { - const message = { ...baseMsgSend } as MsgSend; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = object.from_address; - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = object.to_address; - } else { - message.to_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): MsgSend { + const message = createBaseMsgSend(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseMsgSendResponse: object = {}; +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSendResponse } as MsgSendResponse; + const message = createBaseMsgSendResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -145,8 +182,7 @@ export const MsgSendResponse = { }, fromJSON(_: any): MsgSendResponse { - const message = { ...baseMsgSendResponse } as MsgSendResponse; - return message; + return {}; }, toJSON(_: MsgSendResponse): unknown { @@ -154,16 +190,18 @@ export const MsgSendResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgSendResponse { - const message = { ...baseMsgSendResponse } as MsgSendResponse; + fromPartial, I>>(_: I): MsgSendResponse { + const message = createBaseMsgSendResponse(); return message; }, }; -const baseMsgMultiSend: object = {}; +function createBaseMsgMultiSend(): MsgMultiSend { + return { inputs: [], outputs: [] }; +} export const MsgMultiSend = { - encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer { + encode(message: MsgMultiSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.inputs) { Input.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -173,12 +211,10 @@ export const MsgMultiSend = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgMultiSend { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; + const message = createBaseMsgMultiSend(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -197,68 +233,147 @@ export const MsgMultiSend = { }, fromJSON(object: any): MsgMultiSend { - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; - if (object.inputs !== undefined && object.inputs !== null) { - for (const e of object.inputs) { - message.inputs.push(Input.fromJSON(e)); - } - } - if (object.outputs !== undefined && object.outputs !== null) { - for (const e of object.outputs) { - message.outputs.push(Output.fromJSON(e)); - } - } - return message; + return { + inputs: Array.isArray(object?.inputs) ? object.inputs.map((e: any) => Input.fromJSON(e)) : [], + outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => Output.fromJSON(e)) : [], + }; }, toJSON(message: MsgMultiSend): unknown { const obj: any = {}; if (message.inputs) { - obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)); + obj.inputs = message.inputs.map((e) => e ? Input.toJSON(e) : undefined); } else { obj.inputs = []; } if (message.outputs) { - obj.outputs = message.outputs.map((e) => - e ? Output.toJSON(e) : undefined - ); + obj.outputs = message.outputs.map((e) => e ? Output.toJSON(e) : undefined); } else { obj.outputs = []; } return obj; }, - fromPartial(object: DeepPartial): MsgMultiSend { - const message = { ...baseMsgMultiSend } as MsgMultiSend; - message.inputs = []; - message.outputs = []; - if (object.inputs !== undefined && object.inputs !== null) { - for (const e of object.inputs) { - message.inputs.push(Input.fromPartial(e)); + fromPartial, I>>(object: I): MsgMultiSend { + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || []; + message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { + return {}; +} + +export const MsgMultiSendResponse = { + encode(_: MsgMultiSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMultiSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } } - if (object.outputs !== undefined && object.outputs !== null) { - for (const e of object.outputs) { - message.outputs.push(Output.fromPartial(e)); + return message; + }, + + fromJSON(_: any): MsgMultiSendResponse { + return {}; + }, + + toJSON(_: MsgMultiSendResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, }; -const baseMsgMultiSendResponse: object = {}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} -export const MsgMultiSendResponse = { - encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer { +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgMultiSendResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -270,18 +385,133 @@ export const MsgMultiSendResponse = { return message; }, - fromJSON(_: any): MsgMultiSendResponse { - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, +}; - toJSON(_: MsgMultiSendResponse): unknown { +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { authority: "", sendEnabled: [], useDefaultFor: [] }; +} + +export const MsgSetSendEnabled = { + encode(message: MsgSetSendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.useDefaultFor) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 3: + message.useDefaultFor.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSetSendEnabled { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + sendEnabled: Array.isArray(object?.sendEnabled) + ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) + : [], + useDefaultFor: Array.isArray(object?.useDefaultFor) ? object.useDefaultFor.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: MsgSetSendEnabled): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; + } + if (message.useDefaultFor) { + obj.useDefaultFor = message.useDefaultFor.map((e) => e); + } else { + obj.useDefaultFor = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + message.authority = object.authority ?? ""; + message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.useDefaultFor = object.useDefaultFor?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} + +export const MsgSetSendEnabledResponse = { + encode(_: MsgSetSendEnabledResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetSendEnabledResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSetSendEnabledResponse { + return {}; + }, + + toJSON(_: MsgSetSendEnabledResponse): unknown { const obj: any = {}; return obj; }, - fromPartial(_: DeepPartial): MsgMultiSendResponse { - const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + fromPartial, I>>(_: I): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); return message; }, }; @@ -292,47 +522,73 @@ export interface Msg { Send(request: MsgSend): Promise; /** MultiSend defines a method for sending coins from some accounts to other accounts. */ MultiSend(request: MsgMultiSend): Promise; + /** + * UpdateParams defines a governance operation for updating the x/bank module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; + /** + * SetSendEnabled is a governance operation for setting the SendEnabled flag + * on any number of Denoms. Only the entries to add or update should be + * included. Entries that already exist in the store, but that aren't + * included in this message, will be left unchanged. + * + * Since: cosmos-sdk 0.47 + */ + SetSendEnabled(request: MsgSetSendEnabled): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Send = this.Send.bind(this); + this.MultiSend = this.MultiSend.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); + this.SetSendEnabled = this.SetSendEnabled.bind(this); } Send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); - return promise.then((data) => MsgSendResponse.decode(new Reader(data))); + return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); } MultiSend(request: MsgMultiSend): Promise { const data = MsgMultiSend.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.bank.v1beta1.Msg", - "MultiSend", - data - ); - return promise.then((data) => - MsgMultiSendResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); + return promise.then((data) => MsgMultiSendResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } + + SetSendEnabled(request: MsgSetSendEnabled): Promise { + const data = MsgSetSendEnabled.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); + return promise.then((data) => MsgSetSendEnabledResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/query/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/query/v1/query.ts new file mode 100644 index 0000000000..7539aee060 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos/query/v1/query.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.query.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/module.ts new file mode 100755 index 0000000000..5c787f2853 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/module.ts @@ -0,0 +1,97 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosBaseNodeV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/rest.ts new file mode 100644 index 0000000000..6aef0aae75 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/rest.ts @@ -0,0 +1,171 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** + * ConfigResponse defines the response structure for the Config gRPC query. + */ +export interface V1Beta1ConfigResponse { + minimum_gas_price?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title cosmos/base/node/v1beta1/query.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Service + * @name ServiceConfig + * @summary Config queries for the operator configuration. + * @request GET:/cosmos/base/node/v1beta1/config + */ + serviceConfig = (params: RequestParams = {}) => + this.request({ + path: `/cosmos/base/node/v1beta1/config`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types.ts new file mode 100755 index 0000000000..d5b4a888a6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types.ts @@ -0,0 +1,6 @@ +//@ts-nocheck + + +export { + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/cosmos/base/node/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/cosmos/base/node/v1beta1/query.ts new file mode 100644 index 0000000000..17f6b15989 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/cosmos/base/node/v1beta1/query.ts @@ -0,0 +1,138 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.node.v1beta1"; + +/** ConfigRequest defines the request structure for the Config gRPC query. */ +export interface ConfigRequest { +} + +/** ConfigResponse defines the response structure for the Config gRPC query. */ +export interface ConfigResponse { + minimumGasPrice: string; +} + +function createBaseConfigRequest(): ConfigRequest { + return {}; +} + +export const ConfigRequest = { + encode(_: ConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConfigRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ConfigRequest { + return {}; + }, + + toJSON(_: ConfigRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): ConfigRequest { + const message = createBaseConfigRequest(); + return message; + }, +}; + +function createBaseConfigResponse(): ConfigResponse { + return { minimumGasPrice: "" }; +} + +export const ConfigResponse = { + encode(message: ConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.minimumGasPrice !== "") { + writer.uint32(10).string(message.minimumGasPrice); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConfigResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minimumGasPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConfigResponse { + return { minimumGasPrice: isSet(object.minimumGasPrice) ? String(object.minimumGasPrice) : "" }; + }, + + toJSON(message: ConfigResponse): unknown { + const obj: any = {}; + message.minimumGasPrice !== undefined && (obj.minimumGasPrice = message.minimumGasPrice); + return obj; + }, + + fromPartial, I>>(object: I): ConfigResponse { + const message = createBaseConfigResponse(); + message.minimumGasPrice = object.minimumGasPrice ?? ""; + return message; + }, +}; + +/** Service defines the gRPC querier service for node related queries. */ +export interface Service { + /** Config queries for the operator configuration. */ + Config(request: ConfigRequest): Promise; +} + +export class ServiceClientImpl implements Service { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Config = this.Config.bind(this); + } + Config(request: ConfigRequest): Promise { + const data = ConfigRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data); + return promise.then((data) => ConfigResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/api/annotations.ts similarity index 100% rename from wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/api/annotations.ts rename to wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/api/annotations.ts diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/api/http.ts similarity index 63% rename from wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/api/http.ts rename to wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.node.v1beta1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/module.ts new file mode 100755 index 0000000000..b91c3deadd --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/module.ts @@ -0,0 +1,111 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Validator as typeValidator} from "./types" +import { VersionInfo as typeVersionInfo} from "./types" +import { Module as typeModule} from "./types" +import { ProofOp as typeProofOp} from "./types" +import { ProofOps as typeProofOps} from "./types" +import { Block as typeBlock} from "./types" +import { Header as typeHeader} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Validator: getStructure(typeValidator.fromPartial({})), + VersionInfo: getStructure(typeVersionInfo.fromPartial({})), + Module: getStructure(typeModule.fromPartial({})), + ProofOp: getStructure(typeProofOp.fromPartial({})), + ProofOps: getStructure(typeProofOps.fromPartial({})), + Block: getStructure(typeBlock.fromPartial({})), + Header: getStructure(typeHeader.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosBaseTendermintV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/rest.ts index 16bce05aab..5604c18ede 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/rest.ts @@ -144,7 +144,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -153,11 +152,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -171,6 +168,96 @@ export interface RpcStatus { details?: ProtobufAny[]; } +export interface TenderminttypesBlock { + /** Header defines the structure of a block header. */ + header?: TenderminttypesHeader; + data?: TypesData; + evidence?: TypesEvidenceList; + + /** Commit contains the evidence that a block was committed by a set of validators. */ + last_commit?: TypesCommit; +} + +/** + * Header defines the structure of a block header. + */ +export interface TenderminttypesHeader { + /** + * basic block info + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ + version?: VersionConsensus; + chain_id?: string; + + /** @format int64 */ + height?: string; + + /** @format date-time */ + time?: string; + + /** prev block info */ + last_block_id?: TypesBlockID; + + /** + * hashes of block data + * commit from validators from the last block + * @format byte + */ + last_commit_hash?: string; + + /** + * transactions + * @format byte + */ + data_hash?: string; + + /** + * hashes from the app output from the prev block + * validators for the current block + * @format byte + */ + validators_hash?: string; + + /** + * validators for the next block + * @format byte + */ + next_validators_hash?: string; + + /** + * consensus params for current block + * @format byte + */ + consensus_hash?: string; + + /** + * state after txs from the previous block + * @format byte + */ + app_hash?: string; + + /** + * root hash of all results from the txs from the previous block + * @format byte + */ + last_results_hash?: string; + + /** + * consensus info + * evidence included in the block + * @format byte + */ + evidence_hash?: string; + + /** + * original proposer of the block + * @format byte + */ + proposer_address?: string; +} + export interface TenderminttypesValidator { /** @format byte */ address?: string; @@ -183,6 +270,129 @@ export interface TenderminttypesValidator { proposer_priority?: string; } +/** +* Block is tendermint type Block, with the Header proposer address +field converted to bech32 string. +*/ +export interface Tendermintv1Beta1Block { + /** Header defines the structure of a Tendermint block header. */ + header?: Tendermintv1Beta1Header; + data?: TypesData; + evidence?: TypesEvidenceList; + + /** Commit contains the evidence that a block was committed by a set of validators. */ + last_commit?: TypesCommit; +} + +/** + * Header defines the structure of a Tendermint block header. + */ +export interface Tendermintv1Beta1Header { + /** + * basic block info + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ + version?: VersionConsensus; + chain_id?: string; + + /** @format int64 */ + height?: string; + + /** @format date-time */ + time?: string; + + /** prev block info */ + last_block_id?: TypesBlockID; + + /** + * hashes of block data + * commit from validators from the last block + * @format byte + */ + last_commit_hash?: string; + + /** + * transactions + * @format byte + */ + data_hash?: string; + + /** + * hashes from the app output from the prev block + * validators for the current block + * @format byte + */ + validators_hash?: string; + + /** + * validators for the next block + * @format byte + */ + next_validators_hash?: string; + + /** + * consensus params for current block + * @format byte + */ + consensus_hash?: string; + + /** + * state after txs from the previous block + * @format byte + */ + app_hash?: string; + + /** + * root hash of all results from the txs from the previous block + * @format byte + */ + last_results_hash?: string; + + /** + * consensus info + * evidence included in the block + * @format byte + */ + evidence_hash?: string; + + /** + * proposer_address is the original block proposer address, formatted as a Bech32 string. + * In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + * for better UX. + * + * original proposer of the block + */ + proposer_address?: string; +} + +/** +* ProofOp defines an operation used for calculating Merkle root. The data could +be arbitrary format, providing necessary data for example neighbouring node +hash. + +Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +*/ +export interface Tendermintv1Beta1ProofOp { + type?: string; + + /** @format byte */ + key?: string; + + /** @format byte */ + data?: string; +} + +/** +* ProofOps is Merkle proof defined by the list of ProofOps. + +Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +*/ +export interface Tendermintv1Beta1ProofOps { + ops?: Tendermintv1Beta1ProofOp[]; +} + /** * Validator is the type for the validator-set. */ @@ -195,9 +405,7 @@ export interface Tendermintv1Beta1Validator { * * Protobuf library provides support to pack/unpack Any values in the form * of utility functions or additional generated methods of the Any type. - * * Example 1: Pack and unpack a message in C++. - * * Foo foo = ...; * Any any; * any.PackFrom(foo); @@ -205,28 +413,17 @@ export interface Tendermintv1Beta1Validator { * if (any.UnpackTo(&foo)) { * ... * } - * * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; * Any any = Any.pack(foo); - * ... * if (any.is(Foo.class)) { * foo = any.unpack(Foo.class); - * } - * * Example 3: Pack and unpack a message in Python. - * * foo = Foo(...) * any = Any() * any.Pack(foo) - * ... * if any.Is(Foo.DESCRIPTOR): * any.Unpack(foo) - * ... - * * Example 4: Pack and unpack a message in Go - * * foo := &pb.Foo{...} * any, err := anypb.New(foo) * if err != nil { @@ -235,43 +432,30 @@ export interface Tendermintv1Beta1Validator { * ... * foo := &pb.Foo{} * if err := any.UnmarshalTo(foo); err != nil { - * ... - * } - * * The pack methods provided by protobuf library will by default use * 'type.googleapis.com/full.type.name' as the type URL and the unpack * methods only use the fully qualified type name after the last '/' * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". - * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular * representation of the deserialized, embedded message, with an * additional field `@type` which contains the type URL. Example: - * * package google.profile; * message Person { * string first_name = 1; * string last_name = 2; - * } - * * { * "@type": "type.googleapis.com/google.profile.Person", * "firstName": , * "lastName": - * } - * * If the embedded message type is well-known and has a custom JSON * representation, that representation will be embedded adding a field * `value` which holds the custom JSON in addition to the `@type` * field. Example (for message [google.protobuf.Duration][]): - * - * { * "@type": "type.googleapis.com/google.protobuf.Duration", * "value": "1.212s" - * } */ pub_key?: ProtobufAny; @@ -282,16 +466,6 @@ export interface Tendermintv1Beta1Validator { proposer_priority?: string; } -export interface TypesBlock { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; - data?: TypesData; - evidence?: TypesEvidenceList; - - /** Commit contains the evidence that a block was committed by a set of validators. */ - last_commit?: TypesCommit; -} - export interface TypesBlockID { /** @format byte */ hash?: string; @@ -381,62 +555,6 @@ export interface TypesEvidenceList { evidence?: TypesEvidence[]; } -/** - * Header defines the structure of a Tendermint block header. - */ -export interface TypesHeader { - /** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ - version?: VersionConsensus; - chain_id?: string; - - /** @format int64 */ - height?: string; - - /** @format date-time */ - time?: string; - last_block_id?: TypesBlockID; - - /** - * commit from validators from the last block - * @format byte - */ - last_commit_hash?: string; - - /** @format byte */ - data_hash?: string; - - /** - * validators for the current block - * @format byte - */ - validators_hash?: string; - - /** @format byte */ - next_validators_hash?: string; - - /** @format byte */ - consensus_hash?: string; - - /** @format byte */ - app_hash?: string; - - /** @format byte */ - last_results_hash?: string; - - /** - * evidence included in the block - * @format byte - */ - evidence_hash?: string; - - /** @format byte */ - proposer_address?: string; -} - export interface TypesLightBlock { signed_header?: TypesSignedHeader; validator_set?: TypesValidatorSet; @@ -468,8 +586,8 @@ export interface TypesPartSetHeader { } export interface TypesSignedHeader { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; + /** Header defines the structure of a block header. */ + header?: TenderminttypesHeader; /** Commit contains the evidence that a block was committed by a set of validators. */ commit?: TypesCommit; @@ -531,12 +649,58 @@ export interface TypesVote { signature?: string; } +/** +* ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + +Note: This type is a duplicate of the ResponseQuery proto type defined in +Tendermint. +*/ +export interface V1Beta1ABCIQueryResponse { + /** @format int64 */ + code?: number; + + /** nondeterministic */ + log?: string; + + /** nondeterministic */ + info?: string; + + /** @format int64 */ + index?: string; + + /** @format byte */ + key?: string; + + /** @format byte */ + value?: string; + + /** + * ProofOps is Merkle proof defined by the list of ProofOps. + * + * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. + */ + proof_ops?: Tendermintv1Beta1ProofOps; + + /** @format int64 */ + height?: string; + codespace?: string; +} + /** * GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface V1Beta1GetBlockByHeightResponse { block_id?: TypesBlockID; - block?: TypesBlock; + + /** Deprecated: please use `sdk_block` instead */ + block?: TenderminttypesBlock; + + /** + * Since: cosmos-sdk 0.47 + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ + sdk_block?: Tendermintv1Beta1Block; } /** @@ -544,7 +708,16 @@ export interface V1Beta1GetBlockByHeightResponse { */ export interface V1Beta1GetLatestBlockResponse { block_id?: TypesBlockID; - block?: TypesBlock; + + /** Deprecated: please use `sdk_block` instead */ + block?: TenderminttypesBlock; + + /** + * Since: cosmos-sdk 0.47 + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ + sdk_block?: Tendermintv1Beta1Block; } /** @@ -560,7 +733,7 @@ export interface V1Beta1GetLatestValidatorSetResponse { } /** - * GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. + * GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface V1Beta1GetNodeInfoResponse { default_node_info?: P2PDefaultNodeInfo; @@ -589,8 +762,13 @@ export interface V1Beta1GetValidatorSetByHeightResponse { } export interface V1Beta1Module { + /** module path */ path?: string; + + /** module version */ version?: string; + + /** checksum */ sum?: string; } @@ -650,10 +828,19 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } @@ -668,6 +855,8 @@ export interface V1Beta1VersionInfo { build_tags?: string; go_version?: string; build_deps?: V1Beta1Module[]; + + /** Since: cosmos-sdk 0.43 */ cosmos_sdk_version?: string; } @@ -684,10 +873,11 @@ export interface VersionConsensus { app?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -697,30 +887,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -728,149 +909,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -880,6 +998,28 @@ export class HttpClient { * @version version not set */ export class Api extends HttpClient { + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Service + * @name ServiceAbciQuery + * @summary ABCIQuery defines a query handler that supports ABCI queries directly to the +application, bypassing Tendermint completely. The ABCI query must contain +a valid and supported path, including app, custom, p2p, and store. + * @request GET:/cosmos/base/tendermint/v1beta1/abci_query + */ + serviceABCIQuery = ( + query?: { data?: string; path?: string; height?: string; prove?: boolean }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/base/tendermint/v1beta1/abci_query`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types.ts new file mode 100755 index 0000000000..e53e83afe6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types.ts @@ -0,0 +1,20 @@ +//@ts-nocheck +import { Validator } from "./types/cosmos/base/tendermint/v1beta1/query" +import { VersionInfo } from "./types/cosmos/base/tendermint/v1beta1/query" +import { Module } from "./types/cosmos/base/tendermint/v1beta1/query" +import { ProofOp } from "./types/cosmos/base/tendermint/v1beta1/query" +import { ProofOps } from "./types/cosmos/base/tendermint/v1beta1/query" +import { Block } from "./types/cosmos/base/tendermint/v1beta1/types" +import { Header } from "./types/cosmos/base/tendermint/v1beta1/types" + + +export { + Validator, + VersionInfo, + Module, + ProofOp, + ProofOps, + Block, + Header, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts index f512cd6d5e..9c71fc6553 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts @@ -1,15 +1,13 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../../cosmos/base/query/v1beta1/pagination"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../../google/protobuf/any"; -import { BlockID } from "../../../../tendermint/types/types"; -import { Block } from "../../../../tendermint/types/block"; import { DefaultNodeInfo } from "../../../../tendermint/p2p/types"; +import { Block } from "../../../../tendermint/types/block"; +import { BlockID } from "../../../../tendermint/types/types"; +import { PageRequest, PageResponse } from "../../query/v1beta1/pagination"; +import { Block as Block1 } from "./types"; export const protobufPackage = "cosmos.base.tendermint.v1beta1"; @@ -22,7 +20,7 @@ export interface GetValidatorSetByHeightRequest { /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { - block_height: number; + blockHeight: number; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination: PageResponse | undefined; @@ -36,7 +34,7 @@ export interface GetLatestValidatorSetRequest { /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { - block_height: number; + blockHeight: number; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination: PageResponse | undefined; @@ -45,9 +43,9 @@ export interface GetLatestValidatorSetResponse { /** Validator is the type for the validator-set. */ export interface Validator { address: string; - pub_key: Any | undefined; - voting_power: number; - proposer_priority: number; + pubKey: Any | undefined; + votingPower: number; + proposerPriority: number; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ @@ -57,21 +55,37 @@ export interface GetBlockByHeightRequest { /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { - block_id: BlockID | undefined; - block: Block | undefined; + blockId: + | BlockID + | undefined; + /** Deprecated: please use `sdk_block` instead */ + block: + | Block + | undefined; + /** Since: cosmos-sdk 0.47 */ + sdkBlock: Block1 | undefined; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ -export interface GetLatestBlockRequest {} +export interface GetLatestBlockRequest { +} /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponse { - block_id: BlockID | undefined; - block: Block | undefined; + blockId: + | BlockID + | undefined; + /** Deprecated: please use `sdk_block` instead */ + block: + | Block + | undefined; + /** Since: cosmos-sdk 0.47 */ + sdkBlock: Block1 | undefined; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ -export interface GetSyncingRequest {} +export interface GetSyncingRequest { +} /** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ export interface GetSyncingResponse { @@ -79,25 +93,26 @@ export interface GetSyncingResponse { } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ -export interface GetNodeInfoRequest {} +export interface GetNodeInfoRequest { +} -/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ +/** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { - default_node_info: DefaultNodeInfo | undefined; - application_version: VersionInfo | undefined; + defaultNodeInfo: DefaultNodeInfo | undefined; + applicationVersion: VersionInfo | undefined; } /** VersionInfo is the type for the GetNodeInfoResponse message. */ export interface VersionInfo { name: string; - app_name: string; + appName: string; version: string; - git_commit: string; - build_tags: string; - go_version: string; - build_deps: Module[]; + gitCommit: string; + buildTags: string; + goVersion: string; + buildDeps: Module[]; /** Since: cosmos-sdk 0.43 */ - cosmos_sdk_version: string; + cosmosSdkVersion: string; } /** Module is the type for VersionInfo */ @@ -110,13 +125,62 @@ export interface Module { sum: string; } -const baseGetValidatorSetByHeightRequest: object = { height: 0 }; +/** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ +export interface ABCIQueryRequest { + data: Uint8Array; + path: string; + height: number; + prove: boolean; +} + +/** + * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + * + * Note: This type is a duplicate of the ResponseQuery proto type defined in + * Tendermint. + */ +export interface ABCIQueryResponse { + code: number; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + index: number; + key: Uint8Array; + value: Uint8Array; + proofOps: ProofOps | undefined; + height: number; + codespace: string; +} + +/** + * ProofOp defines an operation used for calculating Merkle root. The data could + * be arbitrary format, providing necessary data for example neighbouring node + * hash. + * + * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} + +/** + * ProofOps is Merkle proof defined by the list of ProofOps. + * + * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. + */ +export interface ProofOps { + ops: ProofOp[]; +} + +function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { + return { height: 0, pagination: undefined }; +} export const GetValidatorSetByHeightRequest = { - encode( - message: GetValidatorSetByHeightRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } @@ -126,15 +190,10 @@ export const GetValidatorSetByHeightRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GetValidatorSetByHeightRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; + const message = createBaseGetValidatorSetByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -153,89 +212,59 @@ export const GetValidatorSetByHeightRequest = { }, fromJSON(object: any): GetValidatorSetByHeightRequest { - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: GetValidatorSetByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): GetValidatorSetByHeightRequest { - const message = { - ...baseGetValidatorSetByHeightRequest, - } as GetValidatorSetByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseGetValidatorSetByHeightRequest(); + message.height = object.height ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseGetValidatorSetByHeightResponse: object = { block_height: 0 }; +function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { + return { blockHeight: 0, validators: [], pagination: undefined }; +} export const GetValidatorSetByHeightResponse = { - encode( - message: GetValidatorSetByHeightResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_height !== 0) { - writer.uint32(8).int64(message.block_height); + encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockHeight !== 0) { + writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { Validator.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GetValidatorSetByHeightResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; + const message = createBaseGetValidatorSetByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_height = longToNumber(reader.int64() as Long); + message.blockHeight = longToNumber(reader.int64() as Long); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -252,94 +281,55 @@ export const GetValidatorSetByHeightResponse = { }, fromJSON(object: any): GetValidatorSetByHeightResponse { - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = Number(object.block_height); - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + blockHeight: isSet(object.blockHeight) ? Number(object.blockHeight) : 0, + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: GetValidatorSetByHeightResponse): unknown { const obj: any = {}; - message.block_height !== undefined && - (obj.block_height = message.block_height); + message.blockHeight !== undefined && (obj.blockHeight = Math.round(message.blockHeight)); if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): GetValidatorSetByHeightResponse { - const message = { - ...baseGetValidatorSetByHeightResponse, - } as GetValidatorSetByHeightResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = object.block_height; - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseGetValidatorSetByHeightResponse(); + message.blockHeight = object.blockHeight ?? 0; + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseGetLatestValidatorSetRequest: object = {}; +function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest { + return { pagination: undefined }; +} export const GetLatestValidatorSetRequest = { - encode( - message: GetLatestValidatorSetRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GetLatestValidatorSetRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; + const message = createBaseGetLatestValidatorSetRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -355,78 +345,52 @@ export const GetLatestValidatorSetRequest = { }, fromJSON(object: any): GetLatestValidatorSetRequest { - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: GetLatestValidatorSetRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): GetLatestValidatorSetRequest { - const message = { - ...baseGetLatestValidatorSetRequest, - } as GetLatestValidatorSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): GetLatestValidatorSetRequest { + const message = createBaseGetLatestValidatorSetRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseGetLatestValidatorSetResponse: object = { block_height: 0 }; +function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { + return { blockHeight: 0, validators: [], pagination: undefined }; +} export const GetLatestValidatorSetResponse = { - encode( - message: GetLatestValidatorSetResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_height !== 0) { - writer.uint32(8).int64(message.block_height); + encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockHeight !== 0) { + writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { Validator.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GetLatestValidatorSetResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; + const message = createBaseGetLatestValidatorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_height = longToNumber(reader.int64() as Long); + message.blockHeight = longToNumber(reader.int64() as Long); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -443,99 +407,64 @@ export const GetLatestValidatorSetResponse = { }, fromJSON(object: any): GetLatestValidatorSetResponse { - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = Number(object.block_height); - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + blockHeight: isSet(object.blockHeight) ? Number(object.blockHeight) : 0, + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: GetLatestValidatorSetResponse): unknown { const obj: any = {}; - message.block_height !== undefined && - (obj.block_height = message.block_height); + message.blockHeight !== undefined && (obj.blockHeight = Math.round(message.blockHeight)); if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): GetLatestValidatorSetResponse { - const message = { - ...baseGetLatestValidatorSetResponse, - } as GetLatestValidatorSetResponse; - message.validators = []; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = object.block_height; - } else { - message.block_height = 0; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseGetLatestValidatorSetResponse(); + message.blockHeight = object.blockHeight ?? 0; + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseValidator: object = { - address: "", - voting_power: 0, - proposer_priority: 0, -}; +function createBaseValidator(): Validator { + return { address: "", pubKey: undefined, votingPower: 0, proposerPriority: 0 }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(24).int64(message.votingPower); } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); + if (message.proposerPriority !== 0) { + writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -543,13 +472,13 @@ export const Validator = { message.address = reader.string(); break; case 2: - message.pub_key = Any.decode(reader, reader.uint32()); + message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); + message.proposerPriority = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -560,93 +489,51 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0, + }; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); + message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority)); return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? ""; + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? Any.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 0; + message.proposerPriority = object.proposerPriority ?? 0; return message; }, }; -const baseGetBlockByHeightRequest: object = { height: 0 }; +function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest { + return { height: 0 }; +} export const GetBlockByHeightRequest = { - encode( - message: GetBlockByHeightRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetBlockByHeightRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; + const message = createBaseGetBlockByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -662,72 +549,56 @@ export const GetBlockByHeightRequest = { }, fromJSON(object: any): GetBlockByHeightRequest { - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; + return { height: isSet(object.height) ? Number(object.height) : 0 }; }, toJSON(message: GetBlockByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial( - object: DeepPartial - ): GetBlockByHeightRequest { - const message = { - ...baseGetBlockByHeightRequest, - } as GetBlockByHeightRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } + fromPartial, I>>(object: I): GetBlockByHeightRequest { + const message = createBaseGetBlockByHeightRequest(); + message.height = object.height ?? 0; return message; }, }; -const baseGetBlockByHeightResponse: object = {}; +function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { + return { blockId: undefined, block: undefined, sdkBlock: undefined }; +} export const GetBlockByHeightResponse = { - encode( - message: GetBlockByHeightResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); + encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } + if (message.sdkBlock !== undefined) { + Block1.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); + } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GetBlockByHeightResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; + const message = createBaseGetBlockByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: message.block = Block.decode(reader, reader.uint32()); break; + case 3: + message.sdkBlock = Block1.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -737,64 +608,47 @@ export const GetBlockByHeightResponse = { }, fromJSON(object: any): GetBlockByHeightResponse { - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromJSON(object.block); - } else { - message.block = undefined; - } - return message; + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, + sdkBlock: isSet(object.sdkBlock) ? Block1.fromJSON(object.sdkBlock) : undefined, + }; }, toJSON(message: GetBlockByHeightResponse): unknown { const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block !== undefined && - (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.sdkBlock !== undefined && (obj.sdkBlock = message.sdkBlock ? Block1.toJSON(message.sdkBlock) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): GetBlockByHeightResponse { - const message = { - ...baseGetBlockByHeightResponse, - } as GetBlockByHeightResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromPartial(object.block); - } else { - message.block = undefined; - } + fromPartial, I>>(object: I): GetBlockByHeightResponse { + const message = createBaseGetBlockByHeightResponse(); + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; + message.sdkBlock = (object.sdkBlock !== undefined && object.sdkBlock !== null) + ? Block1.fromPartial(object.sdkBlock) + : undefined; return message; }, }; -const baseGetLatestBlockRequest: object = {}; +function createBaseGetLatestBlockRequest(): GetLatestBlockRequest { + return {}; +} export const GetLatestBlockRequest = { - encode(_: GetLatestBlockRequest, writer: Writer = Writer.create()): Writer { + encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetLatestBlockRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; + const message = createBaseGetLatestBlockRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -807,8 +661,7 @@ export const GetLatestBlockRequest = { }, fromJSON(_: any): GetLatestBlockRequest { - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; - return message; + return {}; }, toJSON(_: GetLatestBlockRequest): unknown { @@ -816,41 +669,46 @@ export const GetLatestBlockRequest = { return obj; }, - fromPartial(_: DeepPartial): GetLatestBlockRequest { - const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; + fromPartial, I>>(_: I): GetLatestBlockRequest { + const message = createBaseGetLatestBlockRequest(); return message; }, }; -const baseGetLatestBlockResponse: object = {}; +function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { + return { blockId: undefined, block: undefined, sdkBlock: undefined }; +} export const GetLatestBlockResponse = { - encode( - message: GetLatestBlockResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); + encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { Block.encode(message.block, writer.uint32(18).fork()).ldelim(); } + if (message.sdkBlock !== undefined) { + Block1.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetLatestBlockResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; + const message = createBaseGetLatestBlockResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: message.block = Block.decode(reader, reader.uint32()); break; + case 3: + message.sdkBlock = Block1.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -860,60 +718,47 @@ export const GetLatestBlockResponse = { }, fromJSON(object: any): GetLatestBlockResponse { - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromJSON(object.block); - } else { - message.block = undefined; - } - return message; + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, + sdkBlock: isSet(object.sdkBlock) ? Block1.fromJSON(object.sdkBlock) : undefined, + }; }, toJSON(message: GetLatestBlockResponse): unknown { const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block !== undefined && - (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.sdkBlock !== undefined && (obj.sdkBlock = message.sdkBlock ? Block1.toJSON(message.sdkBlock) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): GetLatestBlockResponse { - const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromPartial(object.block); - } else { - message.block = undefined; - } + fromPartial, I>>(object: I): GetLatestBlockResponse { + const message = createBaseGetLatestBlockResponse(); + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; + message.sdkBlock = (object.sdkBlock !== undefined && object.sdkBlock !== null) + ? Block1.fromPartial(object.sdkBlock) + : undefined; return message; }, }; -const baseGetSyncingRequest: object = {}; +function createBaseGetSyncingRequest(): GetSyncingRequest { + return {}; +} export const GetSyncingRequest = { - encode(_: GetSyncingRequest, writer: Writer = Writer.create()): Writer { + encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetSyncingRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; + const message = createBaseGetSyncingRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -926,8 +771,7 @@ export const GetSyncingRequest = { }, fromJSON(_: any): GetSyncingRequest { - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; - return message; + return {}; }, toJSON(_: GetSyncingRequest): unknown { @@ -935,29 +779,28 @@ export const GetSyncingRequest = { return obj; }, - fromPartial(_: DeepPartial): GetSyncingRequest { - const message = { ...baseGetSyncingRequest } as GetSyncingRequest; + fromPartial, I>>(_: I): GetSyncingRequest { + const message = createBaseGetSyncingRequest(); return message; }, }; -const baseGetSyncingResponse: object = { syncing: false }; +function createBaseGetSyncingResponse(): GetSyncingResponse { + return { syncing: false }; +} export const GetSyncingResponse = { - encode( - message: GetSyncingResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetSyncingResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; + const message = createBaseGetSyncingResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -973,13 +816,7 @@ export const GetSyncingResponse = { }, fromJSON(object: any): GetSyncingResponse { - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; - if (object.syncing !== undefined && object.syncing !== null) { - message.syncing = Boolean(object.syncing); - } else { - message.syncing = false; - } - return message; + return { syncing: isSet(object.syncing) ? Boolean(object.syncing) : false }; }, toJSON(message: GetSyncingResponse): unknown { @@ -988,28 +825,26 @@ export const GetSyncingResponse = { return obj; }, - fromPartial(object: DeepPartial): GetSyncingResponse { - const message = { ...baseGetSyncingResponse } as GetSyncingResponse; - if (object.syncing !== undefined && object.syncing !== null) { - message.syncing = object.syncing; - } else { - message.syncing = false; - } + fromPartial, I>>(object: I): GetSyncingResponse { + const message = createBaseGetSyncingResponse(); + message.syncing = object.syncing ?? false; return message; }, }; -const baseGetNodeInfoRequest: object = {}; +function createBaseGetNodeInfoRequest(): GetNodeInfoRequest { + return {}; +} export const GetNodeInfoRequest = { - encode(_: GetNodeInfoRequest, writer: Writer = Writer.create()): Writer { + encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetNodeInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; + const message = createBaseGetNodeInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1022,8 +857,7 @@ export const GetNodeInfoRequest = { }, fromJSON(_: any): GetNodeInfoRequest { - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; - return message; + return {}; }, toJSON(_: GetNodeInfoRequest): unknown { @@ -1031,52 +865,39 @@ export const GetNodeInfoRequest = { return obj; }, - fromPartial(_: DeepPartial): GetNodeInfoRequest { - const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; + fromPartial, I>>(_: I): GetNodeInfoRequest { + const message = createBaseGetNodeInfoRequest(); return message; }, }; -const baseGetNodeInfoResponse: object = {}; +function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { + return { defaultNodeInfo: undefined, applicationVersion: undefined }; +} export const GetNodeInfoResponse = { - encode( - message: GetNodeInfoResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.default_node_info !== undefined) { - DefaultNodeInfo.encode( - message.default_node_info, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.application_version !== undefined) { - VersionInfo.encode( - message.application_version, - writer.uint32(18).fork() - ).ldelim(); + encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.defaultNodeInfo !== undefined) { + DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.applicationVersion !== undefined) { + VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetNodeInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; + const message = createBaseGetNodeInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.default_node_info = DefaultNodeInfo.decode( - reader, - reader.uint32() - ); + message.defaultNodeInfo = DefaultNodeInfo.decode(reader, reader.uint32()); break; case 2: - message.application_version = VersionInfo.decode( - reader, - reader.uint32() - ); + message.applicationVersion = VersionInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1087,113 +908,82 @@ export const GetNodeInfoResponse = { }, fromJSON(object: any): GetNodeInfoResponse { - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; - if ( - object.default_node_info !== undefined && - object.default_node_info !== null - ) { - message.default_node_info = DefaultNodeInfo.fromJSON( - object.default_node_info - ); - } else { - message.default_node_info = undefined; - } - if ( - object.application_version !== undefined && - object.application_version !== null - ) { - message.application_version = VersionInfo.fromJSON( - object.application_version - ); - } else { - message.application_version = undefined; - } - return message; + return { + defaultNodeInfo: isSet(object.defaultNodeInfo) ? DefaultNodeInfo.fromJSON(object.defaultNodeInfo) : undefined, + applicationVersion: isSet(object.applicationVersion) + ? VersionInfo.fromJSON(object.applicationVersion) + : undefined, + }; }, toJSON(message: GetNodeInfoResponse): unknown { const obj: any = {}; - message.default_node_info !== undefined && - (obj.default_node_info = message.default_node_info - ? DefaultNodeInfo.toJSON(message.default_node_info) - : undefined); - message.application_version !== undefined && - (obj.application_version = message.application_version - ? VersionInfo.toJSON(message.application_version) - : undefined); + message.defaultNodeInfo !== undefined + && (obj.defaultNodeInfo = message.defaultNodeInfo ? DefaultNodeInfo.toJSON(message.defaultNodeInfo) : undefined); + message.applicationVersion !== undefined && (obj.applicationVersion = message.applicationVersion + ? VersionInfo.toJSON(message.applicationVersion) + : undefined); return obj; }, - fromPartial(object: DeepPartial): GetNodeInfoResponse { - const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; - if ( - object.default_node_info !== undefined && - object.default_node_info !== null - ) { - message.default_node_info = DefaultNodeInfo.fromPartial( - object.default_node_info - ); - } else { - message.default_node_info = undefined; - } - if ( - object.application_version !== undefined && - object.application_version !== null - ) { - message.application_version = VersionInfo.fromPartial( - object.application_version - ); - } else { - message.application_version = undefined; - } + fromPartial, I>>(object: I): GetNodeInfoResponse { + const message = createBaseGetNodeInfoResponse(); + message.defaultNodeInfo = (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) + ? DefaultNodeInfo.fromPartial(object.defaultNodeInfo) + : undefined; + message.applicationVersion = (object.applicationVersion !== undefined && object.applicationVersion !== null) + ? VersionInfo.fromPartial(object.applicationVersion) + : undefined; return message; }, }; -const baseVersionInfo: object = { - name: "", - app_name: "", - version: "", - git_commit: "", - build_tags: "", - go_version: "", - cosmos_sdk_version: "", -}; +function createBaseVersionInfo(): VersionInfo { + return { + name: "", + appName: "", + version: "", + gitCommit: "", + buildTags: "", + goVersion: "", + buildDeps: [], + cosmosSdkVersion: "", + }; +} export const VersionInfo = { - encode(message: VersionInfo, writer: Writer = Writer.create()): Writer { + encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.app_name !== "") { - writer.uint32(18).string(message.app_name); + if (message.appName !== "") { + writer.uint32(18).string(message.appName); } if (message.version !== "") { writer.uint32(26).string(message.version); } - if (message.git_commit !== "") { - writer.uint32(34).string(message.git_commit); + if (message.gitCommit !== "") { + writer.uint32(34).string(message.gitCommit); } - if (message.build_tags !== "") { - writer.uint32(42).string(message.build_tags); + if (message.buildTags !== "") { + writer.uint32(42).string(message.buildTags); } - if (message.go_version !== "") { - writer.uint32(50).string(message.go_version); + if (message.goVersion !== "") { + writer.uint32(50).string(message.goVersion); } - for (const v of message.build_deps) { + for (const v of message.buildDeps) { Module.encode(v!, writer.uint32(58).fork()).ldelim(); } - if (message.cosmos_sdk_version !== "") { - writer.uint32(66).string(message.cosmos_sdk_version); + if (message.cosmosSdkVersion !== "") { + writer.uint32(66).string(message.cosmosSdkVersion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): VersionInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; + const message = createBaseVersionInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1201,25 +991,25 @@ export const VersionInfo = { message.name = reader.string(); break; case 2: - message.app_name = reader.string(); + message.appName = reader.string(); break; case 3: message.version = reader.string(); break; case 4: - message.git_commit = reader.string(); + message.gitCommit = reader.string(); break; case 5: - message.build_tags = reader.string(); + message.buildTags = reader.string(); break; case 6: - message.go_version = reader.string(); + message.goVersion = reader.string(); break; case 7: - message.build_deps.push(Module.decode(reader, reader.uint32())); + message.buildDeps.push(Module.decode(reader, reader.uint32())); break; case 8: - message.cosmos_sdk_version = reader.string(); + message.cosmosSdkVersion = reader.string(); break; default: reader.skipType(tag & 7); @@ -1230,128 +1020,55 @@ export const VersionInfo = { }, fromJSON(object: any): VersionInfo { - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.app_name !== undefined && object.app_name !== null) { - message.app_name = String(object.app_name); - } else { - message.app_name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.git_commit !== undefined && object.git_commit !== null) { - message.git_commit = String(object.git_commit); - } else { - message.git_commit = ""; - } - if (object.build_tags !== undefined && object.build_tags !== null) { - message.build_tags = String(object.build_tags); - } else { - message.build_tags = ""; - } - if (object.go_version !== undefined && object.go_version !== null) { - message.go_version = String(object.go_version); - } else { - message.go_version = ""; - } - if (object.build_deps !== undefined && object.build_deps !== null) { - for (const e of object.build_deps) { - message.build_deps.push(Module.fromJSON(e)); - } - } - if ( - object.cosmos_sdk_version !== undefined && - object.cosmos_sdk_version !== null - ) { - message.cosmos_sdk_version = String(object.cosmos_sdk_version); - } else { - message.cosmos_sdk_version = ""; - } - return message; + return { + name: isSet(object.name) ? String(object.name) : "", + appName: isSet(object.appName) ? String(object.appName) : "", + version: isSet(object.version) ? String(object.version) : "", + gitCommit: isSet(object.gitCommit) ? String(object.gitCommit) : "", + buildTags: isSet(object.buildTags) ? String(object.buildTags) : "", + goVersion: isSet(object.goVersion) ? String(object.goVersion) : "", + buildDeps: Array.isArray(object?.buildDeps) ? object.buildDeps.map((e: any) => Module.fromJSON(e)) : [], + cosmosSdkVersion: isSet(object.cosmosSdkVersion) ? String(object.cosmosSdkVersion) : "", + }; }, toJSON(message: VersionInfo): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.app_name !== undefined && (obj.app_name = message.app_name); + message.appName !== undefined && (obj.appName = message.appName); message.version !== undefined && (obj.version = message.version); - message.git_commit !== undefined && (obj.git_commit = message.git_commit); - message.build_tags !== undefined && (obj.build_tags = message.build_tags); - message.go_version !== undefined && (obj.go_version = message.go_version); - if (message.build_deps) { - obj.build_deps = message.build_deps.map((e) => - e ? Module.toJSON(e) : undefined - ); + message.gitCommit !== undefined && (obj.gitCommit = message.gitCommit); + message.buildTags !== undefined && (obj.buildTags = message.buildTags); + message.goVersion !== undefined && (obj.goVersion = message.goVersion); + if (message.buildDeps) { + obj.buildDeps = message.buildDeps.map((e) => e ? Module.toJSON(e) : undefined); } else { - obj.build_deps = []; + obj.buildDeps = []; } - message.cosmos_sdk_version !== undefined && - (obj.cosmos_sdk_version = message.cosmos_sdk_version); + message.cosmosSdkVersion !== undefined && (obj.cosmosSdkVersion = message.cosmosSdkVersion); return obj; }, - fromPartial(object: DeepPartial): VersionInfo { - const message = { ...baseVersionInfo } as VersionInfo; - message.build_deps = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.app_name !== undefined && object.app_name !== null) { - message.app_name = object.app_name; - } else { - message.app_name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.git_commit !== undefined && object.git_commit !== null) { - message.git_commit = object.git_commit; - } else { - message.git_commit = ""; - } - if (object.build_tags !== undefined && object.build_tags !== null) { - message.build_tags = object.build_tags; - } else { - message.build_tags = ""; - } - if (object.go_version !== undefined && object.go_version !== null) { - message.go_version = object.go_version; - } else { - message.go_version = ""; - } - if (object.build_deps !== undefined && object.build_deps !== null) { - for (const e of object.build_deps) { - message.build_deps.push(Module.fromPartial(e)); - } - } - if ( - object.cosmos_sdk_version !== undefined && - object.cosmos_sdk_version !== null - ) { - message.cosmos_sdk_version = object.cosmos_sdk_version; - } else { - message.cosmos_sdk_version = ""; - } + fromPartial, I>>(object: I): VersionInfo { + const message = createBaseVersionInfo(); + message.name = object.name ?? ""; + message.appName = object.appName ?? ""; + message.version = object.version ?? ""; + message.gitCommit = object.gitCommit ?? ""; + message.buildTags = object.buildTags ?? ""; + message.goVersion = object.goVersion ?? ""; + message.buildDeps = object.buildDeps?.map((e) => Module.fromPartial(e)) || []; + message.cosmosSdkVersion = object.cosmosSdkVersion ?? ""; return message; }, }; -const baseModule: object = { path: "", version: "", sum: "" }; +function createBaseModule(): Module { + return { path: "", version: "", sum: "" }; +} export const Module = { - encode(message: Module, writer: Writer = Writer.create()): Writer { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.path !== "") { writer.uint32(10).string(message.path); } @@ -1364,10 +1081,10 @@ export const Module = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Module { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModule } as Module; + const message = createBaseModule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1389,50 +1106,358 @@ export const Module = { }, fromJSON(object: any): Module { - const message = { ...baseModule } as Module; - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; + return { + path: isSet(object.path) ? String(object.path) : "", + version: isSet(object.version) ? String(object.version) : "", + sum: isSet(object.sum) ? String(object.sum) : "", + }; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.version !== undefined && (obj.version = message.version); + message.sum !== undefined && (obj.sum = message.sum); + return obj; + }, + + fromPartial, I>>(object: I): Module { + const message = createBaseModule(); + message.path = object.path ?? ""; + message.version = object.version ?? ""; + message.sum = object.sum ?? ""; + return message; + }, +}; + +function createBaseABCIQueryRequest(): ABCIQueryRequest { + return { data: new Uint8Array(), path: "", height: 0, prove: false }; +} + +export const ABCIQueryRequest = { + encode(message: ABCIQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; + if (message.path !== "") { + writer.uint32(18).string(message.path); } - if (object.sum !== undefined && object.sum !== null) { - message.sum = String(object.sum); - } else { - message.sum = ""; + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIQueryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: Module): unknown { + fromJSON(object: any): ABCIQueryRequest { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + path: isSet(object.path) ? String(object.path) : "", + height: isSet(object.height) ? Number(object.height) : 0, + prove: isSet(object.prove) ? Boolean(object.prove) : false, + }; + }, + + toJSON(message: ABCIQueryRequest): unknown { const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.version !== undefined && (obj.version = message.version); - message.sum !== undefined && (obj.sum = message.sum); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.prove !== undefined && (obj.prove = message.prove); return obj; }, - fromPartial(object: DeepPartial): Module { - const message = { ...baseModule } as Module; - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; + fromPartial, I>>(object: I): ABCIQueryRequest { + const message = createBaseABCIQueryRequest(); + message.data = object.data ?? new Uint8Array(); + message.path = object.path ?? ""; + message.height = object.height ?? 0; + message.prove = object.prove ?? false; + return message; + }, +}; + +function createBaseABCIQueryResponse(): ABCIQueryResponse { + return { + code: 0, + log: "", + info: "", + index: 0, + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: 0, + codespace: "", + }; +} + +export const ABCIQueryResponse = { + encode(message: ABCIQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.index !== 0) { + writer.uint32(40).int64(message.index); + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(72).int64(message.height); } - if (object.sum !== undefined && object.sum !== null) { - message.sum = object.sum; + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIQueryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = longToNumber(reader.int64() as Long); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = longToNumber(reader.int64() as Long); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ABCIQueryResponse { + return { + code: isSet(object.code) ? Number(object.code) : 0, + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + index: isSet(object.index) ? Number(object.index) : 0, + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + codespace: isSet(object.codespace) ? String(object.codespace) : "", + }; + }, + + toJSON(message: ABCIQueryResponse): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial, I>>(object: I): ABCIQueryResponse { + const message = createBaseABCIQueryResponse(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.index = object.index ?? 0; + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = (object.proofOps !== undefined && object.proofOps !== null) + ? ProofOps.fromPartial(object.proofOps) + : undefined; + message.height = object.height ?? 0; + message.codespace = object.codespace ?? ""; + return message; + }, +}; + +function createBaseProofOp(): ProofOp { + return { type: "", key: new Uint8Array(), data: new Uint8Array() }; +} + +export const ProofOp = { + encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.key.length !== 0) { + writer.uint32(18).bytes(message.key); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofOp { + return { + type: isSet(object.type) ? String(object.type) : "", + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: ProofOp): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseProofOps(): ProofOps { + return { ops: [] }; +} + +export const ProofOps = { + encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.ops) { + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOps(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofOps { + return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; + }, + + toJSON(message: ProofOps): unknown { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map((e) => e ? ProofOp.toJSON(e) : undefined); } else { - message.sum = ""; + obj.ops = []; } + return obj; + }, + + fromPartial, I>>(object: I): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; return message; }, }; @@ -1444,134 +1469,137 @@ export interface Service { /** GetSyncing queries node syncing. */ GetSyncing(request: GetSyncingRequest): Promise; /** GetLatestBlock returns the latest block. */ - GetLatestBlock( - request: GetLatestBlockRequest - ): Promise; + GetLatestBlock(request: GetLatestBlockRequest): Promise; /** GetBlockByHeight queries block for given height. */ - GetBlockByHeight( - request: GetBlockByHeightRequest - ): Promise; + GetBlockByHeight(request: GetBlockByHeightRequest): Promise; /** GetLatestValidatorSet queries latest validator-set. */ - GetLatestValidatorSet( - request: GetLatestValidatorSetRequest - ): Promise; + GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise; /** GetValidatorSetByHeight queries validator-set at a given height. */ - GetValidatorSetByHeight( - request: GetValidatorSetByHeightRequest - ): Promise; + GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise; + /** + * ABCIQuery defines a query handler that supports ABCI queries directly to the + * application, bypassing Tendermint completely. The ABCI query must contain + * a valid and supported path, including app, custom, p2p, and store. + * + * Since: cosmos-sdk 0.46 + */ + ABCIQuery(request: ABCIQueryRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.GetNodeInfo = this.GetNodeInfo.bind(this); + this.GetSyncing = this.GetSyncing.bind(this); + this.GetLatestBlock = this.GetLatestBlock.bind(this); + this.GetBlockByHeight = this.GetBlockByHeight.bind(this); + this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this); + this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this); + this.ABCIQuery = this.ABCIQuery.bind(this); } GetNodeInfo(request: GetNodeInfoRequest): Promise { const data = GetNodeInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetNodeInfo", - data - ); - return promise.then((data) => GetNodeInfoResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetNodeInfo", data); + return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))); } GetSyncing(request: GetSyncingRequest): Promise { const data = GetSyncingRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetSyncing", - data - ); - return promise.then((data) => GetSyncingResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetSyncing", data); + return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))); } - GetLatestBlock( - request: GetLatestBlockRequest - ): Promise { + GetLatestBlock(request: GetLatestBlockRequest): Promise { const data = GetLatestBlockRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestBlock", - data - ); - return promise.then((data) => - GetLatestBlockResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestBlock", data); + return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))); } - GetBlockByHeight( - request: GetBlockByHeightRequest - ): Promise { + GetBlockByHeight(request: GetBlockByHeightRequest): Promise { const data = GetBlockByHeightRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetBlockByHeight", - data - ); - return promise.then((data) => - GetBlockByHeightResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetBlockByHeight", data); + return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))); } - GetLatestValidatorSet( - request: GetLatestValidatorSetRequest - ): Promise { + GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise { const data = GetLatestValidatorSetRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetLatestValidatorSet", - data - ); - return promise.then((data) => - GetLatestValidatorSetResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestValidatorSet", data); + return promise.then((data) => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); } - GetValidatorSetByHeight( - request: GetValidatorSetByHeightRequest - ): Promise { + GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { const data = GetValidatorSetByHeightRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.base.tendermint.v1beta1.Service", - "GetValidatorSetByHeight", - data - ); - return promise.then((data) => - GetValidatorSetByHeightResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetValidatorSetByHeight", data); + return promise.then((data) => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); + } + + ABCIQuery(request: ABCIQueryRequest): Promise { + const data = ABCIQueryRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "ABCIQuery", data); + return promise.then((data) => ABCIQueryResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +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 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1579,7 +1607,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/types.ts new file mode 100644 index 0000000000..2e0d7d2558 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/types.ts @@ -0,0 +1,443 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { EvidenceList } from "../../../../tendermint/types/evidence"; +import { BlockID, Commit, Data } from "../../../../tendermint/types/types"; +import { Consensus } from "../../../../tendermint/version/types"; + +export const protobufPackage = "cosmos.base.tendermint.v1beta1"; + +/** + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ +export interface Block { + header: Header | undefined; + data: Data | undefined; + evidence: EvidenceList | undefined; + lastCommit: Commit | undefined; +} + +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version: Consensus | undefined; + chainId: string; + height: number; + time: + | Date + | undefined; + /** prev block info */ + lastBlockId: + | BlockID + | undefined; + /** hashes of block data */ + lastCommitHash: Uint8Array; + /** transactions */ + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** + * proposer_address is the original block proposer address, formatted as a Bech32 string. + * In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + * for better UX. + */ + proposerAddress: string; +} + +function createBaseBlock(): Block { + return { header: undefined, data: undefined, evidence: undefined, lastCommit: undefined }; +} + +export const Block = { + encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Block { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Block { + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + data: isSet(object.data) ? Data.fromJSON(object.data) : undefined, + evidence: isSet(object.evidence) ? EvidenceList.fromJSON(object.evidence) : undefined, + lastCommit: isSet(object.lastCommit) ? Commit.fromJSON(object.lastCommit) : undefined, + }; + }, + + toJSON(message: Block): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); + message.lastCommit !== undefined + && (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Block { + const message = createBaseBlock(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Data.fromPartial(object.data) : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceList.fromPartial(object.evidence) + : undefined; + message.lastCommit = (object.lastCommit !== undefined && object.lastCommit !== null) + ? Commit.fromPartial(object.lastCommit) + : undefined; + return message; + }, +}; + +function createBaseHeader(): Header { + return { + version: undefined, + chainId: "", + height: 0, + time: undefined, + lastBlockId: undefined, + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: "", + }; +} + +export const Header = { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== undefined) { + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + } + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); + } + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); + } + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); + } + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); + } + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); + } + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); + } + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); + } + if (message.proposerAddress !== "") { + writer.uint32(114).string(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Header { + return { + version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, + lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(), + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(), + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(), + evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? String(object.proposerAddress) : "", + }; + }, + + toJSON(message: Header): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.lastBlockId !== undefined + && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined + && (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), + )); + message.dataHash !== undefined + && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined + && (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), + )); + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.consensusHash !== undefined + && (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), + )); + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined + && (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), + )); + message.evidenceHash !== undefined + && (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), + )); + message.proposerAddress !== undefined && (obj.proposerAddress = message.proposerAddress); + return obj; + }, + + fromPartial, I>>(object: I): Header { + const message = createBaseHeader(); + message.version = (object.version !== undefined && object.version !== null) + ? Consensus.fromPartial(object.version) + : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.lastBlockId = (object.lastBlockId !== undefined && object.lastBlockId !== null) + ? BlockID.fromPartial(object.lastBlockId) + : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? ""; + 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 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts index d913745384..b690245f0b 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts @@ -1,19 +1,21 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; } -const basePublicKey: object = {}; +function createBasePublicKey(): PublicKey { + return { ed25519: undefined, secp256k1: undefined }; +} export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { + encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); } @@ -23,10 +25,10 @@ export const PublicKey = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; + const message = createBasePublicKey(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -45,87 +47,84 @@ export const PublicKey = { }, fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; + return { + ed25519: isSet(object.ed25519) ? bytesFromBase64(object.ed25519) : undefined, + secp256k1: isSet(object.secp256k1) ? bytesFromBase64(object.secp256k1) : undefined, + }; }, toJSON(message: PublicKey): unknown { const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); + message.ed25519 !== undefined + && (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined + && (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); return obj; }, - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } + fromPartial, I>>(object: I): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/proof.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/proof.ts index a74e0d5153..9ef5ed12aa 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/proof.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/proof.ts @@ -1,14 +1,14 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; export interface Proof { total: number; index: number; - leaf_hash: Uint8Array; + leafHash: Uint8Array; aunts: Uint8Array[]; } @@ -41,18 +41,20 @@ export interface ProofOps { ops: ProofOp[]; } -const baseProof: object = { total: 0, index: 0 }; +function createBaseProof(): Proof { + return { total: 0, index: 0, leafHash: new Uint8Array(), aunts: [] }; +} export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { + encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).int64(message.total); } if (message.index !== 0) { writer.uint32(16).int64(message.index); } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); } for (const v of message.aunts) { writer.uint32(34).bytes(v!); @@ -60,11 +62,10 @@ export const Proof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; + const message = createBaseProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -75,7 +76,7 @@ export const Proof = { message.index = longToNumber(reader.int64() as Long); break; case 3: - message.leaf_hash = reader.bytes(); + message.leafHash = reader.bytes(); break; case 4: message.aunts.push(reader.bytes()); @@ -89,78 +90,44 @@ export const Proof = { }, fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + index: isSet(object.index) ? Number(object.index) : 0, + leafHash: isSet(object.leafHash) ? bytesFromBase64(object.leafHash) : new Uint8Array(), + aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: Proof): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.leafHash !== undefined + && (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.aunts = []; } return obj; }, - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } + fromPartial, I>>(object: I): Proof { + const message = createBaseProof(); + message.total = object.total ?? 0; + message.index = object.index ?? 0; + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map((e) => e) || []; return message; }, }; -const baseValueOp: object = {}; +function createBaseValueOp(): ValueOp { + return { key: new Uint8Array(), proof: undefined }; +} export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { + encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -170,10 +137,10 @@ export const ValueOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; + const message = createBaseValueOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -192,49 +159,34 @@ export const ValueOp = { }, fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: ValueOp): unknown { const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseDominoOp: object = { key: "", input: "", output: "" }; +function createBaseDominoOp(): DominoOp { + return { key: "", input: "", output: "" }; +} export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { + encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -247,10 +199,10 @@ export const DominoOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; + const message = createBaseDominoOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -272,23 +224,11 @@ export const DominoOp = { }, fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; + return { + key: isSet(object.key) ? String(object.key) : "", + input: isSet(object.input) ? String(object.input) : "", + output: isSet(object.output) ? String(object.output) : "", + }; }, toJSON(message: DominoOp): unknown { @@ -299,31 +239,21 @@ export const DominoOp = { return obj; }, - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } + fromPartial, I>>(object: I): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; return message; }, }; -const baseProofOp: object = { type: "" }; +function createBaseProofOp(): ProofOp { + return { type: "", key: new Uint8Array(), data: new Uint8Array() }; +} export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { + encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -336,10 +266,10 @@ export const ProofOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; + const message = createBaseProofOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -361,71 +291,48 @@ export const ProofOp = { }, fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + type: isSet(object.type) ? String(object.type) : "", + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: ProofOp): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>(object: I): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseProofOps: object = {}; +function createBaseProofOps(): ProofOps { + return { ops: [] }; +} export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { + encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; + const message = createBaseProofOps(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -441,82 +348,81 @@ export const ProofOps = { }, fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; + return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; }, toJSON(message: ProofOps): unknown { const obj: any = {}; if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); + obj.ops = message.ops.map((e) => e ? ProofOp.toJSON(e) : undefined); } else { obj.ops = []; } return obj; }, - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -524,7 +430,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/p2p/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/p2p/types.ts index 8a2cb3365e..95302497a6 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/p2p/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/p2p/types.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.p2p"; @@ -18,9 +18,9 @@ export interface ProtocolVersion { } export interface DefaultNodeInfo { - protocol_version: ProtocolVersion | undefined; - default_node_id: string; - listen_addr: string; + protocolVersion: ProtocolVersion | undefined; + defaultNodeId: string; + listenAddr: string; network: string; version: string; channels: Uint8Array; @@ -29,14 +29,16 @@ export interface DefaultNodeInfo { } export interface DefaultNodeInfoOther { - tx_index: string; - rpc_address: string; + txIndex: string; + rpcAddress: string; } -const baseNetAddress: object = { id: "", ip: "", port: 0 }; +function createBaseNetAddress(): NetAddress { + return { id: "", ip: "", port: 0 }; +} export const NetAddress = { - encode(message: NetAddress, writer: Writer = Writer.create()): Writer { + encode(message: NetAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -49,10 +51,10 @@ export const NetAddress = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): NetAddress { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseNetAddress } as NetAddress; + const message = createBaseNetAddress(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -74,58 +76,36 @@ export const NetAddress = { }, fromJSON(object: any): NetAddress { - const message = { ...baseNetAddress } as NetAddress; - if (object.id !== undefined && object.id !== null) { - message.id = String(object.id); - } else { - message.id = ""; - } - if (object.ip !== undefined && object.ip !== null) { - message.ip = String(object.ip); - } else { - message.ip = ""; - } - if (object.port !== undefined && object.port !== null) { - message.port = Number(object.port); - } else { - message.port = 0; - } - return message; + return { + id: isSet(object.id) ? String(object.id) : "", + ip: isSet(object.ip) ? String(object.ip) : "", + port: isSet(object.port) ? Number(object.port) : 0, + }; }, toJSON(message: NetAddress): unknown { const obj: any = {}; message.id !== undefined && (obj.id = message.id); message.ip !== undefined && (obj.ip = message.ip); - message.port !== undefined && (obj.port = message.port); + message.port !== undefined && (obj.port = Math.round(message.port)); return obj; }, - fromPartial(object: DeepPartial): NetAddress { - const message = { ...baseNetAddress } as NetAddress; - if (object.id !== undefined && object.id !== null) { - message.id = object.id; - } else { - message.id = ""; - } - if (object.ip !== undefined && object.ip !== null) { - message.ip = object.ip; - } else { - message.ip = ""; - } - if (object.port !== undefined && object.port !== null) { - message.port = object.port; - } else { - message.port = 0; - } + fromPartial, I>>(object: I): NetAddress { + const message = createBaseNetAddress(); + message.id = object.id ?? ""; + message.ip = object.ip ?? ""; + message.port = object.port ?? 0; return message; }, }; -const baseProtocolVersion: object = { p2p: 0, block: 0, app: 0 }; +function createBaseProtocolVersion(): ProtocolVersion { + return { p2p: 0, block: 0, app: 0 }; +} export const ProtocolVersion = { - encode(message: ProtocolVersion, writer: Writer = Writer.create()): Writer { + encode(message: ProtocolVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.p2p !== 0) { writer.uint32(8).uint64(message.p2p); } @@ -138,10 +118,10 @@ export const ProtocolVersion = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProtocolVersion { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProtocolVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProtocolVersion } as ProtocolVersion; + const message = createBaseProtocolVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -163,75 +143,53 @@ export const ProtocolVersion = { }, fromJSON(object: any): ProtocolVersion { - const message = { ...baseProtocolVersion } as ProtocolVersion; - if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = Number(object.p2p); - } else { - message.p2p = 0; - } - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; + return { + p2p: isSet(object.p2p) ? Number(object.p2p) : 0, + block: isSet(object.block) ? Number(object.block) : 0, + app: isSet(object.app) ? Number(object.app) : 0, + }; }, toJSON(message: ProtocolVersion): unknown { const obj: any = {}; - message.p2p !== undefined && (obj.p2p = message.p2p); - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); + message.p2p !== undefined && (obj.p2p = Math.round(message.p2p)); + message.block !== undefined && (obj.block = Math.round(message.block)); + message.app !== undefined && (obj.app = Math.round(message.app)); return obj; }, - fromPartial(object: DeepPartial): ProtocolVersion { - const message = { ...baseProtocolVersion } as ProtocolVersion; - if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = object.p2p; - } else { - message.p2p = 0; - } - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } + fromPartial, I>>(object: I): ProtocolVersion { + const message = createBaseProtocolVersion(); + message.p2p = object.p2p ?? 0; + message.block = object.block ?? 0; + message.app = object.app ?? 0; return message; }, }; -const baseDefaultNodeInfo: object = { - default_node_id: "", - listen_addr: "", - network: "", - version: "", - moniker: "", -}; +function createBaseDefaultNodeInfo(): DefaultNodeInfo { + return { + protocolVersion: undefined, + defaultNodeId: "", + listenAddr: "", + network: "", + version: "", + channels: new Uint8Array(), + moniker: "", + other: undefined, + }; +} export const DefaultNodeInfo = { - encode(message: DefaultNodeInfo, writer: Writer = Writer.create()): Writer { - if (message.protocol_version !== undefined) { - ProtocolVersion.encode( - message.protocol_version, - writer.uint32(10).fork() - ).ldelim(); + encode(message: DefaultNodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.protocolVersion !== undefined) { + ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } - if (message.default_node_id !== "") { - writer.uint32(18).string(message.default_node_id); + if (message.defaultNodeId !== "") { + writer.uint32(18).string(message.defaultNodeId); } - if (message.listen_addr !== "") { - writer.uint32(26).string(message.listen_addr); + if (message.listenAddr !== "") { + writer.uint32(26).string(message.listenAddr); } if (message.network !== "") { writer.uint32(34).string(message.network); @@ -246,32 +204,26 @@ export const DefaultNodeInfo = { writer.uint32(58).string(message.moniker); } if (message.other !== undefined) { - DefaultNodeInfoOther.encode( - message.other, - writer.uint32(66).fork() - ).ldelim(); + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DefaultNodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; + const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.protocol_version = ProtocolVersion.decode( - reader, - reader.uint32() - ); + message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); break; case 2: - message.default_node_id = reader.string(); + message.defaultNodeId = reader.string(); break; case 3: - message.listen_addr = reader.string(); + message.listenAddr = reader.string(); break; case 4: message.network = reader.string(); @@ -297,162 +249,78 @@ export const DefaultNodeInfo = { }, fromJSON(object: any): DefaultNodeInfo { - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; - if ( - object.protocol_version !== undefined && - object.protocol_version !== null - ) { - message.protocol_version = ProtocolVersion.fromJSON( - object.protocol_version - ); - } else { - message.protocol_version = undefined; - } - if ( - object.default_node_id !== undefined && - object.default_node_id !== null - ) { - message.default_node_id = String(object.default_node_id); - } else { - message.default_node_id = ""; - } - if (object.listen_addr !== undefined && object.listen_addr !== null) { - message.listen_addr = String(object.listen_addr); - } else { - message.listen_addr = ""; - } - if (object.network !== undefined && object.network !== null) { - message.network = String(object.network); - } else { - message.network = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.channels !== undefined && object.channels !== null) { - message.channels = bytesFromBase64(object.channels); - } - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = String(object.moniker); - } else { - message.moniker = ""; - } - if (object.other !== undefined && object.other !== null) { - message.other = DefaultNodeInfoOther.fromJSON(object.other); - } else { - message.other = undefined; - } - return message; + return { + protocolVersion: isSet(object.protocolVersion) ? ProtocolVersion.fromJSON(object.protocolVersion) : undefined, + defaultNodeId: isSet(object.defaultNodeId) ? String(object.defaultNodeId) : "", + listenAddr: isSet(object.listenAddr) ? String(object.listenAddr) : "", + network: isSet(object.network) ? String(object.network) : "", + version: isSet(object.version) ? String(object.version) : "", + channels: isSet(object.channels) ? bytesFromBase64(object.channels) : new Uint8Array(), + moniker: isSet(object.moniker) ? String(object.moniker) : "", + other: isSet(object.other) ? DefaultNodeInfoOther.fromJSON(object.other) : undefined, + }; }, toJSON(message: DefaultNodeInfo): unknown { const obj: any = {}; - message.protocol_version !== undefined && - (obj.protocol_version = message.protocol_version - ? ProtocolVersion.toJSON(message.protocol_version) - : undefined); - message.default_node_id !== undefined && - (obj.default_node_id = message.default_node_id); - message.listen_addr !== undefined && - (obj.listen_addr = message.listen_addr); + message.protocolVersion !== undefined + && (obj.protocolVersion = message.protocolVersion ? ProtocolVersion.toJSON(message.protocolVersion) : undefined); + message.defaultNodeId !== undefined && (obj.defaultNodeId = message.defaultNodeId); + message.listenAddr !== undefined && (obj.listenAddr = message.listenAddr); message.network !== undefined && (obj.network = message.network); message.version !== undefined && (obj.version = message.version); - message.channels !== undefined && - (obj.channels = base64FromBytes( - message.channels !== undefined ? message.channels : new Uint8Array() - )); + message.channels !== undefined + && (obj.channels = base64FromBytes(message.channels !== undefined ? message.channels : new Uint8Array())); message.moniker !== undefined && (obj.moniker = message.moniker); - message.other !== undefined && - (obj.other = message.other - ? DefaultNodeInfoOther.toJSON(message.other) - : undefined); + message.other !== undefined && (obj.other = message.other ? DefaultNodeInfoOther.toJSON(message.other) : undefined); return obj; }, - fromPartial(object: DeepPartial): DefaultNodeInfo { - const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; - if ( - object.protocol_version !== undefined && - object.protocol_version !== null - ) { - message.protocol_version = ProtocolVersion.fromPartial( - object.protocol_version - ); - } else { - message.protocol_version = undefined; - } - if ( - object.default_node_id !== undefined && - object.default_node_id !== null - ) { - message.default_node_id = object.default_node_id; - } else { - message.default_node_id = ""; - } - if (object.listen_addr !== undefined && object.listen_addr !== null) { - message.listen_addr = object.listen_addr; - } else { - message.listen_addr = ""; - } - if (object.network !== undefined && object.network !== null) { - message.network = object.network; - } else { - message.network = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.channels !== undefined && object.channels !== null) { - message.channels = object.channels; - } else { - message.channels = new Uint8Array(); - } - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } else { - message.moniker = ""; - } - if (object.other !== undefined && object.other !== null) { - message.other = DefaultNodeInfoOther.fromPartial(object.other); - } else { - message.other = undefined; - } + fromPartial, I>>(object: I): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); + message.protocolVersion = (object.protocolVersion !== undefined && object.protocolVersion !== null) + ? ProtocolVersion.fromPartial(object.protocolVersion) + : undefined; + message.defaultNodeId = object.defaultNodeId ?? ""; + message.listenAddr = object.listenAddr ?? ""; + message.network = object.network ?? ""; + message.version = object.version ?? ""; + message.channels = object.channels ?? new Uint8Array(); + message.moniker = object.moniker ?? ""; + message.other = (object.other !== undefined && object.other !== null) + ? DefaultNodeInfoOther.fromPartial(object.other) + : undefined; return message; }, }; -const baseDefaultNodeInfoOther: object = { tx_index: "", rpc_address: "" }; +function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { + return { txIndex: "", rpcAddress: "" }; +} export const DefaultNodeInfoOther = { - encode( - message: DefaultNodeInfoOther, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_index !== "") { - writer.uint32(10).string(message.tx_index); + encode(message: DefaultNodeInfoOther, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txIndex !== "") { + writer.uint32(10).string(message.txIndex); } - if (message.rpc_address !== "") { - writer.uint32(18).string(message.rpc_address); + if (message.rpcAddress !== "") { + writer.uint32(18).string(message.rpcAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DefaultNodeInfoOther { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfoOther { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; + const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.tx_index = reader.string(); + message.txIndex = reader.string(); break; case 2: - message.rpc_address = reader.string(); + message.rpcAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -463,88 +331,82 @@ export const DefaultNodeInfoOther = { }, fromJSON(object: any): DefaultNodeInfoOther { - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = String(object.tx_index); - } else { - message.tx_index = ""; - } - if (object.rpc_address !== undefined && object.rpc_address !== null) { - message.rpc_address = String(object.rpc_address); - } else { - message.rpc_address = ""; - } - return message; + return { + txIndex: isSet(object.txIndex) ? String(object.txIndex) : "", + rpcAddress: isSet(object.rpcAddress) ? String(object.rpcAddress) : "", + }; }, toJSON(message: DefaultNodeInfoOther): unknown { const obj: any = {}; - message.tx_index !== undefined && (obj.tx_index = message.tx_index); - message.rpc_address !== undefined && - (obj.rpc_address = message.rpc_address); + message.txIndex !== undefined && (obj.txIndex = message.txIndex); + message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); return obj; }, - fromPartial(object: DeepPartial): DefaultNodeInfoOther { - const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = object.tx_index; - } else { - message.tx_index = ""; - } - if (object.rpc_address !== undefined && object.rpc_address !== null) { - message.rpc_address = object.rpc_address; - } else { - message.rpc_address = ""; - } + fromPartial, I>>(object: I): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); + message.txIndex = object.txIndex ?? ""; + message.rpcAddress = object.rpcAddress ?? ""; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -552,7 +414,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/block.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/block.ts index 38888c856d..e34236067f 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/block.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/block.ts @@ -1,8 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Header, Data, Commit } from "../../tendermint/types/types"; -import { EvidenceList } from "../../tendermint/types/evidence"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { EvidenceList } from "./evidence"; +import { Commit, Data, Header } from "./types"; export const protobufPackage = "tendermint.types"; @@ -10,13 +10,15 @@ export interface Block { header: Header | undefined; data: Data | undefined; evidence: EvidenceList | undefined; - last_commit: Commit | undefined; + lastCommit: Commit | undefined; } -const baseBlock: object = {}; +function createBaseBlock(): Block { + return { header: undefined, data: undefined, evidence: undefined, lastCommit: undefined }; +} export const Block = { - encode(message: Block, writer: Writer = Writer.create()): Writer { + encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -26,16 +28,16 @@ export const Block = { if (message.evidence !== undefined) { EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); } - if (message.last_commit !== undefined) { - Commit.encode(message.last_commit, writer.uint32(34).fork()).ldelim(); + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Block { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Block { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlock } as Block; + const message = createBaseBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -49,7 +51,7 @@ export const Block = { message.evidence = EvidenceList.decode(reader, reader.uint32()); break; case 4: - message.last_commit = Commit.decode(reader, reader.uint32()); + message.lastCommit = Commit.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -60,80 +62,52 @@ export const Block = { }, fromJSON(object: any): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromJSON(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromJSON(object.last_commit); - } else { - message.last_commit = undefined; - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + data: isSet(object.data) ? Data.fromJSON(object.data) : undefined, + evidence: isSet(object.evidence) ? EvidenceList.fromJSON(object.evidence) : undefined, + lastCommit: isSet(object.lastCommit) ? Commit.fromJSON(object.lastCommit) : undefined, + }; }, toJSON(message: Block): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.data !== undefined && - (obj.data = message.data ? Data.toJSON(message.data) : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceList.toJSON(message.evidence) - : undefined); - message.last_commit !== undefined && - (obj.last_commit = message.last_commit - ? Commit.toJSON(message.last_commit) - : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); + message.lastCommit !== undefined + && (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); return obj; }, - fromPartial(object: DeepPartial): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromPartial(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromPartial(object.last_commit); - } else { - message.last_commit = undefined; - } + fromPartial, I>>(object: I): Block { + const message = createBaseBlock(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Data.fromPartial(object.data) : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceList.fromPartial(object.evidence) + : undefined; + message.lastCommit = (object.lastCommit !== undefined && object.lastCommit !== null) + ? Commit.fromPartial(object.lastCommit) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/evidence.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/evidence.ts index 99e6824048..49dd0a8b5d 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/evidence.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/evidence.ts @@ -1,33 +1,33 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Vote, LightBlock } from "../../tendermint/types/types"; -import { Validator } from "../../tendermint/types/validator"; +import { LightBlock, Vote } from "./types"; +import { Validator } from "./validator"; export const protobufPackage = "tendermint.types"; export interface Evidence { - duplicate_vote_evidence: DuplicateVoteEvidence | undefined; - light_client_attack_evidence: LightClientAttackEvidence | undefined; + duplicateVoteEvidence: DuplicateVoteEvidence | undefined; + lightClientAttackEvidence: LightClientAttackEvidence | undefined; } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - vote_a: Vote | undefined; - vote_b: Vote | undefined; - total_voting_power: number; - validator_power: number; + voteA: Vote | undefined; + voteB: Vote | undefined; + totalVotingPower: number; + validatorPower: number; timestamp: Date | undefined; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflicting_block: LightBlock | undefined; - common_height: number; - byzantine_validators: Validator[]; - total_voting_power: number; + conflictingBlock: LightBlock | undefined; + commonHeight: number; + byzantineValidators: Validator[]; + totalVotingPower: number; timestamp: Date | undefined; } @@ -35,43 +35,33 @@ export interface EvidenceList { evidence: Evidence[]; } -const baseEvidence: object = {}; +function createBaseEvidence(): Evidence { + return { duplicateVoteEvidence: undefined, lightClientAttackEvidence: undefined }; +} export const Evidence = { - encode(message: Evidence, writer: Writer = Writer.create()): Writer { - if (message.duplicate_vote_evidence !== undefined) { - DuplicateVoteEvidence.encode( - message.duplicate_vote_evidence, - writer.uint32(10).fork() - ).ldelim(); + encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); } - if (message.light_client_attack_evidence !== undefined) { - LightClientAttackEvidence.encode( - message.light_client_attack_evidence, - writer.uint32(18).fork() - ).ldelim(); + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidence } as Evidence; + const message = createBaseEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.duplicate_vote_evidence = DuplicateVoteEvidence.decode( - reader, - reader.uint32() - ); + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); break; case 2: - message.light_client_attack_evidence = LightClientAttackEvidence.decode( - reader, - reader.uint32() - ); + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -82,123 +72,87 @@ export const Evidence = { }, fromJSON(object: any): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromJSON( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromJSON( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } - return message; + return { + duplicateVoteEvidence: isSet(object.duplicateVoteEvidence) + ? DuplicateVoteEvidence.fromJSON(object.duplicateVoteEvidence) + : undefined, + lightClientAttackEvidence: isSet(object.lightClientAttackEvidence) + ? LightClientAttackEvidence.fromJSON(object.lightClientAttackEvidence) + : undefined, + }; }, toJSON(message: Evidence): unknown { const obj: any = {}; - message.duplicate_vote_evidence !== undefined && - (obj.duplicate_vote_evidence = message.duplicate_vote_evidence - ? DuplicateVoteEvidence.toJSON(message.duplicate_vote_evidence) - : undefined); - message.light_client_attack_evidence !== undefined && - (obj.light_client_attack_evidence = message.light_client_attack_evidence - ? LightClientAttackEvidence.toJSON(message.light_client_attack_evidence) + message.duplicateVoteEvidence !== undefined && (obj.duplicateVoteEvidence = message.duplicateVoteEvidence + ? DuplicateVoteEvidence.toJSON(message.duplicateVoteEvidence) + : undefined); + message.lightClientAttackEvidence !== undefined + && (obj.lightClientAttackEvidence = message.lightClientAttackEvidence + ? LightClientAttackEvidence.toJSON(message.lightClientAttackEvidence) : undefined); return obj; }, - fromPartial(object: DeepPartial): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromPartial( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromPartial( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } + fromPartial, I>>(object: I): Evidence { + const message = createBaseEvidence(); + message.duplicateVoteEvidence = + (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) + ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) + : undefined; + message.lightClientAttackEvidence = + (object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null) + ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) + : undefined; return message; }, }; -const baseDuplicateVoteEvidence: object = { - total_voting_power: 0, - validator_power: 0, -}; +function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { + return { voteA: undefined, voteB: undefined, totalVotingPower: 0, validatorPower: 0, timestamp: undefined }; +} export const DuplicateVoteEvidence = { - encode( - message: DuplicateVoteEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.vote_a !== undefined) { - Vote.encode(message.vote_a, writer.uint32(10).fork()).ldelim(); + encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); } - if (message.vote_b !== undefined) { - Vote.encode(message.vote_b, writer.uint32(18).fork()).ldelim(); + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(24).int64(message.totalVotingPower); } - if (message.validator_power !== 0) { - writer.uint32(32).int64(message.validator_power); + if (message.validatorPower !== 0) { + writer.uint32(32).int64(message.validatorPower); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; + const message = createBaseDuplicateVoteEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vote_a = Vote.decode(reader, reader.uint32()); + message.voteA = Vote.decode(reader, reader.uint32()); break; case 2: - message.vote_b = Vote.decode(reader, reader.uint32()); + message.voteB = Vote.decode(reader, reader.uint32()); break; case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; case 4: - message.validator_power = longToNumber(reader.int64() as Long); + message.validatorPower = longToNumber(reader.int64() as Long); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -209,166 +163,87 @@ export const DuplicateVoteEvidence = { }, fromJSON(object: any): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromJSON(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromJSON(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = Number(object.validator_power); - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; + return { + voteA: isSet(object.voteA) ? Vote.fromJSON(object.voteA) : undefined, + voteB: isSet(object.voteB) ? Vote.fromJSON(object.voteB) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + validatorPower: isSet(object.validatorPower) ? Number(object.validatorPower) : 0, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + }; }, toJSON(message: DuplicateVoteEvidence): unknown { const obj: any = {}; - message.vote_a !== undefined && - (obj.vote_a = message.vote_a ? Vote.toJSON(message.vote_a) : undefined); - message.vote_b !== undefined && - (obj.vote_b = message.vote_b ? Vote.toJSON(message.vote_b) : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.validator_power !== undefined && - (obj.validator_power = message.validator_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); + message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); + message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); + message.validatorPower !== undefined && (obj.validatorPower = Math.round(message.validatorPower)); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); return obj; }, - fromPartial( - object: DeepPartial - ): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromPartial(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromPartial(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = object.validator_power; - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } + fromPartial, I>>(object: I): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + message.voteA = (object.voteA !== undefined && object.voteA !== null) ? Vote.fromPartial(object.voteA) : undefined; + message.voteB = (object.voteB !== undefined && object.voteB !== null) ? Vote.fromPartial(object.voteB) : undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; + message.validatorPower = object.validatorPower ?? 0; + message.timestamp = object.timestamp ?? undefined; return message; }, }; -const baseLightClientAttackEvidence: object = { - common_height: 0, - total_voting_power: 0, -}; +function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { + return { + conflictingBlock: undefined, + commonHeight: 0, + byzantineValidators: [], + totalVotingPower: 0, + timestamp: undefined, + }; +} export const LightClientAttackEvidence = { - encode( - message: LightClientAttackEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.conflicting_block !== undefined) { - LightBlock.encode( - message.conflicting_block, - writer.uint32(10).fork() - ).ldelim(); + encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); } - if (message.common_height !== 0) { - writer.uint32(16).int64(message.common_height); + if (message.commonHeight !== 0) { + writer.uint32(16).int64(message.commonHeight); } - for (const v of message.byzantine_validators) { + for (const v of message.byzantineValidators) { Validator.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(32).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(32).int64(message.totalVotingPower); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): LightClientAttackEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; + const message = createBaseLightClientAttackEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.conflicting_block = LightBlock.decode( - reader, - reader.uint32() - ); + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); break; case 2: - message.common_height = longToNumber(reader.int64() as Long); + message.commonHeight = longToNumber(reader.int64() as Long); break; case 3: - message.byzantine_validators.push( - Validator.decode(reader, reader.uint32()) - ); + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); break; case 4: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -379,134 +254,61 @@ export const LightClientAttackEvidence = { }, fromJSON(object: any): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromJSON(object.conflicting_block); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = Number(object.common_height); - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromJSON(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; + return { + conflictingBlock: isSet(object.conflictingBlock) ? LightBlock.fromJSON(object.conflictingBlock) : undefined, + commonHeight: isSet(object.commonHeight) ? Number(object.commonHeight) : 0, + byzantineValidators: Array.isArray(object?.byzantineValidators) + ? object.byzantineValidators.map((e: any) => Validator.fromJSON(e)) + : [], + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + }; }, toJSON(message: LightClientAttackEvidence): unknown { const obj: any = {}; - message.conflicting_block !== undefined && - (obj.conflicting_block = message.conflicting_block - ? LightBlock.toJSON(message.conflicting_block) - : undefined); - message.common_height !== undefined && - (obj.common_height = message.common_height); - if (message.byzantine_validators) { - obj.byzantine_validators = message.byzantine_validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + message.conflictingBlock !== undefined + && (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); + message.commonHeight !== undefined && (obj.commonHeight = Math.round(message.commonHeight)); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Validator.toJSON(e) : undefined); } else { - obj.byzantine_validators = []; + obj.byzantineValidators = []; } - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); return obj; }, - fromPartial( - object: DeepPartial - ): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromPartial( - object.conflicting_block - ); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = object.common_height; - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromPartial(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } + fromPartial, I>>(object: I): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + message.conflictingBlock = (object.conflictingBlock !== undefined && object.conflictingBlock !== null) + ? LightBlock.fromPartial(object.conflictingBlock) + : undefined; + message.commonHeight = object.commonHeight ?? 0; + message.byzantineValidators = object.byzantineValidators?.map((e) => Validator.fromPartial(e)) || []; + message.totalVotingPower = object.totalVotingPower ?? 0; + message.timestamp = object.timestamp ?? undefined; return message; }, }; -const baseEvidenceList: object = {}; +function createBaseEvidenceList(): EvidenceList { + return { evidence: [] }; +} export const EvidenceList = { - encode(message: EvidenceList, writer: Writer = Writer.create()): Writer { + encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; + const message = createBaseEvidenceList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -522,61 +324,56 @@ export const EvidenceList = { }, fromJSON(object: any): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromJSON(e)); - } - } - return message; + return { evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromJSON(e)) : [] }; }, toJSON(message: EvidenceList): unknown { const obj: any = {}; if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Evidence.toJSON(e) : undefined - ); + obj.evidence = message.evidence.map((e) => e ? Evidence.toJSON(e) : undefined); } else { obj.evidence = []; } return obj; }, - fromPartial(object: DeepPartial): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map((e) => Evidence.fromPartial(e)) || []; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -606,7 +403,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts index 729e016de7..19f6a749c7 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts @@ -1,11 +1,11 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; +import { Proof } from "../crypto/proof"; +import { Consensus } from "../version/types"; +import { ValidatorSet } from "./validator"; export const protobufPackage = "tendermint.types"; @@ -49,8 +49,9 @@ export function blockIDFlagToJSON(object: BlockIDFlag): string { return "BLOCK_ID_FLAG_COMMIT"; case BlockIDFlag.BLOCK_ID_FLAG_NIL: return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -96,8 +97,9 @@ export function signedMsgTypeToJSON(object: SignedMsgType): string { return "SIGNED_MSG_TYPE_PRECOMMIT"; case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -116,36 +118,40 @@ export interface Part { /** BlockID */ export interface BlockID { hash: Uint8Array; - part_set_header: PartSetHeader | undefined; + partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; - chain_id: string; + chainId: string; height: number; - time: Date | undefined; + time: + | Date + | undefined; /** prev block info */ - last_block_id: BlockID | undefined; + lastBlockId: + | BlockID + | undefined; /** hashes of block data */ - last_commit_hash: Uint8Array; + lastCommitHash: Uint8Array; /** transactions */ - data_hash: Uint8Array; + dataHash: Uint8Array; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validatorsHash: Uint8Array; /** validators for the next block */ - next_validators_hash: Uint8Array; + nextValidatorsHash: Uint8Array; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensusHash: Uint8Array; /** state after txs from the previous block */ - app_hash: Uint8Array; + appHash: Uint8Array; /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; + lastResultsHash: Uint8Array; /** consensus info */ - evidence_hash: Uint8Array; + evidenceHash: Uint8Array; /** original proposer of the block */ - proposer_address: Uint8Array; + proposerAddress: Uint8Array; } /** Data contains the set of transactions included in the block */ @@ -167,10 +173,10 @@ export interface Vote { height: number; round: number; /** zero if vote is nil. */ - block_id: BlockID | undefined; + blockId: BlockID | undefined; timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; + validatorAddress: Uint8Array; + validatorIndex: number; signature: Uint8Array; } @@ -178,14 +184,14 @@ export interface Vote { export interface Commit { height: number; round: number; - block_id: BlockID | undefined; + blockId: BlockID | undefined; signatures: CommitSig[]; } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; timestamp: Date | undefined; signature: Uint8Array; } @@ -194,8 +200,8 @@ export interface Proposal { type: SignedMsgType; height: number; round: number; - pol_round: number; - block_id: BlockID | undefined; + polRound: number; + blockId: BlockID | undefined; timestamp: Date | undefined; signature: Uint8Array; } @@ -206,28 +212,30 @@ export interface SignedHeader { } export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; + signedHeader: SignedHeader | undefined; + validatorSet: ValidatorSet | undefined; } export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; + blockId: BlockID | undefined; + blockSize: number; header: Header | undefined; - num_txs: number; + numTxs: number; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { - root_hash: Uint8Array; + rootHash: Uint8Array; data: Uint8Array; proof: Proof | undefined; } -const basePartSetHeader: object = { total: 0 }; +function createBasePartSetHeader(): PartSetHeader { + return { total: 0, hash: new Uint8Array() }; +} export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { + encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).uint32(message.total); } @@ -237,10 +245,10 @@ export const PartSetHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; + const message = createBasePartSetHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -259,48 +267,34 @@ export const PartSetHeader = { }, fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + }; }, toJSON(message: PartSetHeader): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } + fromPartial, I>>(object: I): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); return message; }, }; -const basePart: object = { index: 0 }; +function createBasePart(): Part { + return { index: 0, bytes: new Uint8Array(), proof: undefined }; +} export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { + encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -313,10 +307,10 @@ export const Part = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Part { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; + const message = createBasePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -338,76 +332,50 @@ export const Part = { }, fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + index: isSet(object.index) ? Number(object.index) : 0, + bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: Part): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.bytes !== undefined + && (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseBlockID: object = {}; +function createBaseBlockID(): BlockID { + return { hash: new Uint8Array(), partSetHeader: undefined }; +} export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { + encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; + const message = createBaseBlockID(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -415,10 +383,7 @@ export const BlockID = { message.hash = reader.bytes(); break; case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -429,111 +394,101 @@ export const BlockID = { }, fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + partSetHeader: isSet(object.partSetHeader) ? PartSetHeader.fromJSON(object.partSetHeader) : undefined, + }; }, toJSON(message: BlockID): unknown { const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined + && (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); return obj; }, - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } + fromPartial, I>>(object: I): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = (object.partSetHeader !== undefined && object.partSetHeader !== null) + ? PartSetHeader.fromPartial(object.partSetHeader) + : undefined; return message; }, }; -const baseHeader: object = { chain_id: "", height: 0 }; +function createBaseHeader(): Header { + return { + version: undefined, + chainId: "", + height: 0, + time: undefined, + lastBlockId: undefined, + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); } if (message.height !== 0) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; + const message = createBaseHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -541,45 +496,43 @@ export const Header = { message.version = Consensus.decode(reader, reader.uint32()); break; case 2: - message.chain_id = reader.string(); + message.chainId = reader.string(); break; case 3: message.height = longToNumber(reader.int64() as Long); break; case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); + message.lastBlockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.last_commit_hash = reader.bytes(); + message.lastCommitHash = reader.bytes(); break; case 7: - message.data_hash = reader.bytes(); + message.dataHash = reader.bytes(); break; case 8: - message.validators_hash = reader.bytes(); + message.validatorsHash = reader.bytes(); break; case 9: - message.next_validators_hash = reader.bytes(); + message.nextValidatorsHash = reader.bytes(); break; case 10: - message.consensus_hash = reader.bytes(); + message.consensusHash = reader.bytes(); break; case 11: - message.app_hash = reader.bytes(); + message.appHash = reader.bytes(); break; case 12: - message.last_results_hash = reader.bytes(); + message.lastResultsHash = reader.bytes(); break; case 13: - message.evidence_hash = reader.bytes(); + message.evidenceHash = reader.bytes(); break; case 14: - message.proposer_address = reader.bytes(); + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -590,253 +543,109 @@ export const Header = { }, fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; + return { + version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, + lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(), + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(), + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(), + evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; }, toJSON(message: Header): unknown { const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() + message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.lastBlockId !== undefined + && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined + && (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() + message.dataHash !== undefined + && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined + && (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() + message.consensusHash !== undefined + && (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined + && (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() + message.evidenceHash !== undefined + && (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), )); return obj; }, - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } + fromPartial, I>>(object: I): Header { + const message = createBaseHeader(); + message.version = (object.version !== undefined && object.version !== null) + ? Consensus.fromPartial(object.version) + : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.lastBlockId = (object.lastBlockId !== undefined && object.lastBlockId !== null) + ? BlockID.fromPartial(object.lastBlockId) + : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, }; -const baseData: object = {}; +function createBaseData(): Data { + return { txs: [] }; +} export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { + encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; + const message = createBaseData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -852,44 +661,41 @@ export const Data = { }, fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; + return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; }, toJSON(message: Data): unknown { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.txs = []; } return obj; }, - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } + fromPartial, I>>(object: I): Data { + const message = createBaseData(); + message.txs = object.txs?.map((e) => e) || []; return message; }, }; -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; +function createBaseVote(): Vote { + return { + type: 0, + height: 0, + round: 0, + blockId: undefined, + timestamp: undefined, + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array(), + }; +} export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -899,20 +705,17 @@ export const Vote = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); } if (message.signature.length !== 0) { writer.uint32(66).bytes(message.signature); @@ -920,10 +723,10 @@ export const Vote = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; + const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -937,18 +740,16 @@ export const Vote = { message.round = reader.int32(); break; case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 6: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 7: - message.validator_index = reader.int32(); + message.validatorIndex = reader.int32(); break; case 8: message.signature = reader.bytes(); @@ -962,146 +763,65 @@ export const Vote = { }, fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + validatorIndex: isSet(object.validatorIndex) ? Number(object.validatorIndex) : 0, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.validatorIndex !== undefined && (obj.validatorIndex = Math.round(message.validatorIndex)); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.validatorIndex = object.validatorIndex ?? 0; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseCommit: object = { height: 0, round: 0 }; +function createBaseCommit(): Commit { + return { height: 0, round: 0, blockId: undefined, signatures: [] }; +} export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { + encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } if (message.round !== 0) { writer.uint32(16).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); } for (const v of message.signatures) { CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); @@ -1109,11 +829,10 @@ export const Commit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Commit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; + const message = createBaseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1124,7 +843,7 @@ export const Commit = { message.round = reader.int32(); break; case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 4: message.signatures.push(CommitSig.decode(reader, reader.uint32())); @@ -1138,91 +857,53 @@ export const Commit = { }, fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) : [], + }; }, toJSON(message: Commit): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); + obj.signatures = message.signatures.map((e) => e ? CommitSig.toJSON(e) : undefined); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Commit { + const message = createBaseCommit(); + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.signatures = object.signatures?.map((e) => CommitSig.fromPartial(e)) || []; return message; }, }; -const baseCommitSig: object = { block_id_flag: 0 }; +function createBaseCommitSig(): CommitSig { + return { blockIdFlag: 0, validatorAddress: new Uint8Array(), timestamp: undefined, signature: new Uint8Array() }; +} export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); + encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(34).bytes(message.signature); @@ -1230,23 +911,21 @@ export const CommitSig = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; + const message = createBaseCommitSig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id_flag = reader.int32() as any; + message.blockIdFlag = reader.int32() as any; break; case 2: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 4: message.signature = reader.bytes(); @@ -1260,84 +939,51 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: CommitSig): unknown { const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; +function createBaseProposal(): Proposal { + return { + type: 0, + height: 0, + round: 0, + polRound: 0, + blockId: undefined, + timestamp: undefined, + signature: new Uint8Array(), + }; +} export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -1347,17 +993,14 @@ export const Proposal = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(58).bytes(message.signature); @@ -1365,10 +1008,10 @@ export const Proposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; + const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1382,15 +1025,13 @@ export const Proposal = { message.round = reader.int32(); break; case 4: - message.pol_round = reader.int32(); + message.polRound = reader.int32(); break; case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.signature = reader.bytes(); @@ -1404,111 +1045,51 @@ export const Proposal = { }, fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + polRound: isSet(object.polRound) ? Number(object.polRound) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseSignedHeader: object = {}; +function createBaseSignedHeader(): SignedHeader { + return { header: undefined, commit: undefined }; +} export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { + encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -1518,10 +1099,10 @@ export const SignedHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; + const message = createBaseSignedHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1540,76 +1121,58 @@ export const SignedHeader = { }, fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + commit: isSet(object.commit) ? Commit.fromJSON(object.commit) : undefined, + }; }, toJSON(message: SignedHeader): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); return obj; }, - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } + fromPartial, I>>(object: I): SignedHeader { + const message = createBaseSignedHeader(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? Commit.fromPartial(object.commit) + : undefined; return message; }, }; -const baseLightBlock: object = {}; +function createBaseLightBlock(): LightBlock { + return { signedHeader: undefined, validatorSet: undefined }; +} export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); + encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; + const message = createBaseLightBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); break; case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1620,86 +1183,72 @@ export const LightBlock = { }, fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; + return { + signedHeader: isSet(object.signedHeader) ? SignedHeader.fromJSON(object.signedHeader) : undefined, + validatorSet: isSet(object.validatorSet) ? ValidatorSet.fromJSON(object.validatorSet) : undefined, + }; }, toJSON(message: LightBlock): unknown { const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); + message.signedHeader !== undefined + && (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined + && (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); return obj; }, - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } + fromPartial, I>>(object: I): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = (object.signedHeader !== undefined && object.signedHeader !== null) + ? SignedHeader.fromPartial(object.signedHeader) + : undefined; + message.validatorSet = (object.validatorSet !== undefined && object.validatorSet !== null) + ? ValidatorSet.fromPartial(object.validatorSet) + : undefined; return message; }, }; -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; +function createBaseBlockMeta(): BlockMeta { + return { blockId: undefined, blockSize: 0, header: undefined, numTxs: 0 }; +} export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); + encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); + if (message.blockSize !== 0) { + writer.uint32(16).int64(message.blockSize); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(26).fork()).ldelim(); } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); + if (message.numTxs !== 0) { + writer.uint32(32).int64(message.numTxs); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; + const message = createBaseBlockMeta(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.block_size = longToNumber(reader.int64() as Long); + message.blockSize = longToNumber(reader.int64() as Long); break; case 3: message.header = Header.decode(reader, reader.uint32()); break; case 4: - message.num_txs = longToNumber(reader.int64() as Long); + message.numTxs = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -1710,75 +1259,45 @@ export const BlockMeta = { }, fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + blockSize: isSet(object.blockSize) ? Number(object.blockSize) : 0, + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + numTxs: isSet(object.numTxs) ? Number(object.numTxs) : 0, + }; }, toJSON(message: BlockMeta): unknown { const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.blockSize !== undefined && (obj.blockSize = Math.round(message.blockSize)); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = Math.round(message.numTxs)); return obj; }, - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } + fromPartial, I>>(object: I): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.blockSize = object.blockSize ?? 0; + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.numTxs = object.numTxs ?? 0; return message; }, }; -const baseTxProof: object = {}; +function createBaseTxProof(): TxProof { + return { rootHash: new Uint8Array(), data: new Uint8Array(), proof: undefined }; +} export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); + encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -1789,15 +1308,15 @@ export const TxProof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; + const message = createBaseTxProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.root_hash = reader.bytes(); + message.rootHash = reader.bytes(); break; case 2: message.data = reader.bytes(); @@ -1814,101 +1333,87 @@ export const TxProof = { }, fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + rootHash: isSet(object.rootHash) ? bytesFromBase64(object.rootHash) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: TxProof): unknown { const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.rootHash !== undefined + && (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -1938,7 +1443,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/validator.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/validator.ts index d1375eb3f0..f7c906ca4c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/validator.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/types/validator.ts @@ -1,50 +1,51 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PublicKey } from "../crypto/keys"; export const protobufPackage = "tendermint.types"; export interface ValidatorSet { validators: Validator[]; proposer: Validator | undefined; - total_voting_power: number; + totalVotingPower: number; } export interface Validator { address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; + pubKey: PublicKey | undefined; + votingPower: number; + proposerPriority: number; } export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; + pubKey: PublicKey | undefined; + votingPower: number; } -const baseValidatorSet: object = { total_voting_power: 0 }; +function createBaseValidatorSet(): ValidatorSet { + return { validators: [], proposer: undefined, totalVotingPower: 0 }; +} export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { + encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.proposer !== undefined) { Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(24).int64(message.totalVotingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; + const message = createBaseValidatorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -55,7 +56,7 @@ export const ValidatorSet = { message.proposer = Validator.decode(reader, reader.uint32()); break; case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -66,95 +67,62 @@ export const ValidatorSet = { }, fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + }; }, toJSON(message: ValidatorSet): unknown { const obj: any = {}; if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); + message.proposer !== undefined + && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); return obj; }, - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } + fromPartial, I>>(object: I): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.proposer = (object.proposer !== undefined && object.proposer !== null) + ? Validator.fromPartial(object.proposer) + : undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; return message; }, }; -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; +function createBaseValidator(): Validator { + return { address: new Uint8Array(), pubKey: undefined, votingPower: 0, proposerPriority: 0 }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(24).int64(message.votingPower); } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); + if (message.proposerPriority !== 0) { + writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -162,13 +130,13 @@ export const Validator = { message.address = reader.bytes(); break; case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 3: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); + message.proposerPriority = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -179,102 +147,63 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0, + }; }, toJSON(message: Validator): unknown { const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); + message.address !== undefined + && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); + message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority)); return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 0; + message.proposerPriority = object.proposerPriority ?? 0; return message; }, }; -const baseSimpleValidator: object = { voting_power: 0 }; +function createBaseSimpleValidator(): SimpleValidator { + return { pubKey: undefined, votingPower: 0 }; +} export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); + encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(16).int64(message.votingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; + const message = createBaseSimpleValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -285,91 +214,84 @@ export const SimpleValidator = { }, fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + }; }, toJSON(message: SimpleValidator): unknown { const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); return obj; }, - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } + fromPartial, I>>(object: I): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -377,7 +299,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/version/types.ts b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/version/types.ts index e40744b8e8..501ddcdb86 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/version/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.base.tendermint.v1beta1/types/tendermint/version/types.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.version"; @@ -25,10 +25,12 @@ export interface Consensus { app: number; } -const baseApp: object = { protocol: 0, software: "" }; +function createBaseApp(): App { + return { protocol: 0, software: "" }; +} export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { + encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.protocol !== 0) { writer.uint32(8).uint64(message.protocol); } @@ -38,10 +40,10 @@ export const App = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): App { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; + const message = createBaseApp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -60,47 +62,33 @@ export const App = { }, fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; + return { + protocol: isSet(object.protocol) ? Number(object.protocol) : 0, + software: isSet(object.software) ? String(object.software) : "", + }; }, toJSON(message: App): unknown { const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); + message.protocol !== undefined && (obj.protocol = Math.round(message.protocol)); message.software !== undefined && (obj.software = message.software); return obj; }, - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } + fromPartial, I>>(object: I): App { + const message = createBaseApp(); + message.protocol = object.protocol ?? 0; + message.software = object.software ?? ""; return message; }, }; -const baseConsensus: object = { block: 0, app: 0 }; +function createBaseConsensus(): Consensus { + return { block: 0, app: 0 }; +} export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { + encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block !== 0) { writer.uint32(8).uint64(message.block); } @@ -110,10 +98,10 @@ export const Consensus = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; + const message = createBaseConsensus(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -132,64 +120,54 @@ export const Consensus = { }, fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; + return { block: isSet(object.block) ? Number(object.block) : 0, app: isSet(object.app) ? Number(object.app) : 0 }; }, toJSON(message: Consensus): unknown { const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); + message.block !== undefined && (obj.block = Math.round(message.block)); + message.app !== undefined && (obj.app = Math.round(message.app)); return obj; }, - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } + fromPartial, I>>(object: I): Consensus { + const message = createBaseConsensus(); + message.block = object.block ?? 0; + message.app = object.app ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -197,7 +175,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/module.ts new file mode 100755 index 0000000000..e96eb410b8 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/module.ts @@ -0,0 +1,130 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgUpdateParams } from "./types/cosmos/consensus/v1/tx"; + + +export { MsgUpdateParams }; + +type sendMsgUpdateParamsParams = { + value: MsgUpdateParams, + fee?: StdFee, + memo?: string +}; + + +type msgUpdateParamsParams = { + value: MsgUpdateParams, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message) + } + }, + + + msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject { + try { + return { typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosConsensusV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/registry.ts new file mode 100755 index 0000000000..197c9a9f8f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/registry.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./types/cosmos/consensus/v1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.consensus.v1.MsgUpdateParams", MsgUpdateParams], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/rest.ts new file mode 100644 index 0000000000..18aaae66e2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/rest.ts @@ -0,0 +1,269 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** + * BlockParams contains limits on the block size. + */ +export interface TypesBlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + * @format int64 + */ + max_bytes?: string; + + /** + * Max gas per block. + * Note: must be greater or equal to -1 + * @format int64 + */ + max_gas?: string; +} + +/** +* ConsensusParams contains consensus critical parameters that determine the +validity of blocks. +*/ +export interface TypesConsensusParams { + /** BlockParams contains limits on the block size. */ + block?: TypesBlockParams; + + /** EvidenceParams determine how we handle evidence of malfeasance. */ + evidence?: TypesEvidenceParams; + + /** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ + validator?: TypesValidatorParams; + + /** VersionParams contains the ABCI application version. */ + version?: TypesVersionParams; +} + +/** + * EvidenceParams determine how we handle evidence of malfeasance. + */ +export interface TypesEvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + * @format int64 + */ + max_age_num_blocks?: string; + + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + max_age_duration?: string; + + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + * @format int64 + */ + max_bytes?: string; +} + +/** +* ValidatorParams restrict the public key types validators can use. +NOTE: uses ABCI pubkey naming, not Amino names. +*/ +export interface TypesValidatorParams { + pub_key_types?: string[]; +} + +/** + * VersionParams contains the ABCI application version. + */ +export interface TypesVersionParams { + /** @format uint64 */ + app?: string; +} + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. +*/ +export type V1MsgUpdateParamsResponse = object; + +/** + * QueryParamsResponse defines the response type for querying x/consensus parameters. + */ +export interface V1QueryParamsResponse { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: TypesConsensusParams; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title cosmos/consensus/v1/query.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Params queries the parameters of x/consensus_param module. + * @request GET:/cosmos/consensus/v1/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/cosmos/consensus/v1/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types.ts new file mode 100755 index 0000000000..d5b4a888a6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types.ts @@ -0,0 +1,6 @@ +//@ts-nocheck + + +export { + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/query.ts new file mode 100644 index 0000000000..329da43694 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/query.ts @@ -0,0 +1,148 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { ConsensusParams } from "../../../tendermint/types/params"; + +export const protobufPackage = "cosmos.consensus.v1"; + +/** Since: cosmos-sdk 0.47 */ + +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequest { +} + +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponse { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params: ConsensusParams | undefined; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + ConsensusParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsensusParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { params: isSet(object.params) ? ConsensusParams.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? ConsensusParams.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? ConsensusParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the parameters of x/consensus_param module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/tx.ts new file mode 100644 index 0000000000..b5402e96ad --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/consensus/v1/tx.ts @@ -0,0 +1,197 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { BlockParams, EvidenceParams, ValidatorParams } from "../../../tendermint/types/params"; + +export const protobufPackage = "cosmos.consensus.v1"; + +/** Since: cosmos-sdk 0.47 */ + +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block: BlockParams | undefined; + evidence: EvidenceParams | undefined; + validator: ValidatorParams | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", block: undefined, evidence: undefined, validator: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 4: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, + evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, + validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.block = (object.block !== undefined && object.block !== null) + ? BlockParams.fromPartial(object.block) + : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceParams.fromPartial(object.evidence) + : undefined; + message.validator = (object.validator !== undefined && object.validator !== null) + ? ValidatorParams.fromPartial(object.validator) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +/** Msg defines the bank Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UpdateParams = this.UpdateParams.bind(this); + } + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/gogoproto/gogo.ts similarity index 100% rename from wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/gogoproto/gogo.ts rename to wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/gogoproto/gogo.ts diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/duration.ts new file mode 100644 index 0000000000..01ce7b0bf9 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/google/protobuf/duration.ts @@ -0,0 +1,188 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Duration = { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/tendermint/types/params.ts b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/tendermint/types/params.ts new file mode 100644 index 0000000000..10f3a925b3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.consensus.v1/types/tendermint/types/params.ts @@ -0,0 +1,499 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../google/protobuf/duration"; + +export const protobufPackage = "tendermint.types"; + +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block: BlockParams | undefined; + evidence: EvidenceParams | undefined; + validator: ValidatorParams | undefined; + version: VersionParams | undefined; +} + +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: number; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: number; +} + +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: number; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration: + | Duration + | undefined; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: number; +} + +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} + +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + app: number; +} + +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: number; + blockMaxGas: number; +} + +function createBaseConsensusParams(): ConsensusParams { + return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; +} + +export const ConsensusParams = { + encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusParams { + return { + block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, + evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, + validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, + version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined, + }; + }, + + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined + && (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusParams { + const message = createBaseConsensusParams(); + message.block = (object.block !== undefined && object.block !== null) + ? BlockParams.fromPartial(object.block) + : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceParams.fromPartial(object.evidence) + : undefined; + message.validator = (object.validator !== undefined && object.validator !== null) + ? ValidatorParams.fromPartial(object.validator) + : undefined; + message.version = (object.version !== undefined && object.version !== null) + ? VersionParams.fromPartial(object.version) + : undefined; + return message; + }, +}; + +function createBaseBlockParams(): BlockParams { + return { maxBytes: 0, maxGas: 0 }; +} + +export const BlockParams = { + encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxBytes !== 0) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== 0) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxGas = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockParams { + return { + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + maxGas: isSet(object.maxGas) ? Number(object.maxGas) : 0, + }; + }, + + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); + message.maxGas !== undefined && (obj.maxGas = Math.round(message.maxGas)); + return obj; + }, + + fromPartial, I>>(object: I): BlockParams { + const message = createBaseBlockParams(); + message.maxBytes = object.maxBytes ?? 0; + message.maxGas = object.maxGas ?? 0; + return message; + }, +}; + +function createBaseEvidenceParams(): EvidenceParams { + return { maxAgeNumBlocks: 0, maxAgeDuration: undefined, maxBytes: 0 }; +} + +export const EvidenceParams = { + encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxAgeNumBlocks !== 0) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBytes !== 0) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EvidenceParams { + return { + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? Number(object.maxAgeNumBlocks) : 0, + maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + }; + }, + + toJSON(message: EvidenceParams): unknown { + const obj: any = {}; + message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = Math.round(message.maxAgeNumBlocks)); + message.maxAgeDuration !== undefined + && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); + return obj; + }, + + fromPartial, I>>(object: I): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks ?? 0; + message.maxAgeDuration = (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) + ? Duration.fromPartial(object.maxAgeDuration) + : undefined; + message.maxBytes = object.maxBytes ?? 0; + return message; + }, +}; + +function createBaseValidatorParams(): ValidatorParams { + return { pubKeyTypes: [] }; +} + +export const ValidatorParams = { + encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorParams { + return { pubKeyTypes: Array.isArray(object?.pubKeyTypes) ? object.pubKeyTypes.map((e: any) => String(e)) : [] }; + }, + + toJSON(message: ValidatorParams): unknown { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); + } else { + obj.pubKeyTypes = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || []; + return message; + }, +}; + +function createBaseVersionParams(): VersionParams { + return { app: 0 }; +} + +export const VersionParams = { + encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.app !== 0) { + writer.uint32(8).uint64(message.app); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.app = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VersionParams { + return { app: isSet(object.app) ? Number(object.app) : 0 }; + }, + + toJSON(message: VersionParams): unknown { + const obj: any = {}; + message.app !== undefined && (obj.app = Math.round(message.app)); + return obj; + }, + + fromPartial, I>>(object: I): VersionParams { + const message = createBaseVersionParams(); + message.app = object.app ?? 0; + return message; + }, +}; + +function createBaseHashedParams(): HashedParams { + return { blockMaxBytes: 0, blockMaxGas: 0 }; +} + +export const HashedParams = { + encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockMaxBytes !== 0) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (message.blockMaxGas !== 0) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHashedParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.blockMaxGas = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HashedParams { + return { + blockMaxBytes: isSet(object.blockMaxBytes) ? Number(object.blockMaxBytes) : 0, + blockMaxGas: isSet(object.blockMaxGas) ? Number(object.blockMaxGas) : 0, + }; + }, + + toJSON(message: HashedParams): unknown { + const obj: any = {}; + message.blockMaxBytes !== undefined && (obj.blockMaxBytes = Math.round(message.blockMaxBytes)); + message.blockMaxGas !== undefined && (obj.blockMaxGas = Math.round(message.blockMaxGas)); + return obj; + }, + + fromPartial, I>>(object: I): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes ?? 0; + message.blockMaxGas = object.blockMaxGas ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/index.ts index a1f2388d02..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/index.ts @@ -1,61 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgVerifyInvariant } from "./types/cosmos/crisis/v1beta1/tx"; - - -const types = [ - ["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgVerifyInvariant: (data: MsgVerifyInvariant): EncodeObject => ({ typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value: MsgVerifyInvariant.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/module.ts new file mode 100755 index 0000000000..ef168582ad --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/module.ts @@ -0,0 +1,163 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgVerifyInvariant } from "./types/cosmos/crisis/v1beta1/tx"; +import { MsgUpdateParams } from "./types/cosmos/crisis/v1beta1/tx"; + + +export { MsgVerifyInvariant, MsgUpdateParams }; + +type sendMsgVerifyInvariantParams = { + value: MsgVerifyInvariant, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateParamsParams = { + value: MsgUpdateParams, + fee?: StdFee, + memo?: string +}; + + +type msgVerifyInvariantParams = { + value: MsgVerifyInvariant, +}; + +type msgUpdateParamsParams = { + value: MsgUpdateParams, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgVerifyInvariant({ value, fee, memo }: sendMsgVerifyInvariantParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgVerifyInvariant: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgVerifyInvariant({ value: MsgVerifyInvariant.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgVerifyInvariant: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message) + } + }, + + + msgVerifyInvariant({ value }: msgVerifyInvariantParams): EncodeObject { + try { + return { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value: MsgVerifyInvariant.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgVerifyInvariant: Could not create message: ' + e.message) + } + }, + + msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject { + try { + return { typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosCrisisV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/registry.ts new file mode 100755 index 0000000000..dbba0189b8 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/registry.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgVerifyInvariant } from "./types/cosmos/crisis/v1beta1/tx"; +import { MsgUpdateParams } from "./types/cosmos/crisis/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant], + ["/cosmos.crisis.v1beta1.MsgUpdateParams", MsgUpdateParams], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/rest.ts index 6489051f8c..c11706cb7f 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/rest.ts @@ -21,15 +21,35 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* 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 V1Beta1Coin { + denom?: string; + amount?: string; +} + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ export type V1Beta1MsgVerifyInvariantResponse = object; +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -39,30 +59,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -70,149 +81,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types.ts new file mode 100755 index 0000000000..d5b4a888a6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types.ts @@ -0,0 +1,6 @@ +//@ts-nocheck + + +export { + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/genesis.ts index 7181f3c1f3..cc8e87fd11 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/genesis.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.crisis.v1beta1"; @@ -11,28 +11,30 @@ export interface GenesisState { * constant_fee is the fee used to verify the invariant in the crisis * module. */ - constant_fee: Coin | undefined; + constantFee: Coin | undefined; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { constantFee: undefined }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.constant_fee !== undefined) { - Coin.encode(message.constant_fee, writer.uint32(26).fork()).ldelim(); + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.constantFee !== undefined) { + Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: - message.constant_fee = Coin.decode(reader, reader.uint32()); + message.constantFee = Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -43,42 +45,36 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.constant_fee !== undefined && object.constant_fee !== null) { - message.constant_fee = Coin.fromJSON(object.constant_fee); - } else { - message.constant_fee = undefined; - } - return message; + return { constantFee: isSet(object.constantFee) ? Coin.fromJSON(object.constantFee) : undefined }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.constant_fee !== undefined && - (obj.constant_fee = message.constant_fee - ? Coin.toJSON(message.constant_fee) - : undefined); + message.constantFee !== undefined + && (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.constant_fee !== undefined && object.constant_fee !== null) { - message.constant_fee = Coin.fromPartial(object.constant_fee); - } else { - message.constant_fee = undefined; - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.constantFee = (object.constantFee !== undefined && object.constantFee !== null) + ? Coin.fromPartial(object.constantFee) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts index 3fb934459c..710c36a332 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts @@ -1,46 +1,67 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.crisis.v1beta1"; /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariant { + /** sender is the account address of private key to send coins to fee collector account. */ sender: string; - invariant_module_name: string; - invariant_route: string; + /** name of the invariant module. */ + invariantModuleName: string; + /** invariant_route is the msg's invariant route. */ + invariantRoute: string; } /** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ -export interface MsgVerifyInvariantResponse {} +export interface MsgVerifyInvariantResponse { +} -const baseMsgVerifyInvariant: object = { - sender: "", - invariant_module_name: "", - invariant_route: "", -}; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** constant_fee defines the x/crisis parameter. */ + constantFee: Coin | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgVerifyInvariant(): MsgVerifyInvariant { + return { sender: "", invariantModuleName: "", invariantRoute: "" }; +} export const MsgVerifyInvariant = { - encode( - message: MsgVerifyInvariant, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.invariant_module_name !== "") { - writer.uint32(18).string(message.invariant_module_name); + if (message.invariantModuleName !== "") { + writer.uint32(18).string(message.invariantModuleName); } - if (message.invariant_route !== "") { - writer.uint32(26).string(message.invariant_route); + if (message.invariantRoute !== "") { + writer.uint32(26).string(message.invariantRoute); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgVerifyInvariant { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; + const message = createBaseMsgVerifyInvariant(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -48,10 +69,10 @@ export const MsgVerifyInvariant = { message.sender = reader.string(); break; case 2: - message.invariant_module_name = reader.string(); + message.invariantModuleName = reader.string(); break; case 3: - message.invariant_route = reader.string(); + message.invariantRoute = reader.string(); break; default: reader.skipType(tag & 7); @@ -62,87 +83,43 @@ export const MsgVerifyInvariant = { }, fromJSON(object: any): MsgVerifyInvariant { - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if ( - object.invariant_module_name !== undefined && - object.invariant_module_name !== null - ) { - message.invariant_module_name = String(object.invariant_module_name); - } else { - message.invariant_module_name = ""; - } - if ( - object.invariant_route !== undefined && - object.invariant_route !== null - ) { - message.invariant_route = String(object.invariant_route); - } else { - message.invariant_route = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + invariantModuleName: isSet(object.invariantModuleName) ? String(object.invariantModuleName) : "", + invariantRoute: isSet(object.invariantRoute) ? String(object.invariantRoute) : "", + }; }, toJSON(message: MsgVerifyInvariant): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.invariant_module_name !== undefined && - (obj.invariant_module_name = message.invariant_module_name); - message.invariant_route !== undefined && - (obj.invariant_route = message.invariant_route); + message.invariantModuleName !== undefined && (obj.invariantModuleName = message.invariantModuleName); + message.invariantRoute !== undefined && (obj.invariantRoute = message.invariantRoute); return obj; }, - fromPartial(object: DeepPartial): MsgVerifyInvariant { - const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if ( - object.invariant_module_name !== undefined && - object.invariant_module_name !== null - ) { - message.invariant_module_name = object.invariant_module_name; - } else { - message.invariant_module_name = ""; - } - if ( - object.invariant_route !== undefined && - object.invariant_route !== null - ) { - message.invariant_route = object.invariant_route; - } else { - message.invariant_route = ""; - } + fromPartial, I>>(object: I): MsgVerifyInvariant { + const message = createBaseMsgVerifyInvariant(); + message.sender = object.sender ?? ""; + message.invariantModuleName = object.invariantModuleName ?? ""; + message.invariantRoute = object.invariantRoute ?? ""; return message; }, }; -const baseMsgVerifyInvariantResponse: object = {}; +function createBaseMsgVerifyInvariantResponse(): MsgVerifyInvariantResponse { + return {}; +} export const MsgVerifyInvariantResponse = { - encode( - _: MsgVerifyInvariantResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgVerifyInvariantResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; + const message = createBaseMsgVerifyInvariantResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -155,10 +132,7 @@ export const MsgVerifyInvariantResponse = { }, fromJSON(_: any): MsgVerifyInvariantResponse { - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; - return message; + return {}; }, toJSON(_: MsgVerifyInvariantResponse): unknown { @@ -166,59 +140,160 @@ export const MsgVerifyInvariantResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgVerifyInvariantResponse { - const message = { - ...baseMsgVerifyInvariantResponse, - } as MsgVerifyInvariantResponse; + fromPartial, I>>(_: I): MsgVerifyInvariantResponse { + const message = createBaseMsgVerifyInvariantResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", constantFee: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.constantFee !== undefined) { + Coin.encode(message.constantFee, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.constantFee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + constantFee: isSet(object.constantFee) ? Coin.fromJSON(object.constantFee) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.constantFee !== undefined + && (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.constantFee = (object.constantFee !== undefined && object.constantFee !== null) + ? Coin.fromPartial(object.constantFee) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, }; /** Msg defines the bank Msg service. */ export interface Msg { - /** VerifyInvariant defines a method to verify a particular invariance. */ - VerifyInvariant( - request: MsgVerifyInvariant - ): Promise; + /** VerifyInvariant defines a method to verify a particular invariant. */ + VerifyInvariant(request: MsgVerifyInvariant): Promise; + /** + * UpdateParams defines a governance operation for updating the x/crisis module + * parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.VerifyInvariant = this.VerifyInvariant.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); } - VerifyInvariant( - request: MsgVerifyInvariant - ): Promise { + VerifyInvariant(request: MsgVerifyInvariant): Promise { const data = MsgVerifyInvariant.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.crisis.v1beta1.Msg", - "VerifyInvariant", - data - ); - return promise.then((data) => - MsgVerifyInvariantResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); + return promise.then((data) => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.crisis.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/index.ts index 5a8f3c40ab..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/index.ts @@ -1,70 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; - - -const types = [ - ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], - ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], - ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], - ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgWithdrawValidatorCommission: (data: MsgWithdrawValidatorCommission): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( data ) }), - msgSetWithdrawAddress: (data: MsgSetWithdrawAddress): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( data ) }), - msgWithdrawDelegatorReward: (data: MsgWithdrawDelegatorReward): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial( data ) }), - msgFundCommunityPool: (data: MsgFundCommunityPool): EncodeObject => ({ typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/module.ts new file mode 100755 index 0000000000..2d2545ecbf --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/module.ts @@ -0,0 +1,333 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgUpdateParams } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgCommunityPoolSpend } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; + +import { Params as typeParams} from "./types" +import { ValidatorHistoricalRewards as typeValidatorHistoricalRewards} from "./types" +import { ValidatorCurrentRewards as typeValidatorCurrentRewards} from "./types" +import { ValidatorAccumulatedCommission as typeValidatorAccumulatedCommission} from "./types" +import { ValidatorOutstandingRewards as typeValidatorOutstandingRewards} from "./types" +import { ValidatorSlashEvent as typeValidatorSlashEvent} from "./types" +import { ValidatorSlashEvents as typeValidatorSlashEvents} from "./types" +import { FeePool as typeFeePool} from "./types" +import { CommunityPoolSpendProposal as typeCommunityPoolSpendProposal} from "./types" +import { DelegatorStartingInfo as typeDelegatorStartingInfo} from "./types" +import { DelegationDelegatorReward as typeDelegationDelegatorReward} from "./types" +import { CommunityPoolSpendProposalWithDeposit as typeCommunityPoolSpendProposalWithDeposit} from "./types" +import { DelegatorWithdrawInfo as typeDelegatorWithdrawInfo} from "./types" +import { ValidatorOutstandingRewardsRecord as typeValidatorOutstandingRewardsRecord} from "./types" +import { ValidatorAccumulatedCommissionRecord as typeValidatorAccumulatedCommissionRecord} from "./types" +import { ValidatorHistoricalRewardsRecord as typeValidatorHistoricalRewardsRecord} from "./types" +import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord} from "./types" +import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord} from "./types" +import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord} from "./types" + +export { MsgWithdrawValidatorCommission, MsgSetWithdrawAddress, MsgUpdateParams, MsgWithdrawDelegatorReward, MsgCommunityPoolSpend, MsgFundCommunityPool }; + +type sendMsgWithdrawValidatorCommissionParams = { + value: MsgWithdrawValidatorCommission, + fee?: StdFee, + memo?: string +}; + +type sendMsgSetWithdrawAddressParams = { + value: MsgSetWithdrawAddress, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateParamsParams = { + value: MsgUpdateParams, + fee?: StdFee, + memo?: string +}; + +type sendMsgWithdrawDelegatorRewardParams = { + value: MsgWithdrawDelegatorReward, + fee?: StdFee, + memo?: string +}; + +type sendMsgCommunityPoolSpendParams = { + value: MsgCommunityPoolSpend, + fee?: StdFee, + memo?: string +}; + +type sendMsgFundCommunityPoolParams = { + value: MsgFundCommunityPool, + fee?: StdFee, + memo?: string +}; + + +type msgWithdrawValidatorCommissionParams = { + value: MsgWithdrawValidatorCommission, +}; + +type msgSetWithdrawAddressParams = { + value: MsgSetWithdrawAddress, +}; + +type msgUpdateParamsParams = { + value: MsgUpdateParams, +}; + +type msgWithdrawDelegatorRewardParams = { + value: MsgWithdrawDelegatorReward, +}; + +type msgCommunityPoolSpendParams = { + value: MsgCommunityPoolSpend, +}; + +type msgFundCommunityPoolParams = { + value: MsgFundCommunityPool, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgWithdrawDelegatorReward({ value, fee, memo }: sendMsgWithdrawDelegatorRewardParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgWithdrawDelegatorReward({ value: MsgWithdrawDelegatorReward.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCommunityPoolSpend({ value, fee, memo }: sendMsgCommunityPoolSpendParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCommunityPoolSpend: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCommunityPoolSpend({ value: MsgCommunityPoolSpend.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCommunityPoolSpend: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgFundCommunityPool({ value: MsgFundCommunityPool.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: '+ e.message) + } + }, + + + msgWithdrawValidatorCommission({ value }: msgWithdrawValidatorCommissionParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message) + } + }, + + msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message) + } + }, + + msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message) + } + }, + + msgWithdrawDelegatorReward({ value }: msgWithdrawDelegatorRewardParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgWithdrawDelegatorReward: Could not create message: ' + e.message) + } + }, + + msgCommunityPoolSpend({ value }: msgCommunityPoolSpendParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", value: MsgCommunityPoolSpend.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCommunityPoolSpend: Could not create message: ' + e.message) + } + }, + + msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject { + try { + return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgFundCommunityPool: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Params: getStructure(typeParams.fromPartial({})), + ValidatorHistoricalRewards: getStructure(typeValidatorHistoricalRewards.fromPartial({})), + ValidatorCurrentRewards: getStructure(typeValidatorCurrentRewards.fromPartial({})), + ValidatorAccumulatedCommission: getStructure(typeValidatorAccumulatedCommission.fromPartial({})), + ValidatorOutstandingRewards: getStructure(typeValidatorOutstandingRewards.fromPartial({})), + ValidatorSlashEvent: getStructure(typeValidatorSlashEvent.fromPartial({})), + ValidatorSlashEvents: getStructure(typeValidatorSlashEvents.fromPartial({})), + FeePool: getStructure(typeFeePool.fromPartial({})), + CommunityPoolSpendProposal: getStructure(typeCommunityPoolSpendProposal.fromPartial({})), + DelegatorStartingInfo: getStructure(typeDelegatorStartingInfo.fromPartial({})), + DelegationDelegatorReward: getStructure(typeDelegationDelegatorReward.fromPartial({})), + CommunityPoolSpendProposalWithDeposit: getStructure(typeCommunityPoolSpendProposalWithDeposit.fromPartial({})), + DelegatorWithdrawInfo: getStructure(typeDelegatorWithdrawInfo.fromPartial({})), + ValidatorOutstandingRewardsRecord: getStructure(typeValidatorOutstandingRewardsRecord.fromPartial({})), + ValidatorAccumulatedCommissionRecord: getStructure(typeValidatorAccumulatedCommissionRecord.fromPartial({})), + ValidatorHistoricalRewardsRecord: getStructure(typeValidatorHistoricalRewardsRecord.fromPartial({})), + ValidatorCurrentRewardsRecord: getStructure(typeValidatorCurrentRewardsRecord.fromPartial({})), + DelegatorStartingInfoRecord: getStructure(typeDelegatorStartingInfoRecord.fromPartial({})), + ValidatorSlashEventRecord: getStructure(typeValidatorSlashEventRecord.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosDistributionV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/registry.ts new file mode 100755 index 0000000000..22012f6d46 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/registry.ts @@ -0,0 +1,20 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgUpdateParams } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgCommunityPoolSpend } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], + ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], + ["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams], + ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], + ["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend], + ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/rest.ts index ae637acb1a..12c484b409 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/rest.ts @@ -10,6 +10,34 @@ * --------------------------------------------------------------- */ +/** + * Params defines the set of params for the distribution module. + */ +export interface Distributionv1Beta1Params { + community_tax?: string; + + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + base_proposer_reward?: string; + + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; +} + +/** +* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +for a validator inexpensive to track, allows simple sanity checks. +*/ +export interface Distributionv1Beta1ValidatorOutstandingRewards { + rewards?: V1Beta1DecCoin[]; +} + export interface ProtobufAny { "@type"?: string; } @@ -52,25 +80,50 @@ export interface V1Beta1DelegationDelegatorReward { reward?: V1Beta1DecCoin[]; } +/** +* MsgCommunityPoolSpendResponse defines the response to executing a +MsgCommunityPoolSpend message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgCommunityPoolSpendResponse = object; + /** * MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export type V1Beta1MsgFundCommunityPoolResponse = object; /** - * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. - */ +* MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +type. +*/ export type V1Beta1MsgSetWithdrawAddressResponse = object; /** - * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. - */ -export type V1Beta1MsgWithdrawDelegatorRewardResponse = object; +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; /** - * MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. - */ -export type V1Beta1MsgWithdrawValidatorCommissionResponse = object; +* MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +response type. +*/ +export interface V1Beta1MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ + amount?: V1Beta1Coin[]; +} + +/** +* MsgWithdrawValidatorCommissionResponse defines the +Msg/WithdrawValidatorCommission response type. +*/ +export interface V1Beta1MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ + amount?: V1Beta1Coin[]; +} /** * message SomeRequest { @@ -128,23 +181,22 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } -/** - * Params defines the set of params for the distribution module. - */ -export interface V1Beta1Params { - community_tax?: string; - base_proposer_reward?: string; - bonus_proposer_reward?: string; - withdraw_addr_enabled?: boolean; -} - /** * QueryCommunityPoolResponse is the response type for the Query/CommunityPool RPC method. @@ -198,14 +250,28 @@ export interface V1Beta1QueryDelegatorWithdrawAddressResponse { */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: V1Beta1Params; + params?: Distributionv1Beta1Params; } export interface V1Beta1QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ + /** commission defines the commission the validator received. */ commission?: V1Beta1ValidatorAccumulatedCommission; } +/** + * QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. + */ +export interface V1Beta1QueryValidatorDistributionInfoResponse { + /** operator_address defines the validator operator address. */ + operator_address?: string; + + /** self_bond_rewards defines the self delegations rewards. */ + self_bond_rewards?: V1Beta1DecCoin[]; + + /** commission defines the commission the validator received. */ + commission?: V1Beta1DecCoin[]; +} + /** * QueryValidatorOutstandingRewardsResponse is the response type for the Query/ValidatorOutstandingRewards RPC method. @@ -215,7 +281,7 @@ export interface V1Beta1QueryValidatorOutstandingRewardsResponse { * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards * for a validator inexpensive to track, allows simple sanity checks. */ - rewards?: V1Beta1ValidatorOutstandingRewards; + rewards?: Distributionv1Beta1ValidatorOutstandingRewards; } /** @@ -238,14 +304,6 @@ export interface V1Beta1ValidatorAccumulatedCommission { commission?: V1Beta1DecCoin[]; } -/** -* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -for a validator inexpensive to track, allows simple sanity checks. -*/ -export interface V1Beta1ValidatorOutstandingRewards { - rewards?: V1Beta1DecCoin[]; -} - /** * ValidatorSlashEvent represents a validator slash event. Height is implicit within the store key. @@ -258,10 +316,11 @@ export interface V1Beta1ValidatorSlashEvent { fraction?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -271,30 +330,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -302,149 +352,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -479,9 +466,9 @@ export class Api extends HttpClient + queryDelegationTotalRewards = (delegatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/rewards`, + path: `/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/rewards`, method: "GET", format: "json", ...params, @@ -495,9 +482,9 @@ validator. * @summary DelegationRewards queries the total rewards accrued by a delegation. * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} */ - queryDelegationRewards = (delegator_address: string, validator_address: string, params: RequestParams = {}) => + queryDelegationRewards = (delegatorAddress: string, validatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/rewards/${validator_address}`, + path: `/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/rewards/${validatorAddress}`, method: "GET", format: "json", ...params, @@ -511,9 +498,9 @@ validator. * @summary DelegatorValidators queries the validators of a delegator. * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators */ - queryDelegatorValidators = (delegator_address: string, params: RequestParams = {}) => + queryDelegatorValidators = (delegatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/validators`, + path: `/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/validators`, method: "GET", format: "json", ...params, @@ -527,9 +514,9 @@ validator. * @summary DelegatorWithdrawAddress queries withdraw address of a delegator. * @request GET:/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address */ - queryDelegatorWithdrawAddress = (delegator_address: string, params: RequestParams = {}) => + queryDelegatorWithdrawAddress = (delegatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/delegators/${delegator_address}/withdraw_address`, + path: `/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/withdraw_address`, method: "GET", format: "json", ...params, @@ -551,6 +538,22 @@ validator. ...params, }); + /** + * No description + * + * @tags Query + * @name QueryValidatorDistributionInfo + * @summary ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address} + */ + queryValidatorDistributionInfo = (validatorAddress: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/distribution/v1beta1/validators/${validatorAddress}`, + method: "GET", + format: "json", + ...params, + }); + /** * No description * @@ -559,9 +562,9 @@ validator. * @summary ValidatorCommission queries accumulated commission for a validator. * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/commission */ - queryValidatorCommission = (validator_address: string, params: RequestParams = {}) => + queryValidatorCommission = (validatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/commission`, + path: `/cosmos/distribution/v1beta1/validators/${validatorAddress}/commission`, method: "GET", format: "json", ...params, @@ -575,9 +578,9 @@ validator. * @summary ValidatorOutstandingRewards queries rewards of a validator address. * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards */ - queryValidatorOutstandingRewards = (validator_address: string, params: RequestParams = {}) => + queryValidatorOutstandingRewards = (validatorAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/outstanding_rewards`, + path: `/cosmos/distribution/v1beta1/validators/${validatorAddress}/outstanding_rewards`, method: "GET", format: "json", ...params, @@ -592,7 +595,7 @@ validator. * @request GET:/cosmos/distribution/v1beta1/validators/{validator_address}/slashes */ queryValidatorSlashes = ( - validator_address: string, + validatorAddress: string, query?: { starting_height?: string; ending_height?: string; @@ -605,7 +608,7 @@ validator. params: RequestParams = {}, ) => this.request({ - path: `/cosmos/distribution/v1beta1/validators/${validator_address}/slashes`, + path: `/cosmos/distribution/v1beta1/validators/${validatorAddress}/slashes`, method: "GET", query: query, format: "json", diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types.ts new file mode 100755 index 0000000000..2b7d48a151 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { Params } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorHistoricalRewards } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorCurrentRewards } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorAccumulatedCommission } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorOutstandingRewards } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorSlashEvent } from "./types/cosmos/distribution/v1beta1/distribution" +import { ValidatorSlashEvents } from "./types/cosmos/distribution/v1beta1/distribution" +import { FeePool } from "./types/cosmos/distribution/v1beta1/distribution" +import { CommunityPoolSpendProposal } from "./types/cosmos/distribution/v1beta1/distribution" +import { DelegatorStartingInfo } from "./types/cosmos/distribution/v1beta1/distribution" +import { DelegationDelegatorReward } from "./types/cosmos/distribution/v1beta1/distribution" +import { CommunityPoolSpendProposalWithDeposit } from "./types/cosmos/distribution/v1beta1/distribution" +import { DelegatorWithdrawInfo } from "./types/cosmos/distribution/v1beta1/genesis" +import { ValidatorOutstandingRewardsRecord } from "./types/cosmos/distribution/v1beta1/genesis" +import { ValidatorAccumulatedCommissionRecord } from "./types/cosmos/distribution/v1beta1/genesis" +import { ValidatorHistoricalRewardsRecord } from "./types/cosmos/distribution/v1beta1/genesis" +import { ValidatorCurrentRewardsRecord } from "./types/cosmos/distribution/v1beta1/genesis" +import { DelegatorStartingInfoRecord } from "./types/cosmos/distribution/v1beta1/genesis" +import { ValidatorSlashEventRecord } from "./types/cosmos/distribution/v1beta1/genesis" + + +export { + Params, + ValidatorHistoricalRewards, + ValidatorCurrentRewards, + ValidatorAccumulatedCommission, + ValidatorOutstandingRewards, + ValidatorSlashEvent, + ValidatorSlashEvents, + FeePool, + CommunityPoolSpendProposal, + DelegatorStartingInfo, + DelegationDelegatorReward, + CommunityPoolSpendProposalWithDeposit, + DelegatorWithdrawInfo, + ValidatorOutstandingRewardsRecord, + ValidatorAccumulatedCommissionRecord, + ValidatorHistoricalRewardsRecord, + ValidatorCurrentRewardsRecord, + DelegatorStartingInfoRecord, + ValidatorSlashEventRecord, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts index 51e8bf4f5e..152cf28696 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts @@ -1,17 +1,29 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin, DecCoin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** Params defines the set of params for the distribution module. */ export interface Params { - community_tax: string; - base_proposer_reward: string; - bonus_proposer_reward: string; - withdraw_addr_enabled: boolean; + communityTax: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + * + * @deprecated + */ + baseProposerReward: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + * + * @deprecated + */ + bonusProposerReward: string; + withdrawAddrEnabled: boolean; } /** @@ -29,8 +41,8 @@ export interface Params { * + one per validator for the zeroeth period, set on initialization */ export interface ValidatorHistoricalRewards { - cumulative_reward_ratio: DecCoin[]; - reference_count: number; + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; } /** @@ -66,24 +78,31 @@ export interface ValidatorOutstandingRewards { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEvent { - validator_period: number; + validatorPeriod: number; fraction: string; } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ export interface ValidatorSlashEvents { - validator_slash_events: ValidatorSlashEvent[]; + validatorSlashEvents: ValidatorSlashEvent[]; } /** FeePool is the global fee pool for distribution. */ export interface FeePool { - community_pool: DecCoin[]; + communityPool: DecCoin[]; } /** * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. + * + * @deprecated */ export interface CommunityPoolSpendProposal { title: string; @@ -101,7 +120,7 @@ export interface CommunityPoolSpendProposal { * thus sdk.Dec is used. */ export interface DelegatorStartingInfo { - previous_period: number; + previousPeriod: number; stake: string; height: number; } @@ -111,7 +130,7 @@ export interface DelegatorStartingInfo { * of a delegator's delegation reward. */ export interface DelegationDelegatorReward { - validator_address: string; + validatorAddress: string; reward: DecCoin[]; } @@ -127,48 +146,45 @@ export interface CommunityPoolSpendProposalWithDeposit { deposit: string; } -const baseParams: object = { - community_tax: "", - base_proposer_reward: "", - bonus_proposer_reward: "", - withdraw_addr_enabled: false, -}; +function createBaseParams(): Params { + return { communityTax: "", baseProposerReward: "", bonusProposerReward: "", withdrawAddrEnabled: false }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.community_tax !== "") { - writer.uint32(10).string(message.community_tax); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.communityTax !== "") { + writer.uint32(10).string(message.communityTax); } - if (message.base_proposer_reward !== "") { - writer.uint32(18).string(message.base_proposer_reward); + if (message.baseProposerReward !== "") { + writer.uint32(18).string(message.baseProposerReward); } - if (message.bonus_proposer_reward !== "") { - writer.uint32(26).string(message.bonus_proposer_reward); + if (message.bonusProposerReward !== "") { + writer.uint32(26).string(message.bonusProposerReward); } - if (message.withdraw_addr_enabled === true) { - writer.uint32(32).bool(message.withdraw_addr_enabled); + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.community_tax = reader.string(); + message.communityTax = reader.string(); break; case 2: - message.base_proposer_reward = reader.string(); + message.baseProposerReward = reader.string(); break; case 3: - message.bonus_proposer_reward = reader.string(); + message.bonusProposerReward = reader.string(); break; case 4: - message.withdraw_addr_enabled = reader.bool(); + message.withdrawAddrEnabled = reader.bool(); break; default: reader.skipType(tag & 7); @@ -179,123 +195,60 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.community_tax !== undefined && object.community_tax !== null) { - message.community_tax = String(object.community_tax); - } else { - message.community_tax = ""; - } - if ( - object.base_proposer_reward !== undefined && - object.base_proposer_reward !== null - ) { - message.base_proposer_reward = String(object.base_proposer_reward); - } else { - message.base_proposer_reward = ""; - } - if ( - object.bonus_proposer_reward !== undefined && - object.bonus_proposer_reward !== null - ) { - message.bonus_proposer_reward = String(object.bonus_proposer_reward); - } else { - message.bonus_proposer_reward = ""; - } - if ( - object.withdraw_addr_enabled !== undefined && - object.withdraw_addr_enabled !== null - ) { - message.withdraw_addr_enabled = Boolean(object.withdraw_addr_enabled); - } else { - message.withdraw_addr_enabled = false; - } - return message; + return { + communityTax: isSet(object.communityTax) ? String(object.communityTax) : "", + baseProposerReward: isSet(object.baseProposerReward) ? String(object.baseProposerReward) : "", + bonusProposerReward: isSet(object.bonusProposerReward) ? String(object.bonusProposerReward) : "", + withdrawAddrEnabled: isSet(object.withdrawAddrEnabled) ? Boolean(object.withdrawAddrEnabled) : false, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.community_tax !== undefined && - (obj.community_tax = message.community_tax); - message.base_proposer_reward !== undefined && - (obj.base_proposer_reward = message.base_proposer_reward); - message.bonus_proposer_reward !== undefined && - (obj.bonus_proposer_reward = message.bonus_proposer_reward); - message.withdraw_addr_enabled !== undefined && - (obj.withdraw_addr_enabled = message.withdraw_addr_enabled); + message.communityTax !== undefined && (obj.communityTax = message.communityTax); + message.baseProposerReward !== undefined && (obj.baseProposerReward = message.baseProposerReward); + message.bonusProposerReward !== undefined && (obj.bonusProposerReward = message.bonusProposerReward); + message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.community_tax !== undefined && object.community_tax !== null) { - message.community_tax = object.community_tax; - } else { - message.community_tax = ""; - } - if ( - object.base_proposer_reward !== undefined && - object.base_proposer_reward !== null - ) { - message.base_proposer_reward = object.base_proposer_reward; - } else { - message.base_proposer_reward = ""; - } - if ( - object.bonus_proposer_reward !== undefined && - object.bonus_proposer_reward !== null - ) { - message.bonus_proposer_reward = object.bonus_proposer_reward; - } else { - message.bonus_proposer_reward = ""; - } - if ( - object.withdraw_addr_enabled !== undefined && - object.withdraw_addr_enabled !== null - ) { - message.withdraw_addr_enabled = object.withdraw_addr_enabled; - } else { - message.withdraw_addr_enabled = false; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.communityTax = object.communityTax ?? ""; + message.baseProposerReward = object.baseProposerReward ?? ""; + message.bonusProposerReward = object.bonusProposerReward ?? ""; + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; return message; }, }; -const baseValidatorHistoricalRewards: object = { reference_count: 0 }; +function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { + return { cumulativeRewardRatio: [], referenceCount: 0 }; +} export const ValidatorHistoricalRewards = { - encode( - message: ValidatorHistoricalRewards, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.cumulative_reward_ratio) { + encode(message: ValidatorHistoricalRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.cumulativeRewardRatio) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.reference_count !== 0) { - writer.uint32(16).uint32(message.reference_count); + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorHistoricalRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; + const message = createBaseValidatorHistoricalRewards(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.cumulative_reward_ratio.push( - DecCoin.decode(reader, reader.uint32()) - ); + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); break; case 2: - message.reference_count = reader.uint32(); + message.referenceCount = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -306,77 +259,39 @@ export const ValidatorHistoricalRewards = { }, fromJSON(object: any): ValidatorHistoricalRewards { - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; - if ( - object.cumulative_reward_ratio !== undefined && - object.cumulative_reward_ratio !== null - ) { - for (const e of object.cumulative_reward_ratio) { - message.cumulative_reward_ratio.push(DecCoin.fromJSON(e)); - } - } - if ( - object.reference_count !== undefined && - object.reference_count !== null - ) { - message.reference_count = Number(object.reference_count); - } else { - message.reference_count = 0; - } - return message; + return { + cumulativeRewardRatio: Array.isArray(object?.cumulativeRewardRatio) + ? object.cumulativeRewardRatio.map((e: any) => DecCoin.fromJSON(e)) + : [], + referenceCount: isSet(object.referenceCount) ? Number(object.referenceCount) : 0, + }; }, toJSON(message: ValidatorHistoricalRewards): unknown { const obj: any = {}; - if (message.cumulative_reward_ratio) { - obj.cumulative_reward_ratio = message.cumulative_reward_ratio.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + if (message.cumulativeRewardRatio) { + obj.cumulativeRewardRatio = message.cumulativeRewardRatio.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { - obj.cumulative_reward_ratio = []; + obj.cumulativeRewardRatio = []; } - message.reference_count !== undefined && - (obj.reference_count = message.reference_count); + message.referenceCount !== undefined && (obj.referenceCount = Math.round(message.referenceCount)); return obj; }, - fromPartial( - object: DeepPartial - ): ValidatorHistoricalRewards { - const message = { - ...baseValidatorHistoricalRewards, - } as ValidatorHistoricalRewards; - message.cumulative_reward_ratio = []; - if ( - object.cumulative_reward_ratio !== undefined && - object.cumulative_reward_ratio !== null - ) { - for (const e of object.cumulative_reward_ratio) { - message.cumulative_reward_ratio.push(DecCoin.fromPartial(e)); - } - } - if ( - object.reference_count !== undefined && - object.reference_count !== null - ) { - message.reference_count = object.reference_count; - } else { - message.reference_count = 0; - } + fromPartial, I>>(object: I): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map((e) => DecCoin.fromPartial(e)) || []; + message.referenceCount = object.referenceCount ?? 0; return message; }, }; -const baseValidatorCurrentRewards: object = { period: 0 }; +function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { + return { rewards: [], period: 0 }; +} export const ValidatorCurrentRewards = { - encode( - message: ValidatorCurrentRewards, - writer: Writer = Writer.create() - ): Writer { + encode(message: ValidatorCurrentRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -386,13 +301,10 @@ export const ValidatorCurrentRewards = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorCurrentRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; + const message = createBaseValidatorCurrentRewards(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -411,80 +323,47 @@ export const ValidatorCurrentRewards = { }, fromJSON(object: any): ValidatorCurrentRewards { - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - return message; + return { + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [], + period: isSet(object.period) ? Number(object.period) : 0, + }; }, toJSON(message: ValidatorCurrentRewards): unknown { const obj: any = {}; if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.rewards = []; } - message.period !== undefined && (obj.period = message.period); + message.period !== undefined && (obj.period = Math.round(message.period)); return obj; }, - fromPartial( - object: DeepPartial - ): ValidatorCurrentRewards { - const message = { - ...baseValidatorCurrentRewards, - } as ValidatorCurrentRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } + fromPartial, I>>(object: I): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; + message.period = object.period ?? 0; return message; }, }; -const baseValidatorAccumulatedCommission: object = {}; +function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { + return { commission: [] }; +} export const ValidatorAccumulatedCommission = { - encode( - message: ValidatorAccumulatedCommission, - writer: Writer = Writer.create() - ): Writer { + encode(message: ValidatorAccumulatedCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.commission) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorAccumulatedCommission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; + const message = createBaseValidatorAccumulatedCommission(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -500,69 +379,46 @@ export const ValidatorAccumulatedCommission = { }, fromJSON(object: any): ValidatorAccumulatedCommission { - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; - if (object.commission !== undefined && object.commission !== null) { - for (const e of object.commission) { - message.commission.push(DecCoin.fromJSON(e)); - } - } - return message; + return { + commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromJSON(e)) : [], + }; }, toJSON(message: ValidatorAccumulatedCommission): unknown { const obj: any = {}; if (message.commission) { - obj.commission = message.commission.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + obj.commission = message.commission.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.commission = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ValidatorAccumulatedCommission { - const message = { - ...baseValidatorAccumulatedCommission, - } as ValidatorAccumulatedCommission; - message.commission = []; - if (object.commission !== undefined && object.commission !== null) { - for (const e of object.commission) { - message.commission.push(DecCoin.fromPartial(e)); - } - } + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseValidatorOutstandingRewards: object = {}; +function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { + return { rewards: [] }; +} export const ValidatorOutstandingRewards = { - encode( - message: ValidatorOutstandingRewards, - writer: Writer = Writer.create() - ): Writer { + encode(message: ValidatorOutstandingRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorOutstandingRewards { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; + const message = createBaseValidatorOutstandingRewards(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -578,55 +434,34 @@ export const ValidatorOutstandingRewards = { }, fromJSON(object: any): ValidatorOutstandingRewards { - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - return message; + return { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] }; }, toJSON(message: ValidatorOutstandingRewards): unknown { const obj: any = {}; if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.rewards = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ValidatorOutstandingRewards { - const message = { - ...baseValidatorOutstandingRewards, - } as ValidatorOutstandingRewards; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseValidatorSlashEvent: object = { validator_period: 0, fraction: "" }; +function createBaseValidatorSlashEvent(): ValidatorSlashEvent { + return { validatorPeriod: 0, fraction: "" }; +} export const ValidatorSlashEvent = { - encode( - message: ValidatorSlashEvent, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_period !== 0) { - writer.uint32(8).uint64(message.validator_period); + encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorPeriod !== 0) { + writer.uint32(8).uint64(message.validatorPeriod); } if (message.fraction !== "") { writer.uint32(18).string(message.fraction); @@ -634,15 +469,15 @@ export const ValidatorSlashEvent = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSlashEvent { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; + const message = createBaseValidatorSlashEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_period = longToNumber(reader.uint64() as Long); + message.validatorPeriod = longToNumber(reader.uint64() as Long); break; case 2: message.fraction = reader.string(); @@ -656,75 +491,48 @@ export const ValidatorSlashEvent = { }, fromJSON(object: any): ValidatorSlashEvent { - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; - if ( - object.validator_period !== undefined && - object.validator_period !== null - ) { - message.validator_period = Number(object.validator_period); - } else { - message.validator_period = 0; - } - if (object.fraction !== undefined && object.fraction !== null) { - message.fraction = String(object.fraction); - } else { - message.fraction = ""; - } - return message; + return { + validatorPeriod: isSet(object.validatorPeriod) ? Number(object.validatorPeriod) : 0, + fraction: isSet(object.fraction) ? String(object.fraction) : "", + }; }, toJSON(message: ValidatorSlashEvent): unknown { const obj: any = {}; - message.validator_period !== undefined && - (obj.validator_period = message.validator_period); + message.validatorPeriod !== undefined && (obj.validatorPeriod = Math.round(message.validatorPeriod)); message.fraction !== undefined && (obj.fraction = message.fraction); return obj; }, - fromPartial(object: DeepPartial): ValidatorSlashEvent { - const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; - if ( - object.validator_period !== undefined && - object.validator_period !== null - ) { - message.validator_period = object.validator_period; - } else { - message.validator_period = 0; - } - if (object.fraction !== undefined && object.fraction !== null) { - message.fraction = object.fraction; - } else { - message.fraction = ""; - } + fromPartial, I>>(object: I): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent(); + message.validatorPeriod = object.validatorPeriod ?? 0; + message.fraction = object.fraction ?? ""; return message; }, }; -const baseValidatorSlashEvents: object = {}; +function createBaseValidatorSlashEvents(): ValidatorSlashEvents { + return { validatorSlashEvents: [] }; +} export const ValidatorSlashEvents = { - encode( - message: ValidatorSlashEvents, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.validator_slash_events) { + encode(message: ValidatorSlashEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validatorSlashEvents) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSlashEvents { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; + const message = createBaseValidatorSlashEvents(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_slash_events.push( - ValidatorSlashEvent.decode(reader, reader.uint32()) - ); + message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -735,66 +543,51 @@ export const ValidatorSlashEvents = { }, fromJSON(object: any): ValidatorSlashEvents { - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push(ValidatorSlashEvent.fromJSON(e)); - } - } - return message; + return { + validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) + ? object.validatorSlashEvents.map((e: any) => ValidatorSlashEvent.fromJSON(e)) + : [], + }; }, toJSON(message: ValidatorSlashEvents): unknown { const obj: any = {}; - if (message.validator_slash_events) { - obj.validator_slash_events = message.validator_slash_events.map((e) => - e ? ValidatorSlashEvent.toJSON(e) : undefined - ); + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => e ? ValidatorSlashEvent.toJSON(e) : undefined); } else { - obj.validator_slash_events = []; + obj.validatorSlashEvents = []; } return obj; }, - fromPartial(object: DeepPartial): ValidatorSlashEvents { - const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; - message.validator_slash_events = []; - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push(ValidatorSlashEvent.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validatorSlashEvents?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; return message; }, }; -const baseFeePool: object = {}; +function createBaseFeePool(): FeePool { + return { communityPool: [] }; +} export const FeePool = { - encode(message: FeePool, writer: Writer = Writer.create()): Writer { - for (const v of message.community_pool) { + encode(message: FeePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.communityPool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FeePool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): FeePool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; + const message = createBaseFeePool(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.community_pool.push(DecCoin.decode(reader, reader.uint32())); + message.communityPool.push(DecCoin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -805,51 +598,36 @@ export const FeePool = { }, fromJSON(object: any): FeePool { - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; - if (object.community_pool !== undefined && object.community_pool !== null) { - for (const e of object.community_pool) { - message.community_pool.push(DecCoin.fromJSON(e)); - } - } - return message; + return { + communityPool: Array.isArray(object?.communityPool) + ? object.communityPool.map((e: any) => DecCoin.fromJSON(e)) + : [], + }; }, toJSON(message: FeePool): unknown { const obj: any = {}; - if (message.community_pool) { - obj.community_pool = message.community_pool.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + if (message.communityPool) { + obj.communityPool = message.communityPool.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { - obj.community_pool = []; + obj.communityPool = []; } return obj; }, - fromPartial(object: DeepPartial): FeePool { - const message = { ...baseFeePool } as FeePool; - message.community_pool = []; - if (object.community_pool !== undefined && object.community_pool !== null) { - for (const e of object.community_pool) { - message.community_pool.push(DecCoin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FeePool { + const message = createBaseFeePool(); + message.communityPool = object.communityPool?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseCommunityPoolSpendProposal: object = { - title: "", - description: "", - recipient: "", -}; +function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { + return { title: "", description: "", recipient: "", amount: [] }; +} export const CommunityPoolSpendProposal = { - encode( - message: CommunityPoolSpendProposal, - writer: Writer = Writer.create() - ): Writer { + encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -865,16 +643,10 @@ export const CommunityPoolSpendProposal = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): CommunityPoolSpendProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; + const message = createBaseCommunityPoolSpendProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -899,91 +671,45 @@ export const CommunityPoolSpendProposal = { }, fromJSON(object: any): CommunityPoolSpendProposal { - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = String(object.recipient); - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + recipient: isSet(object.recipient) ? String(object.recipient) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: CommunityPoolSpendProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); + message.description !== undefined && (obj.description = message.description); message.recipient !== undefined && (obj.recipient = message.recipient); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } return obj; }, - fromPartial( - object: DeepPartial - ): CommunityPoolSpendProposal { - const message = { - ...baseCommunityPoolSpendProposal, - } as CommunityPoolSpendProposal; - message.amount = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseDelegatorStartingInfo: object = { - previous_period: 0, - stake: "", - height: 0, -}; +function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { + return { previousPeriod: 0, stake: "", height: 0 }; +} export const DelegatorStartingInfo = { - encode( - message: DelegatorStartingInfo, - writer: Writer = Writer.create() - ): Writer { - if (message.previous_period !== 0) { - writer.uint32(8).uint64(message.previous_period); + encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.previousPeriod !== 0) { + writer.uint32(8).uint64(message.previousPeriod); } if (message.stake !== "") { writer.uint32(18).string(message.stake); @@ -994,15 +720,15 @@ export const DelegatorStartingInfo = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DelegatorStartingInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; + const message = createBaseDelegatorStartingInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.previous_period = longToNumber(reader.uint64() as Long); + message.previousPeriod = longToNumber(reader.uint64() as Long); break; case 2: message.stake = reader.string(); @@ -1019,72 +745,38 @@ export const DelegatorStartingInfo = { }, fromJSON(object: any): DelegatorStartingInfo { - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; - if ( - object.previous_period !== undefined && - object.previous_period !== null - ) { - message.previous_period = Number(object.previous_period); - } else { - message.previous_period = 0; - } - if (object.stake !== undefined && object.stake !== null) { - message.stake = String(object.stake); - } else { - message.stake = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; + return { + previousPeriod: isSet(object.previousPeriod) ? Number(object.previousPeriod) : 0, + stake: isSet(object.stake) ? String(object.stake) : "", + height: isSet(object.height) ? Number(object.height) : 0, + }; }, toJSON(message: DelegatorStartingInfo): unknown { const obj: any = {}; - message.previous_period !== undefined && - (obj.previous_period = message.previous_period); + message.previousPeriod !== undefined && (obj.previousPeriod = Math.round(message.previousPeriod)); message.stake !== undefined && (obj.stake = message.stake); - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial( - object: DeepPartial - ): DelegatorStartingInfo { - const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; - if ( - object.previous_period !== undefined && - object.previous_period !== null - ) { - message.previous_period = object.previous_period; - } else { - message.previous_period = 0; - } - if (object.stake !== undefined && object.stake !== null) { - message.stake = object.stake; - } else { - message.stake = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } + fromPartial, I>>(object: I): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo(); + message.previousPeriod = object.previousPeriod ?? 0; + message.stake = object.stake ?? ""; + message.height = object.height ?? 0; return message; }, }; -const baseDelegationDelegatorReward: object = { validator_address: "" }; +function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { + return { validatorAddress: "", reward: [] }; +} export const DelegationDelegatorReward = { - encode( - message: DelegationDelegatorReward, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } for (const v of message.reward) { DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -1092,21 +784,15 @@ export const DelegationDelegatorReward = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DelegationDelegatorReward { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; + const message = createBaseDelegationDelegatorReward(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: message.reward.push(DecCoin.decode(reader, reader.uint32())); @@ -1120,77 +806,37 @@ export const DelegationDelegatorReward = { }, fromJSON(object: any): DelegationDelegatorReward { - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.reward !== undefined && object.reward !== null) { - for (const e of object.reward) { - message.reward.push(DecCoin.fromJSON(e)); - } - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + reward: Array.isArray(object?.reward) ? object.reward.map((e: any) => DecCoin.fromJSON(e)) : [], + }; }, toJSON(message: DelegationDelegatorReward): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); if (message.reward) { - obj.reward = message.reward.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + obj.reward = message.reward.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.reward = []; } return obj; }, - fromPartial( - object: DeepPartial - ): DelegationDelegatorReward { - const message = { - ...baseDelegationDelegatorReward, - } as DelegationDelegatorReward; - message.reward = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.reward !== undefined && object.reward !== null) { - for (const e of object.reward) { - message.reward.push(DecCoin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward(); + message.validatorAddress = object.validatorAddress ?? ""; + message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseCommunityPoolSpendProposalWithDeposit: object = { - title: "", - description: "", - recipient: "", - amount: "", - deposit: "", -}; +function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { + return { title: "", description: "", recipient: "", amount: "", deposit: "" }; +} export const CommunityPoolSpendProposalWithDeposit = { - encode( - message: CommunityPoolSpendProposalWithDeposit, - writer: Writer = Writer.create() - ): Writer { + encode(message: CommunityPoolSpendProposalWithDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1209,15 +855,10 @@ export const CommunityPoolSpendProposalWithDeposit = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): CommunityPoolSpendProposalWithDeposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1245,104 +886,68 @@ export const CommunityPoolSpendProposalWithDeposit = { }, fromJSON(object: any): CommunityPoolSpendProposalWithDeposit { - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = String(object.recipient); - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = String(object.deposit); - } else { - message.deposit = ""; - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + recipient: isSet(object.recipient) ? String(object.recipient) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + deposit: isSet(object.deposit) ? String(object.deposit) : "", + }; }, toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); + message.description !== undefined && (obj.description = message.description); message.recipient !== undefined && (obj.recipient = message.recipient); message.amount !== undefined && (obj.amount = message.amount); message.deposit !== undefined && (obj.deposit = message.deposit); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): CommunityPoolSpendProposalWithDeposit { - const message = { - ...baseCommunityPoolSpendProposalWithDeposit, - } as CommunityPoolSpendProposalWithDeposit; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } else { - message.recipient = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = object.deposit; - } else { - message.deposit = ""; - } + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount ?? ""; + message.deposit = object.deposit ?? ""; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1350,7 +955,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts index c950f3b557..fc332111ae 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts @@ -1,17 +1,17 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { DecCoin } from "../../base/v1beta1/coin"; import { + DelegatorStartingInfo, + FeePool, + Params, ValidatorAccumulatedCommission, - ValidatorHistoricalRewards, ValidatorCurrentRewards, - DelegatorStartingInfo, + ValidatorHistoricalRewards, ValidatorSlashEvent, - Params, - FeePool, -} from "../../../cosmos/distribution/v1beta1/distribution"; +} from "./distribution"; export const protobufPackage = "cosmos.distribution.v1beta1"; @@ -22,17 +22,17 @@ export const protobufPackage = "cosmos.distribution.v1beta1"; */ export interface DelegatorWithdrawInfo { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegatorAddress: string; /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address: string; + withdrawAddress: string; } /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecord { /** validator_address is the address of the validator. */ - validator_address: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstanding_rewards: DecCoin[]; + validatorAddress: string; + /** outstanding_rewards represents the outstanding rewards of a validator. */ + outstandingRewards: DecCoin[]; } /** @@ -41,7 +41,7 @@ export interface ValidatorOutstandingRewardsRecord { */ export interface ValidatorAccumulatedCommissionRecord { /** validator_address is the address of the validator. */ - validator_address: string; + validatorAddress: string; /** accumulated is the accumulated commission of a validator. */ accumulated: ValidatorAccumulatedCommission | undefined; } @@ -52,7 +52,7 @@ export interface ValidatorAccumulatedCommissionRecord { */ export interface ValidatorHistoricalRewardsRecord { /** validator_address is the address of the validator. */ - validator_address: string; + validatorAddress: string; /** period defines the period the historical rewards apply to. */ period: number; /** rewards defines the historical rewards of a validator. */ @@ -62,7 +62,7 @@ export interface ValidatorHistoricalRewardsRecord { /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecord { /** validator_address is the address of the validator. */ - validator_address: string; + validatorAddress: string; /** rewards defines the current rewards of a validator. */ rewards: ValidatorCurrentRewards | undefined; } @@ -70,80 +70,80 @@ export interface ValidatorCurrentRewardsRecord { /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecord { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegatorAddress: string; /** validator_address is the address of the validator. */ - validator_address: string; + validatorAddress: string; /** starting_info defines the starting info of a delegator. */ - starting_info: DelegatorStartingInfo | undefined; + startingInfo: DelegatorStartingInfo | undefined; } /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ - validator_address: string; - /** height defines the block height at which the slash event occured. */ + validatorAddress: string; + /** height defines the block height at which the slash event occurred. */ height: number; /** period is the period of the slash event. */ period: number; /** validator_slash_event describes the slash event. */ - validator_slash_event: ValidatorSlashEvent | undefined; + validatorSlashEvent: ValidatorSlashEvent | undefined; } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params | undefined; + /** params defines all the parameters of the module. */ + params: + | Params + | undefined; /** fee_pool defines the fee pool at genesis. */ - fee_pool: FeePool | undefined; + feePool: + | FeePool + | undefined; /** fee_pool defines the delegator withdraw infos at genesis. */ - delegator_withdraw_infos: DelegatorWithdrawInfo[]; + delegatorWithdrawInfos: DelegatorWithdrawInfo[]; /** fee_pool defines the previous proposer at genesis. */ - previous_proposer: string; + previousProposer: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstanding_rewards: ValidatorOutstandingRewardsRecord[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validator_accumulated_commissions: ValidatorAccumulatedCommissionRecord[]; + outstandingRewards: ValidatorOutstandingRewardsRecord[]; + /** fee_pool defines the accumulated commissions of all validators at genesis. */ + validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; /** fee_pool defines the historical rewards of all validators at genesis. */ - validator_historical_rewards: ValidatorHistoricalRewardsRecord[]; + validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; /** fee_pool defines the current rewards of all validators at genesis. */ - validator_current_rewards: ValidatorCurrentRewardsRecord[]; + validatorCurrentRewards: ValidatorCurrentRewardsRecord[]; /** fee_pool defines the delegator starting infos at genesis. */ - delegator_starting_infos: DelegatorStartingInfoRecord[]; + delegatorStartingInfos: DelegatorStartingInfoRecord[]; /** fee_pool defines the validator slash events at genesis. */ - validator_slash_events: ValidatorSlashEventRecord[]; + validatorSlashEvents: ValidatorSlashEventRecord[]; } -const baseDelegatorWithdrawInfo: object = { - delegator_address: "", - withdraw_address: "", -}; +function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { + return { delegatorAddress: "", withdrawAddress: "" }; +} export const DelegatorWithdrawInfo = { - encode( - message: DelegatorWithdrawInfo, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: DelegatorWithdrawInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.withdraw_address !== "") { - writer.uint32(18).string(message.withdraw_address); + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; + const message = createBaseDelegatorWithdrawInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.withdraw_address = reader.string(); + message.withdrawAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -154,95 +154,54 @@ export const DelegatorWithdrawInfo = { }, fromJSON(object: any): DelegatorWithdrawInfo { - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "", + }; }, toJSON(message: DelegatorWithdrawInfo): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial( - object: DeepPartial - ): DelegatorWithdrawInfo { - const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } + fromPartial, I>>(object: I): DelegatorWithdrawInfo { + const message = createBaseDelegatorWithdrawInfo(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; return message; }, }; -const baseValidatorOutstandingRewardsRecord: object = { validator_address: "" }; +function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewardsRecord { + return { validatorAddress: "", outstandingRewards: [] }; +} export const ValidatorOutstandingRewardsRecord = { - encode( - message: ValidatorOutstandingRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: ValidatorOutstandingRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } - for (const v of message.outstanding_rewards) { + for (const v of message.outstandingRewards) { DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorOutstandingRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; + const message = createBaseValidatorOutstandingRewardsRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: - message.outstanding_rewards.push( - DecCoin.decode(reader, reader.uint32()) - ); + message.outstandingRewards.push(DecCoin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -253,111 +212,62 @@ export const ValidatorOutstandingRewardsRecord = { }, fromJSON(object: any): ValidatorOutstandingRewardsRecord { - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push(DecCoin.fromJSON(e)); - } - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + outstandingRewards: Array.isArray(object?.outstandingRewards) + ? object.outstandingRewards.map((e: any) => DecCoin.fromJSON(e)) + : [], + }; }, toJSON(message: ValidatorOutstandingRewardsRecord): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - if (message.outstanding_rewards) { - obj.outstanding_rewards = message.outstanding_rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { - obj.outstanding_rewards = []; + obj.outstandingRewards = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ValidatorOutstandingRewardsRecord { - const message = { - ...baseValidatorOutstandingRewardsRecord, - } as ValidatorOutstandingRewardsRecord; - message.outstanding_rewards = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push(DecCoin.fromPartial(e)); - } - } + const message = createBaseValidatorOutstandingRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.outstandingRewards = object.outstandingRewards?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseValidatorAccumulatedCommissionRecord: object = { - validator_address: "", -}; +function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedCommissionRecord { + return { validatorAddress: "", accumulated: undefined }; +} export const ValidatorAccumulatedCommissionRecord = { - encode( - message: ValidatorAccumulatedCommissionRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: ValidatorAccumulatedCommissionRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } if (message.accumulated !== undefined) { - ValidatorAccumulatedCommission.encode( - message.accumulated, - writer.uint32(18).fork() - ).ldelim(); + ValidatorAccumulatedCommission.encode(message.accumulated, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorAccumulatedCommissionRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; + const message = createBaseValidatorAccumulatedCommissionRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: - message.accumulated = ValidatorAccumulatedCommission.decode( - reader, - reader.uint32() - ); + message.accumulated = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -368,111 +278,67 @@ export const ValidatorAccumulatedCommissionRecord = { }, fromJSON(object: any): ValidatorAccumulatedCommissionRecord { - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.accumulated !== undefined && object.accumulated !== null) { - message.accumulated = ValidatorAccumulatedCommission.fromJSON( - object.accumulated - ); - } else { - message.accumulated = undefined; - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + accumulated: isSet(object.accumulated) ? ValidatorAccumulatedCommission.fromJSON(object.accumulated) : undefined, + }; }, toJSON(message: ValidatorAccumulatedCommissionRecord): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.accumulated !== undefined && - (obj.accumulated = message.accumulated + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.accumulated !== undefined + && (obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toJSON(message.accumulated) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ValidatorAccumulatedCommissionRecord { - const message = { - ...baseValidatorAccumulatedCommissionRecord, - } as ValidatorAccumulatedCommissionRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.accumulated !== undefined && object.accumulated !== null) { - message.accumulated = ValidatorAccumulatedCommission.fromPartial( - object.accumulated - ); - } else { - message.accumulated = undefined; - } + const message = createBaseValidatorAccumulatedCommissionRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.accumulated = (object.accumulated !== undefined && object.accumulated !== null) + ? ValidatorAccumulatedCommission.fromPartial(object.accumulated) + : undefined; return message; }, }; -const baseValidatorHistoricalRewardsRecord: object = { - validator_address: "", - period: 0, -}; +function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { + return { validatorAddress: "", period: 0, rewards: undefined }; +} export const ValidatorHistoricalRewardsRecord = { - encode( - message: ValidatorHistoricalRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: ValidatorHistoricalRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } if (message.period !== 0) { writer.uint32(16).uint64(message.period); } if (message.rewards !== undefined) { - ValidatorHistoricalRewards.encode( - message.rewards, - writer.uint32(26).fork() - ).ldelim(); + ValidatorHistoricalRewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorHistoricalRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; + const message = createBaseValidatorHistoricalRewardsRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: message.period = longToNumber(reader.uint64() as Long); break; case 3: - message.rewards = ValidatorHistoricalRewards.decode( - reader, - reader.uint32() - ); + message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -483,109 +349,62 @@ export const ValidatorHistoricalRewardsRecord = { }, fromJSON(object: any): ValidatorHistoricalRewardsRecord { - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorHistoricalRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + period: isSet(object.period) ? Number(object.period) : 0, + rewards: isSet(object.rewards) ? ValidatorHistoricalRewards.fromJSON(object.rewards) : undefined, + }; }, toJSON(message: ValidatorHistoricalRewardsRecord): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.period !== undefined && (obj.period = message.period); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorHistoricalRewards.toJSON(message.rewards) - : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.period !== undefined && (obj.period = Math.round(message.period)); + message.rewards !== undefined + && (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ValidatorHistoricalRewardsRecord { - const message = { - ...baseValidatorHistoricalRewardsRecord, - } as ValidatorHistoricalRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorHistoricalRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } + const message = createBaseValidatorHistoricalRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.period = object.period ?? 0; + message.rewards = (object.rewards !== undefined && object.rewards !== null) + ? ValidatorHistoricalRewards.fromPartial(object.rewards) + : undefined; return message; }, }; -const baseValidatorCurrentRewardsRecord: object = { validator_address: "" }; +function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecord { + return { validatorAddress: "", rewards: undefined }; +} export const ValidatorCurrentRewardsRecord = { - encode( - message: ValidatorCurrentRewardsRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: ValidatorCurrentRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } if (message.rewards !== undefined) { - ValidatorCurrentRewards.encode( - message.rewards, - writer.uint32(18).fork() - ).ldelim(); + ValidatorCurrentRewards.encode(message.rewards, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorCurrentRewardsRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; + const message = createBaseValidatorCurrentRewardsRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: - message.rewards = ValidatorCurrentRewards.decode( - reader, - reader.uint32() - ); + message.rewards = ValidatorCurrentRewards.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -596,107 +415,65 @@ export const ValidatorCurrentRewardsRecord = { }, fromJSON(object: any): ValidatorCurrentRewardsRecord { - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorCurrentRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + rewards: isSet(object.rewards) ? ValidatorCurrentRewards.fromJSON(object.rewards) : undefined, + }; }, toJSON(message: ValidatorCurrentRewardsRecord): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorCurrentRewards.toJSON(message.rewards) - : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.rewards !== undefined + && (obj.rewards = message.rewards ? ValidatorCurrentRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ValidatorCurrentRewardsRecord { - const message = { - ...baseValidatorCurrentRewardsRecord, - } as ValidatorCurrentRewardsRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorCurrentRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } + const message = createBaseValidatorCurrentRewardsRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.rewards = (object.rewards !== undefined && object.rewards !== null) + ? ValidatorCurrentRewards.fromPartial(object.rewards) + : undefined; return message; }, }; -const baseDelegatorStartingInfoRecord: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { + return { delegatorAddress: "", validatorAddress: "", startingInfo: undefined }; +} export const DelegatorStartingInfoRecord = { - encode( - message: DelegatorStartingInfoRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: DelegatorStartingInfoRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } - if (message.starting_info !== undefined) { - DelegatorStartingInfo.encode( - message.starting_info, - writer.uint32(26).fork() - ).ldelim(); + if (message.startingInfo !== undefined) { + DelegatorStartingInfo.encode(message.startingInfo, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DelegatorStartingInfoRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfoRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; + const message = createBaseDelegatorStartingInfoRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: - message.starting_info = DelegatorStartingInfo.decode( - reader, - reader.uint32() - ); + message.startingInfo = DelegatorStartingInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -707,94 +484,41 @@ export const DelegatorStartingInfoRecord = { }, fromJSON(object: any): DelegatorStartingInfoRecord { - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.starting_info !== undefined && object.starting_info !== null) { - message.starting_info = DelegatorStartingInfo.fromJSON( - object.starting_info - ); - } else { - message.starting_info = undefined; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + startingInfo: isSet(object.startingInfo) ? DelegatorStartingInfo.fromJSON(object.startingInfo) : undefined, + }; }, toJSON(message: DelegatorStartingInfoRecord): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.starting_info !== undefined && - (obj.starting_info = message.starting_info - ? DelegatorStartingInfo.toJSON(message.starting_info) - : undefined); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.startingInfo !== undefined + && (obj.startingInfo = message.startingInfo ? DelegatorStartingInfo.toJSON(message.startingInfo) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): DelegatorStartingInfoRecord { - const message = { - ...baseDelegatorStartingInfoRecord, - } as DelegatorStartingInfoRecord; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.starting_info !== undefined && object.starting_info !== null) { - message.starting_info = DelegatorStartingInfo.fromPartial( - object.starting_info - ); - } else { - message.starting_info = undefined; - } + fromPartial, I>>(object: I): DelegatorStartingInfoRecord { + const message = createBaseDelegatorStartingInfoRecord(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.startingInfo = (object.startingInfo !== undefined && object.startingInfo !== null) + ? DelegatorStartingInfo.fromPartial(object.startingInfo) + : undefined; return message; }, }; -const baseValidatorSlashEventRecord: object = { - validator_address: "", - height: 0, - period: 0, -}; +function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { + return { validatorAddress: "", height: 0, period: 0, validatorSlashEvent: undefined }; +} export const ValidatorSlashEventRecord = { - encode( - message: ValidatorSlashEventRecord, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: ValidatorSlashEventRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } if (message.height !== 0) { writer.uint32(16).uint64(message.height); @@ -802,29 +526,21 @@ export const ValidatorSlashEventRecord = { if (message.period !== 0) { writer.uint32(24).uint64(message.period); } - if (message.validator_slash_event !== undefined) { - ValidatorSlashEvent.encode( - message.validator_slash_event, - writer.uint32(34).fork() - ).ldelim(); + if (message.validatorSlashEvent !== undefined) { + ValidatorSlashEvent.encode(message.validatorSlashEvent, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ValidatorSlashEventRecord { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEventRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; + const message = createBaseValidatorSlashEventRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: message.height = longToNumber(reader.uint64() as Long); @@ -833,10 +549,7 @@ export const ValidatorSlashEventRecord = { message.period = longToNumber(reader.uint64() as Long); break; case 4: - message.validator_slash_event = ValidatorSlashEvent.decode( - reader, - reader.uint32() - ); + message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -847,151 +560,93 @@ export const ValidatorSlashEventRecord = { }, fromJSON(object: any): ValidatorSlashEventRecord { - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.period !== undefined && object.period !== null) { - message.period = Number(object.period); - } else { - message.period = 0; - } - if ( - object.validator_slash_event !== undefined && - object.validator_slash_event !== null - ) { - message.validator_slash_event = ValidatorSlashEvent.fromJSON( - object.validator_slash_event - ); - } else { - message.validator_slash_event = undefined; - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + height: isSet(object.height) ? Number(object.height) : 0, + period: isSet(object.period) ? Number(object.period) : 0, + validatorSlashEvent: isSet(object.validatorSlashEvent) + ? ValidatorSlashEvent.fromJSON(object.validatorSlashEvent) + : undefined, + }; }, toJSON(message: ValidatorSlashEventRecord): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.height !== undefined && (obj.height = message.height); - message.period !== undefined && (obj.period = message.period); - message.validator_slash_event !== undefined && - (obj.validator_slash_event = message.validator_slash_event - ? ValidatorSlashEvent.toJSON(message.validator_slash_event) - : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.period !== undefined && (obj.period = Math.round(message.period)); + message.validatorSlashEvent !== undefined && (obj.validatorSlashEvent = message.validatorSlashEvent + ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) + : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ValidatorSlashEventRecord { - const message = { - ...baseValidatorSlashEventRecord, - } as ValidatorSlashEventRecord; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.period !== undefined && object.period !== null) { - message.period = object.period; - } else { - message.period = 0; - } - if ( - object.validator_slash_event !== undefined && - object.validator_slash_event !== null - ) { - message.validator_slash_event = ValidatorSlashEvent.fromPartial( - object.validator_slash_event - ); - } else { - message.validator_slash_event = undefined; - } + fromPartial, I>>(object: I): ValidatorSlashEventRecord { + const message = createBaseValidatorSlashEventRecord(); + message.validatorAddress = object.validatorAddress ?? ""; + message.height = object.height ?? 0; + message.period = object.period ?? 0; + message.validatorSlashEvent = (object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null) + ? ValidatorSlashEvent.fromPartial(object.validatorSlashEvent) + : undefined; return message; }, }; -const baseGenesisState: object = { previous_proposer: "" }; +function createBaseGenesisState(): GenesisState { + return { + params: undefined, + feePool: undefined, + delegatorWithdrawInfos: [], + previousProposer: "", + outstandingRewards: [], + validatorAccumulatedCommissions: [], + validatorHistoricalRewards: [], + validatorCurrentRewards: [], + delegatorStartingInfos: [], + validatorSlashEvents: [], + }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - if (message.fee_pool !== undefined) { - FeePool.encode(message.fee_pool, writer.uint32(18).fork()).ldelim(); + if (message.feePool !== undefined) { + FeePool.encode(message.feePool, writer.uint32(18).fork()).ldelim(); } - for (const v of message.delegator_withdraw_infos) { + for (const v of message.delegatorWithdrawInfos) { DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.previous_proposer !== "") { - writer.uint32(34).string(message.previous_proposer); + if (message.previousProposer !== "") { + writer.uint32(34).string(message.previousProposer); } - for (const v of message.outstanding_rewards) { - ValidatorOutstandingRewardsRecord.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.outstandingRewards) { + ValidatorOutstandingRewardsRecord.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.validator_accumulated_commissions) { - ValidatorAccumulatedCommissionRecord.encode( - v!, - writer.uint32(50).fork() - ).ldelim(); + for (const v of message.validatorAccumulatedCommissions) { + ValidatorAccumulatedCommissionRecord.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.validator_historical_rewards) { - ValidatorHistoricalRewardsRecord.encode( - v!, - writer.uint32(58).fork() - ).ldelim(); + for (const v of message.validatorHistoricalRewards) { + ValidatorHistoricalRewardsRecord.encode(v!, writer.uint32(58).fork()).ldelim(); } - for (const v of message.validator_current_rewards) { - ValidatorCurrentRewardsRecord.encode( - v!, - writer.uint32(66).fork() - ).ldelim(); + for (const v of message.validatorCurrentRewards) { + ValidatorCurrentRewardsRecord.encode(v!, writer.uint32(66).fork()).ldelim(); } - for (const v of message.delegator_starting_infos) { + for (const v of message.delegatorStartingInfos) { DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.validator_slash_events) { + for (const v of message.validatorSlashEvents) { ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -999,45 +654,33 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.fee_pool = FeePool.decode(reader, reader.uint32()); + message.feePool = FeePool.decode(reader, reader.uint32()); break; case 3: - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.decode(reader, reader.uint32()) - ); + message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.decode(reader, reader.uint32())); break; case 4: - message.previous_proposer = reader.string(); + message.previousProposer = reader.string(); break; case 5: - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32()) - ); + message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32())); break; case 6: - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32()) + message.validatorAccumulatedCommissions.push( + ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32()), ); break; case 7: - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32()) - ); + message.validatorHistoricalRewards.push(ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32())); break; case 8: - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.decode(reader, reader.uint32()) - ); + message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.decode(reader, reader.uint32())); break; case 9: - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.decode(reader, reader.uint32()) - ); + message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.decode(reader, reader.uint32())); break; case 10: - message.validator_slash_events.push( - ValidatorSlashEventRecord.decode(reader, reader.uint32()) - ); + message.validatorSlashEvents.push(ValidatorSlashEventRecord.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1048,289 +691,148 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.fee_pool !== undefined && object.fee_pool !== null) { - message.fee_pool = FeePool.fromJSON(object.fee_pool); - } else { - message.fee_pool = undefined; - } - if ( - object.delegator_withdraw_infos !== undefined && - object.delegator_withdraw_infos !== null - ) { - for (const e of object.delegator_withdraw_infos) { - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.fromJSON(e) - ); - } - } - if ( - object.previous_proposer !== undefined && - object.previous_proposer !== null - ) { - message.previous_proposer = String(object.previous_proposer); - } else { - message.previous_proposer = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.validator_accumulated_commissions !== undefined && - object.validator_accumulated_commissions !== null - ) { - for (const e of object.validator_accumulated_commissions) { - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.fromJSON(e) - ); - } - } - if ( - object.validator_historical_rewards !== undefined && - object.validator_historical_rewards !== null - ) { - for (const e of object.validator_historical_rewards) { - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.validator_current_rewards !== undefined && - object.validator_current_rewards !== null - ) { - for (const e of object.validator_current_rewards) { - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.fromJSON(e) - ); - } - } - if ( - object.delegator_starting_infos !== undefined && - object.delegator_starting_infos !== null - ) { - for (const e of object.delegator_starting_infos) { - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.fromJSON(e) - ); - } - } - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push( - ValidatorSlashEventRecord.fromJSON(e) - ); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + feePool: isSet(object.feePool) ? FeePool.fromJSON(object.feePool) : undefined, + delegatorWithdrawInfos: Array.isArray(object?.delegatorWithdrawInfos) + ? object.delegatorWithdrawInfos.map((e: any) => DelegatorWithdrawInfo.fromJSON(e)) + : [], + previousProposer: isSet(object.previousProposer) ? String(object.previousProposer) : "", + outstandingRewards: Array.isArray(object?.outstandingRewards) + ? object.outstandingRewards.map((e: any) => ValidatorOutstandingRewardsRecord.fromJSON(e)) + : [], + validatorAccumulatedCommissions: Array.isArray(object?.validatorAccumulatedCommissions) + ? object.validatorAccumulatedCommissions.map((e: any) => ValidatorAccumulatedCommissionRecord.fromJSON(e)) + : [], + validatorHistoricalRewards: Array.isArray(object?.validatorHistoricalRewards) + ? object.validatorHistoricalRewards.map((e: any) => ValidatorHistoricalRewardsRecord.fromJSON(e)) + : [], + validatorCurrentRewards: Array.isArray(object?.validatorCurrentRewards) + ? object.validatorCurrentRewards.map((e: any) => ValidatorCurrentRewardsRecord.fromJSON(e)) + : [], + delegatorStartingInfos: Array.isArray(object?.delegatorStartingInfos) + ? object.delegatorStartingInfos.map((e: any) => DelegatorStartingInfoRecord.fromJSON(e)) + : [], + validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) + ? object.validatorSlashEvents.map((e: any) => ValidatorSlashEventRecord.fromJSON(e)) + : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.fee_pool !== undefined && - (obj.fee_pool = message.fee_pool - ? FeePool.toJSON(message.fee_pool) - : undefined); - if (message.delegator_withdraw_infos) { - obj.delegator_withdraw_infos = message.delegator_withdraw_infos.map((e) => + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.feePool !== undefined && (obj.feePool = message.feePool ? FeePool.toJSON(message.feePool) : undefined); + if (message.delegatorWithdrawInfos) { + obj.delegatorWithdrawInfos = message.delegatorWithdrawInfos.map((e) => e ? DelegatorWithdrawInfo.toJSON(e) : undefined ); } else { - obj.delegator_withdraw_infos = []; + obj.delegatorWithdrawInfos = []; } - message.previous_proposer !== undefined && - (obj.previous_proposer = message.previous_proposer); - if (message.outstanding_rewards) { - obj.outstanding_rewards = message.outstanding_rewards.map((e) => + message.previousProposer !== undefined && (obj.previousProposer = message.previousProposer); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map((e) => e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined ); } else { - obj.outstanding_rewards = []; + obj.outstandingRewards = []; } - if (message.validator_accumulated_commissions) { - obj.validator_accumulated_commissions = message.validator_accumulated_commissions.map( - (e) => (e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined) + if (message.validatorAccumulatedCommissions) { + obj.validatorAccumulatedCommissions = message.validatorAccumulatedCommissions.map((e) => + e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined ); } else { - obj.validator_accumulated_commissions = []; + obj.validatorAccumulatedCommissions = []; } - if (message.validator_historical_rewards) { - obj.validator_historical_rewards = message.validator_historical_rewards.map( - (e) => (e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined) + if (message.validatorHistoricalRewards) { + obj.validatorHistoricalRewards = message.validatorHistoricalRewards.map((e) => + e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined ); } else { - obj.validator_historical_rewards = []; + obj.validatorHistoricalRewards = []; } - if (message.validator_current_rewards) { - obj.validator_current_rewards = message.validator_current_rewards.map( - (e) => (e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined) + if (message.validatorCurrentRewards) { + obj.validatorCurrentRewards = message.validatorCurrentRewards.map((e) => + e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined ); } else { - obj.validator_current_rewards = []; + obj.validatorCurrentRewards = []; } - if (message.delegator_starting_infos) { - obj.delegator_starting_infos = message.delegator_starting_infos.map((e) => + if (message.delegatorStartingInfos) { + obj.delegatorStartingInfos = message.delegatorStartingInfos.map((e) => e ? DelegatorStartingInfoRecord.toJSON(e) : undefined ); } else { - obj.delegator_starting_infos = []; + obj.delegatorStartingInfos = []; } - if (message.validator_slash_events) { - obj.validator_slash_events = message.validator_slash_events.map((e) => + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => e ? ValidatorSlashEventRecord.toJSON(e) : undefined ); } else { - obj.validator_slash_events = []; + obj.validatorSlashEvents = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.delegator_withdraw_infos = []; - message.outstanding_rewards = []; - message.validator_accumulated_commissions = []; - message.validator_historical_rewards = []; - message.validator_current_rewards = []; - message.delegator_starting_infos = []; - message.validator_slash_events = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.fee_pool !== undefined && object.fee_pool !== null) { - message.fee_pool = FeePool.fromPartial(object.fee_pool); - } else { - message.fee_pool = undefined; - } - if ( - object.delegator_withdraw_infos !== undefined && - object.delegator_withdraw_infos !== null - ) { - for (const e of object.delegator_withdraw_infos) { - message.delegator_withdraw_infos.push( - DelegatorWithdrawInfo.fromPartial(e) - ); - } - } - if ( - object.previous_proposer !== undefined && - object.previous_proposer !== null - ) { - message.previous_proposer = object.previous_proposer; - } else { - message.previous_proposer = ""; - } - if ( - object.outstanding_rewards !== undefined && - object.outstanding_rewards !== null - ) { - for (const e of object.outstanding_rewards) { - message.outstanding_rewards.push( - ValidatorOutstandingRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.validator_accumulated_commissions !== undefined && - object.validator_accumulated_commissions !== null - ) { - for (const e of object.validator_accumulated_commissions) { - message.validator_accumulated_commissions.push( - ValidatorAccumulatedCommissionRecord.fromPartial(e) - ); - } - } - if ( - object.validator_historical_rewards !== undefined && - object.validator_historical_rewards !== null - ) { - for (const e of object.validator_historical_rewards) { - message.validator_historical_rewards.push( - ValidatorHistoricalRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.validator_current_rewards !== undefined && - object.validator_current_rewards !== null - ) { - for (const e of object.validator_current_rewards) { - message.validator_current_rewards.push( - ValidatorCurrentRewardsRecord.fromPartial(e) - ); - } - } - if ( - object.delegator_starting_infos !== undefined && - object.delegator_starting_infos !== null - ) { - for (const e of object.delegator_starting_infos) { - message.delegator_starting_infos.push( - DelegatorStartingInfoRecord.fromPartial(e) - ); - } - } - if ( - object.validator_slash_events !== undefined && - object.validator_slash_events !== null - ) { - for (const e of object.validator_slash_events) { - message.validator_slash_events.push( - ValidatorSlashEventRecord.fromPartial(e) - ); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.feePool = (object.feePool !== undefined && object.feePool !== null) + ? FeePool.fromPartial(object.feePool) + : undefined; + message.delegatorWithdrawInfos = object.delegatorWithdrawInfos?.map((e) => DelegatorWithdrawInfo.fromPartial(e)) + || []; + message.previousProposer = object.previousProposer ?? ""; + message.outstandingRewards = object.outstandingRewards?.map((e) => ValidatorOutstandingRewardsRecord.fromPartial(e)) + || []; + message.validatorAccumulatedCommissions = + object.validatorAccumulatedCommissions?.map((e) => ValidatorAccumulatedCommissionRecord.fromPartial(e)) || []; + message.validatorHistoricalRewards = + object.validatorHistoricalRewards?.map((e) => ValidatorHistoricalRewardsRecord.fromPartial(e)) || []; + message.validatorCurrentRewards = + object.validatorCurrentRewards?.map((e) => ValidatorCurrentRewardsRecord.fromPartial(e)) || []; + message.delegatorStartingInfos = + object.delegatorStartingInfos?.map((e) => DelegatorStartingInfoRecord.fromPartial(e)) || []; + message.validatorSlashEvents = object.validatorSlashEvents?.map((e) => ValidatorSlashEventRecord.fromPartial(e)) + || []; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1338,7 +840,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts index ad7109d52d..ea91e0a0d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts @@ -1,24 +1,22 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { DecCoin } from "../../base/v1beta1/coin"; import { + DelegationDelegatorReward, Params, - ValidatorOutstandingRewards, ValidatorAccumulatedCommission, + ValidatorOutstandingRewards, ValidatorSlashEvent, - DelegationDelegatorReward, -} from "../../../cosmos/distribution/v1beta1/distribution"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; +} from "./distribution"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -26,13 +24,29 @@ export interface QueryParamsResponse { params: Params | undefined; } +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} + +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponse { + /** operator_address defines the validator operator address. */ + operatorAddress: string; + /** self_bond_rewards defines the self delegations rewards. */ + selfBondRewards: DecCoin[]; + /** commission defines the commission the validator received. */ + commission: DecCoin[]; +} + /** * QueryValidatorOutstandingRewardsRequest is the request type for the * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsRequest { /** validator_address defines the validator address to query for. */ - validator_address: string; + validatorAddress: string; } /** @@ -49,7 +63,7 @@ export interface QueryValidatorOutstandingRewardsResponse { */ export interface QueryValidatorCommissionRequest { /** validator_address defines the validator address to query for. */ - validator_address: string; + validatorAddress: string; } /** @@ -57,7 +71,7 @@ export interface QueryValidatorCommissionRequest { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ + /** commission defines the commission the validator received. */ commission: ValidatorAccumulatedCommission | undefined; } @@ -67,11 +81,11 @@ export interface QueryValidatorCommissionResponse { */ export interface QueryValidatorSlashesRequest { /** validator_address defines the validator address to query for. */ - validator_address: string; + validatorAddress: string; /** starting_height defines the optional starting height to query the slashes. */ - starting_height: number; + startingHeight: number; /** starting_height defines the optional ending height to query the slashes. */ - ending_height: number; + endingHeight: number; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -93,9 +107,9 @@ export interface QueryValidatorSlashesResponse { */ export interface QueryDelegationRewardsRequest { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegatorAddress: string; /** validator_address defines the validator address to query for. */ - validator_address: string; + validatorAddress: string; } /** @@ -113,7 +127,7 @@ export interface QueryDelegationRewardsResponse { */ export interface QueryDelegationTotalRewardsRequest { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegatorAddress: string; } /** @@ -133,7 +147,7 @@ export interface QueryDelegationTotalRewardsResponse { */ export interface QueryDelegatorValidatorsRequest { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegatorAddress: string; } /** @@ -151,7 +165,7 @@ export interface QueryDelegatorValidatorsResponse { */ export interface QueryDelegatorWithdrawAddressRequest { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegatorAddress: string; } /** @@ -160,14 +174,15 @@ export interface QueryDelegatorWithdrawAddressRequest { */ export interface QueryDelegatorWithdrawAddressResponse { /** withdraw_address defines the delegator address to query for. */ - withdraw_address: string; + withdrawAddress: string; } /** * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC * method. */ -export interface QueryCommunityPoolRequest {} +export interface QueryCommunityPoolRequest { +} /** * QueryCommunityPoolResponse is the response type for the Query/CommunityPool @@ -178,17 +193,19 @@ export interface QueryCommunityPoolResponse { pool: DecCoin[]; } -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -201,8 +218,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -210,29 +226,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -248,62 +263,173 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseQueryValidatorDistributionInfoRequest(): QueryValidatorDistributionInfoRequest { + return { validatorAddress: "" }; +} + +export const QueryValidatorDistributionInfoRequest = { + encode(message: QueryValidatorDistributionInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: QueryParamsResponse): unknown { + fromJSON(object: any): QueryValidatorDistributionInfoRequest { + return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; + }, + + toJSON(message: QueryValidatorDistributionInfoRequest): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); + fromPartial, I>>( + object: I, + ): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, +}; + +function createBaseQueryValidatorDistributionInfoResponse(): QueryValidatorDistributionInfoResponse { + return { operatorAddress: "", selfBondRewards: [], commission: [] }; +} + +export const QueryValidatorDistributionInfoResponse = { + encode(message: QueryValidatorDistributionInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + for (const v of message.selfBondRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.selfBondRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 3: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorDistributionInfoResponse { + return { + operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", + selfBondRewards: Array.isArray(object?.selfBondRewards) + ? object.selfBondRewards.map((e: any) => DecCoin.fromJSON(e)) + : [], + commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromJSON(e)) : [], + }; + }, + + toJSON(message: QueryValidatorDistributionInfoResponse): unknown { + const obj: any = {}; + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + if (message.selfBondRewards) { + obj.selfBondRewards = message.selfBondRewards.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { - message.params = undefined; + obj.selfBondRewards = []; } + if (message.commission) { + obj.commission = message.commission.map((e) => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.commission = []; + } + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + message.operatorAddress = object.operatorAddress ?? ""; + message.selfBondRewards = object.selfBondRewards?.map((e) => DecCoin.fromPartial(e)) || []; + message.commission = object.commission?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseQueryValidatorOutstandingRewardsRequest: object = { - validator_address: "", -}; +function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { + return { validatorAddress: "" }; +} export const QueryValidatorOutstandingRewardsRequest = { - encode( - message: QueryValidatorOutstandingRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: QueryValidatorOutstandingRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorOutstandingRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; + const message = createBaseQueryValidatorOutstandingRewardsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -314,78 +440,45 @@ export const QueryValidatorOutstandingRewardsRequest = { }, fromJSON(object: any): QueryValidatorOutstandingRewardsRequest { - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; }, toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorOutstandingRewardsRequest { - const message = { - ...baseQueryValidatorOutstandingRewardsRequest, - } as QueryValidatorOutstandingRewardsRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseQueryValidatorOutstandingRewardsResponse: object = {}; +function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOutstandingRewardsResponse { + return { rewards: undefined }; +} export const QueryValidatorOutstandingRewardsResponse = { - encode( - message: QueryValidatorOutstandingRewardsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorOutstandingRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.rewards !== undefined) { - ValidatorOutstandingRewards.encode( - message.rewards, - writer.uint32(10).fork() - ).ldelim(); + ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorOutstandingRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; + const message = createBaseQueryValidatorOutstandingRewardsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rewards = ValidatorOutstandingRewards.decode( - reader, - reader.uint32() - ); + message.rewards = ValidatorOutstandingRewards.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -396,68 +489,48 @@ export const QueryValidatorOutstandingRewardsResponse = { }, fromJSON(object: any): QueryValidatorOutstandingRewardsResponse { - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorOutstandingRewards.fromJSON(object.rewards); - } else { - message.rewards = undefined; - } - return message; + return { rewards: isSet(object.rewards) ? ValidatorOutstandingRewards.fromJSON(object.rewards) : undefined }; }, toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown { const obj: any = {}; - message.rewards !== undefined && - (obj.rewards = message.rewards - ? ValidatorOutstandingRewards.toJSON(message.rewards) - : undefined); + message.rewards !== undefined + && (obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorOutstandingRewardsResponse { - const message = { - ...baseQueryValidatorOutstandingRewardsResponse, - } as QueryValidatorOutstandingRewardsResponse; - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorOutstandingRewards.fromPartial(object.rewards); - } else { - message.rewards = undefined; - } + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + message.rewards = (object.rewards !== undefined && object.rewards !== null) + ? ValidatorOutstandingRewards.fromPartial(object.rewards) + : undefined; return message; }, }; -const baseQueryValidatorCommissionRequest: object = { validator_address: "" }; +function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRequest { + return { validatorAddress: "" }; +} export const QueryValidatorCommissionRequest = { - encode( - message: QueryValidatorCommissionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorCommissionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; + const message = createBaseQueryValidatorCommissionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -468,78 +541,45 @@ export const QueryValidatorCommissionRequest = { }, fromJSON(object: any): QueryValidatorCommissionRequest { - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; }, toJSON(message: QueryValidatorCommissionRequest): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorCommissionRequest { - const message = { - ...baseQueryValidatorCommissionRequest, - } as QueryValidatorCommissionRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + const message = createBaseQueryValidatorCommissionRequest(); + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseQueryValidatorCommissionResponse: object = {}; +function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionResponse { + return { commission: undefined }; +} export const QueryValidatorCommissionResponse = { - encode( - message: QueryValidatorCommissionResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.commission !== undefined) { - ValidatorAccumulatedCommission.encode( - message.commission, - writer.uint32(10).fork() - ).ldelim(); + ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorCommissionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; + const message = createBaseQueryValidatorCommissionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.commission = ValidatorAccumulatedCommission.decode( - reader, - reader.uint32() - ); + message.commission = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -550,64 +590,43 @@ export const QueryValidatorCommissionResponse = { }, fromJSON(object: any): QueryValidatorCommissionResponse { - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; - if (object.commission !== undefined && object.commission !== null) { - message.commission = ValidatorAccumulatedCommission.fromJSON( - object.commission - ); - } else { - message.commission = undefined; - } - return message; + return { + commission: isSet(object.commission) ? ValidatorAccumulatedCommission.fromJSON(object.commission) : undefined, + }; }, toJSON(message: QueryValidatorCommissionResponse): unknown { const obj: any = {}; - message.commission !== undefined && - (obj.commission = message.commission - ? ValidatorAccumulatedCommission.toJSON(message.commission) - : undefined); + message.commission !== undefined + && (obj.commission = message.commission ? ValidatorAccumulatedCommission.toJSON(message.commission) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorCommissionResponse { - const message = { - ...baseQueryValidatorCommissionResponse, - } as QueryValidatorCommissionResponse; - if (object.commission !== undefined && object.commission !== null) { - message.commission = ValidatorAccumulatedCommission.fromPartial( - object.commission - ); - } else { - message.commission = undefined; - } + const message = createBaseQueryValidatorCommissionResponse(); + message.commission = (object.commission !== undefined && object.commission !== null) + ? ValidatorAccumulatedCommission.fromPartial(object.commission) + : undefined; return message; }, }; -const baseQueryValidatorSlashesRequest: object = { - validator_address: "", - starting_height: 0, - ending_height: 0, -}; +function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { + return { validatorAddress: "", startingHeight: 0, endingHeight: 0, pagination: undefined }; +} export const QueryValidatorSlashesRequest = { - encode( - message: QueryValidatorSlashesRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } - if (message.starting_height !== 0) { - writer.uint32(16).uint64(message.starting_height); + if (message.startingHeight !== 0) { + writer.uint32(16).uint64(message.startingHeight); } - if (message.ending_height !== 0) { - writer.uint32(24).uint64(message.ending_height); + if (message.endingHeight !== 0) { + writer.uint32(24).uint64(message.endingHeight); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); @@ -615,26 +634,21 @@ export const QueryValidatorSlashesRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorSlashesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; + const message = createBaseQueryValidatorSlashesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 2: - message.starting_height = longToNumber(reader.uint64() as Long); + message.startingHeight = longToNumber(reader.uint64() as Long); break; case 3: - message.ending_height = longToNumber(reader.uint64() as Long); + message.endingHeight = longToNumber(reader.uint64() as Long); break; case 4: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -648,125 +662,60 @@ export const QueryValidatorSlashesRequest = { }, fromJSON(object: any): QueryValidatorSlashesRequest { - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.starting_height !== undefined && - object.starting_height !== null - ) { - message.starting_height = Number(object.starting_height); - } else { - message.starting_height = 0; - } - if (object.ending_height !== undefined && object.ending_height !== null) { - message.ending_height = Number(object.ending_height); - } else { - message.ending_height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + startingHeight: isSet(object.startingHeight) ? Number(object.startingHeight) : 0, + endingHeight: isSet(object.endingHeight) ? Number(object.endingHeight) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorSlashesRequest): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.starting_height !== undefined && - (obj.starting_height = message.starting_height); - message.ending_height !== undefined && - (obj.ending_height = message.ending_height); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.startingHeight !== undefined && (obj.startingHeight = Math.round(message.startingHeight)); + message.endingHeight !== undefined && (obj.endingHeight = Math.round(message.endingHeight)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryValidatorSlashesRequest { - const message = { - ...baseQueryValidatorSlashesRequest, - } as QueryValidatorSlashesRequest; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.starting_height !== undefined && - object.starting_height !== null - ) { - message.starting_height = object.starting_height; - } else { - message.starting_height = 0; - } - if (object.ending_height !== undefined && object.ending_height !== null) { - message.ending_height = object.ending_height; - } else { - message.ending_height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryValidatorSlashesRequest { + const message = createBaseQueryValidatorSlashesRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + message.startingHeight = object.startingHeight ?? 0; + message.endingHeight = object.endingHeight ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorSlashesResponse: object = {}; +function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { + return { slashes: [], pagination: undefined }; +} export const QueryValidatorSlashesResponse = { - encode( - message: QueryValidatorSlashesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorSlashesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.slashes) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorSlashesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; + const message = createBaseQueryValidatorSlashesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.slashes.push( - ValidatorSlashEvent.decode(reader, reader.uint32()) - ); + message.slashes.push(ValidatorSlashEvent.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -780,96 +729,63 @@ export const QueryValidatorSlashesResponse = { }, fromJSON(object: any): QueryValidatorSlashesResponse { - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; - if (object.slashes !== undefined && object.slashes !== null) { - for (const e of object.slashes) { - message.slashes.push(ValidatorSlashEvent.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + slashes: Array.isArray(object?.slashes) ? object.slashes.map((e: any) => ValidatorSlashEvent.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorSlashesResponse): unknown { const obj: any = {}; if (message.slashes) { - obj.slashes = message.slashes.map((e) => - e ? ValidatorSlashEvent.toJSON(e) : undefined - ); + obj.slashes = message.slashes.map((e) => e ? ValidatorSlashEvent.toJSON(e) : undefined); } else { obj.slashes = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorSlashesResponse { - const message = { - ...baseQueryValidatorSlashesResponse, - } as QueryValidatorSlashesResponse; - message.slashes = []; - if (object.slashes !== undefined && object.slashes !== null) { - for (const e of object.slashes) { - message.slashes.push(ValidatorSlashEvent.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegationRewardsRequest: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsRequest { + return { delegatorAddress: "", validatorAddress: "" }; +} export const QueryDelegationRewardsRequest = { - encode( - message: QueryDelegationRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; + const message = createBaseQueryDelegationRewardsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -880,86 +796,45 @@ export const QueryDelegationRewardsRequest = { }, fromJSON(object: any): QueryDelegationRewardsRequest { - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + }; }, toJSON(message: QueryDelegationRewardsRequest): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegationRewardsRequest { - const message = { - ...baseQueryDelegationRewardsRequest, - } as QueryDelegationRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + const message = createBaseQueryDelegationRewardsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseQueryDelegationRewardsResponse: object = {}; +function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsResponse { + return { rewards: [] }; +} export const QueryDelegationRewardsResponse = { - encode( - message: QueryDelegationRewardsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDelegationRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; + const message = createBaseQueryDelegationRewardsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -975,75 +850,49 @@ export const QueryDelegationRewardsResponse = { }, fromJSON(object: any): QueryDelegationRewardsResponse { - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromJSON(e)); - } - } - return message; + return { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] }; }, toJSON(message: QueryDelegationRewardsResponse): unknown { const obj: any = {}; if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DecCoin.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.rewards = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegationRewardsResponse { - const message = { - ...baseQueryDelegationRewardsResponse, - } as QueryDelegationRewardsResponse; - message.rewards = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DecCoin.fromPartial(e)); - } - } + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseQueryDelegationTotalRewardsRequest: object = { - delegator_address: "", -}; +function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRewardsRequest { + return { delegatorAddress: "" }; +} export const QueryDelegationTotalRewardsRequest = { - encode( - message: QueryDelegationTotalRewardsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationTotalRewardsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; + const message = createBaseQueryDelegationTotalRewardsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1054,52 +903,30 @@ export const QueryDelegationTotalRewardsRequest = { }, fromJSON(object: any): QueryDelegationTotalRewardsRequest { - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; + return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; }, toJSON(message: QueryDelegationTotalRewardsRequest): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegationTotalRewardsRequest { - const message = { - ...baseQueryDelegationTotalRewardsRequest, - } as QueryDelegationTotalRewardsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } + const message = createBaseQueryDelegationTotalRewardsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, }; -const baseQueryDelegationTotalRewardsResponse: object = {}; +function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRewardsResponse { + return { rewards: [], total: [] }; +} export const QueryDelegationTotalRewardsResponse = { - encode( - message: QueryDelegationTotalRewardsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDelegationTotalRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rewards) { DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1109,24 +936,15 @@ export const QueryDelegationTotalRewardsResponse = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegationTotalRewardsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; + const message = createBaseQueryDelegationTotalRewardsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rewards.push( - DelegationDelegatorReward.decode(reader, reader.uint32()) - ); + message.rewards.push(DelegationDelegatorReward.decode(reader, reader.uint32())); break; case 2: message.total.push(DecCoin.decode(reader, reader.uint32())); @@ -1140,90 +958,60 @@ export const QueryDelegationTotalRewardsResponse = { }, fromJSON(object: any): QueryDelegationTotalRewardsResponse { - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DelegationDelegatorReward.fromJSON(e)); - } - } - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(DecCoin.fromJSON(e)); - } - } - return message; + return { + rewards: Array.isArray(object?.rewards) + ? object.rewards.map((e: any) => DelegationDelegatorReward.fromJSON(e)) + : [], + total: Array.isArray(object?.total) ? object.total.map((e: any) => DecCoin.fromJSON(e)) : [], + }; }, toJSON(message: QueryDelegationTotalRewardsResponse): unknown { const obj: any = {}; if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? DelegationDelegatorReward.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? DelegationDelegatorReward.toJSON(e) : undefined); } else { obj.rewards = []; } if (message.total) { - obj.total = message.total.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + obj.total = message.total.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.total = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegationTotalRewardsResponse { - const message = { - ...baseQueryDelegationTotalRewardsResponse, - } as QueryDelegationTotalRewardsResponse; - message.rewards = []; - message.total = []; - if (object.rewards !== undefined && object.rewards !== null) { - for (const e of object.rewards) { - message.rewards.push(DelegationDelegatorReward.fromPartial(e)); - } - } - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(DecCoin.fromPartial(e)); - } - } + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map((e) => DelegationDelegatorReward.fromPartial(e)) || []; + message.total = object.total?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; -const baseQueryDelegatorValidatorsRequest: object = { delegator_address: "" }; +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { delegatorAddress: "" }; +} export const QueryDelegatorValidatorsRequest = { - encode( - message: QueryDelegatorValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; + const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1234,68 +1022,40 @@ export const QueryDelegatorValidatorsRequest = { }, fromJSON(object: any): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; + return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; }, toJSON(message: QueryDelegatorValidatorsRequest): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, }; -const baseQueryDelegatorValidatorsResponse: object = { validators: "" }; +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { validators: [] }; +} export const QueryDelegatorValidatorsResponse = { - encode( - message: QueryDelegatorValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { writer.uint32(10).string(v!); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; + const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1311,16 +1071,7 @@ export const QueryDelegatorValidatorsResponse = { }, fromJSON(object: any): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(String(e)); - } - } - return message; + return { validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => String(e)) : [] }; }, toJSON(message: QueryDelegatorValidatorsResponse): unknown { @@ -1333,51 +1084,36 @@ export const QueryDelegatorValidatorsResponse = { return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(e); - } - } + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map((e) => e) || []; return message; }, }; -const baseQueryDelegatorWithdrawAddressRequest: object = { - delegator_address: "", -}; +function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdrawAddressRequest { + return { delegatorAddress: "" }; +} export const QueryDelegatorWithdrawAddressRequest = { - encode( - message: QueryDelegatorWithdrawAddressRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: QueryDelegatorWithdrawAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorWithdrawAddressRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; + const message = createBaseQueryDelegatorWithdrawAddressRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1388,74 +1124,45 @@ export const QueryDelegatorWithdrawAddressRequest = { }, fromJSON(object: any): QueryDelegatorWithdrawAddressRequest { - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - return message; + return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" }; }, toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorWithdrawAddressRequest { - const message = { - ...baseQueryDelegatorWithdrawAddressRequest, - } as QueryDelegatorWithdrawAddressRequest; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, }; -const baseQueryDelegatorWithdrawAddressResponse: object = { - withdraw_address: "", -}; +function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdrawAddressResponse { + return { withdrawAddress: "" }; +} export const QueryDelegatorWithdrawAddressResponse = { - encode( - message: QueryDelegatorWithdrawAddressResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.withdraw_address !== "") { - writer.uint32(10).string(message.withdraw_address); + encode(message: QueryDelegatorWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.withdrawAddress !== "") { + writer.uint32(10).string(message.withdrawAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorWithdrawAddressResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; + const message = createBaseQueryDelegatorWithdrawAddressResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.withdraw_address = reader.string(); + message.withdrawAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1466,64 +1173,37 @@ export const QueryDelegatorWithdrawAddressResponse = { }, fromJSON(object: any): QueryDelegatorWithdrawAddressResponse { - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; + return { withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "" }; }, toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown { const obj: any = {}; - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorWithdrawAddressResponse { - const message = { - ...baseQueryDelegatorWithdrawAddressResponse, - } as QueryDelegatorWithdrawAddressResponse; - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + message.withdrawAddress = object.withdrawAddress ?? ""; return message; }, }; -const baseQueryCommunityPoolRequest: object = {}; +function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { + return {}; +} export const QueryCommunityPoolRequest = { - encode( - _: QueryCommunityPoolRequest, - writer: Writer = Writer.create() - ): Writer { + encode(_: QueryCommunityPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCommunityPoolRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; + const message = createBaseQueryCommunityPoolRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1536,10 +1216,7 @@ export const QueryCommunityPoolRequest = { }, fromJSON(_: any): QueryCommunityPoolRequest { - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; - return message; + return {}; }, toJSON(_: QueryCommunityPoolRequest): unknown { @@ -1547,39 +1224,28 @@ export const QueryCommunityPoolRequest = { return obj; }, - fromPartial( - _: DeepPartial - ): QueryCommunityPoolRequest { - const message = { - ...baseQueryCommunityPoolRequest, - } as QueryCommunityPoolRequest; + fromPartial, I>>(_: I): QueryCommunityPoolRequest { + const message = createBaseQueryCommunityPoolRequest(); return message; }, }; -const baseQueryCommunityPoolResponse: object = {}; +function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { + return { pool: [] }; +} export const QueryCommunityPoolResponse = { - encode( - message: QueryCommunityPoolResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.pool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCommunityPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; + const message = createBaseQueryCommunityPoolResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1595,40 +1261,22 @@ export const QueryCommunityPoolResponse = { }, fromJSON(object: any): QueryCommunityPoolResponse { - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; - if (object.pool !== undefined && object.pool !== null) { - for (const e of object.pool) { - message.pool.push(DecCoin.fromJSON(e)); - } - } - return message; + return { pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromJSON(e)) : [] }; }, toJSON(message: QueryCommunityPoolResponse): unknown { const obj: any = {}; if (message.pool) { - obj.pool = message.pool.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + obj.pool = message.pool.map((e) => e ? DecCoin.toJSON(e) : undefined); } else { obj.pool = []; } return obj; }, - fromPartial( - object: DeepPartial - ): QueryCommunityPoolResponse { - const message = { - ...baseQueryCommunityPoolResponse, - } as QueryCommunityPoolResponse; - message.pool = []; - if (object.pool !== undefined && object.pool !== null) { - for (const e of object.pool) { - message.pool.push(DecCoin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): QueryCommunityPoolResponse { + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map((e) => DecCoin.fromPartial(e)) || []; return message; }, }; @@ -1637,202 +1285,151 @@ export const QueryCommunityPoolResponse = { export interface Query { /** Params queries params of the distribution module. */ Params(request: QueryParamsRequest): Promise; + /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + ValidatorDistributionInfo( + request: QueryValidatorDistributionInfoRequest, + ): Promise; /** ValidatorOutstandingRewards queries rewards of a validator address. */ ValidatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest + request: QueryValidatorOutstandingRewardsRequest, ): Promise; /** ValidatorCommission queries accumulated commission for a validator. */ - ValidatorCommission( - request: QueryValidatorCommissionRequest - ): Promise; + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise; /** ValidatorSlashes queries slash events of a validator. */ - ValidatorSlashes( - request: QueryValidatorSlashesRequest - ): Promise; + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise; /** DelegationRewards queries the total rewards accrued by a delegation. */ - DelegationRewards( - request: QueryDelegationRewardsRequest - ): Promise; + DelegationRewards(request: QueryDelegationRewardsRequest): Promise; /** * DelegationTotalRewards queries the total rewards accrued by a each * validator. */ - DelegationTotalRewards( - request: QueryDelegationTotalRewardsRequest - ): Promise; + DelegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise; /** DelegatorValidators queries the validators of a delegator. */ - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise; + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ DelegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest + request: QueryDelegatorWithdrawAddressRequest, ): Promise; /** CommunityPool queries the community pool coins. */ - CommunityPool( - request: QueryCommunityPoolRequest - ): Promise; + CommunityPool(request: QueryCommunityPoolRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Params = this.Params.bind(this); + this.ValidatorDistributionInfo = this.ValidatorDistributionInfo.bind(this); + this.ValidatorOutstandingRewards = this.ValidatorOutstandingRewards.bind(this); + this.ValidatorCommission = this.ValidatorCommission.bind(this); + this.ValidatorSlashes = this.ValidatorSlashes.bind(this); + this.DelegationRewards = this.DelegationRewards.bind(this); + this.DelegationTotalRewards = this.DelegationTotalRewards.bind(this); + this.DelegatorValidators = this.DelegatorValidators.bind(this); + this.DelegatorWithdrawAddress = this.DelegatorWithdrawAddress.bind(this); + this.CommunityPool = this.CommunityPool.bind(this); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + ValidatorDistributionInfo( + request: QueryValidatorDistributionInfoRequest, + ): Promise { + const data = QueryValidatorDistributionInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorDistributionInfo", data); + return promise.then((data) => QueryValidatorDistributionInfoResponse.decode(new _m0.Reader(data))); } ValidatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest + request: QueryValidatorOutstandingRewardsRequest, ): Promise { - const data = QueryValidatorOutstandingRewardsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorOutstandingRewards", - data - ); - return promise.then((data) => - QueryValidatorOutstandingRewardsResponse.decode(new Reader(data)) - ); + const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); + return promise.then((data) => QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data))); } - ValidatorCommission( - request: QueryValidatorCommissionRequest - ): Promise { + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise { const data = QueryValidatorCommissionRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorCommission", - data - ); - return promise.then((data) => - QueryValidatorCommissionResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); + return promise.then((data) => QueryValidatorCommissionResponse.decode(new _m0.Reader(data))); } - ValidatorSlashes( - request: QueryValidatorSlashesRequest - ): Promise { + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise { const data = QueryValidatorSlashesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "ValidatorSlashes", - data - ); - return promise.then((data) => - QueryValidatorSlashesResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); + return promise.then((data) => QueryValidatorSlashesResponse.decode(new _m0.Reader(data))); } - DelegationRewards( - request: QueryDelegationRewardsRequest - ): Promise { + DelegationRewards(request: QueryDelegationRewardsRequest): Promise { const data = QueryDelegationRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegationRewards", - data - ); - return promise.then((data) => - QueryDelegationRewardsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); + return promise.then((data) => QueryDelegationRewardsResponse.decode(new _m0.Reader(data))); } - DelegationTotalRewards( - request: QueryDelegationTotalRewardsRequest - ): Promise { + DelegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise { const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegationTotalRewards", - data - ); - return promise.then((data) => - QueryDelegationTotalRewardsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); + return promise.then((data) => QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data))); } - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise { + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegatorValidators", - data - ); - return promise.then((data) => - QueryDelegatorValidatorsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); } DelegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest + request: QueryDelegatorWithdrawAddressRequest, ): Promise { const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "DelegatorWithdrawAddress", - data - ); - return promise.then((data) => - QueryDelegatorWithdrawAddressResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); + return promise.then((data) => QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data))); } - CommunityPool( - request: QueryCommunityPoolRequest - ): Promise { + CommunityPool(request: QueryCommunityPoolRequest): Promise { const data = QueryCommunityPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Query", - "CommunityPool", - data - ); - return promise.then((data) => - QueryCommunityPoolResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); + return promise.then((data) => QueryCommunityPoolResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1840,7 +1437,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts index 0ffcb416ef..89b0780c7b 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts @@ -1,7 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; +import { Params } from "./distribution"; export const protobufPackage = "cosmos.distribution.v1beta1"; @@ -10,35 +11,51 @@ export const protobufPackage = "cosmos.distribution.v1beta1"; * a delegator (or validator self-delegation). */ export interface MsgSetWithdrawAddress { - delegator_address: string; - withdraw_address: string; + delegatorAddress: string; + withdrawAddress: string; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ -export interface MsgSetWithdrawAddressResponse {} +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ +export interface MsgSetWithdrawAddressResponse { +} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator * from a single validator. */ export interface MsgWithdrawDelegatorReward { - delegator_address: string; - validator_address: string; + delegatorAddress: string; + validatorAddress: string; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. */ export interface MsgWithdrawValidatorCommission { - validator_address: string; + validatorAddress: string; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} /** * MsgFundCommunityPool allows an account to directly @@ -50,39 +67,84 @@ export interface MsgFundCommunityPool { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ -export interface MsgFundCommunityPoolResponse {} +export interface MsgFundCommunityPoolResponse { +} -const baseMsgSetWithdrawAddress: object = { - delegator_address: "", - withdraw_address: "", -}; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpend { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + recipient: string; + amount: Coin[]; +} + +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponse { +} + +function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { + return { delegatorAddress: "", withdrawAddress: "" }; +} export const MsgSetWithdrawAddress = { - encode( - message: MsgSetWithdrawAddress, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.withdraw_address !== "") { - writer.uint32(18).string(message.withdraw_address); + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; + const message = createBaseMsgSetWithdrawAddress(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.withdraw_address = reader.string(); + message.withdrawAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -93,78 +155,40 @@ export const MsgSetWithdrawAddress = { }, fromJSON(object: any): MsgSetWithdrawAddress { - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = String(object.withdraw_address); - } else { - message.withdraw_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "", + }; }, toJSON(message: MsgSetWithdrawAddress): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.withdraw_address !== undefined && - (obj.withdraw_address = message.withdraw_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial( - object: DeepPartial - ): MsgSetWithdrawAddress { - const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdraw_address = object.withdraw_address; - } else { - message.withdraw_address = ""; - } + fromPartial, I>>(object: I): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.withdrawAddress = object.withdrawAddress ?? ""; return message; }, }; -const baseMsgSetWithdrawAddressResponse: object = {}; +function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { + return {}; +} export const MsgSetWithdrawAddressResponse = { - encode( - _: MsgSetWithdrawAddressResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgSetWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSetWithdrawAddressResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; + const message = createBaseMsgSetWithdrawAddressResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -177,10 +201,7 @@ export const MsgSetWithdrawAddressResponse = { }, fromJSON(_: any): MsgSetWithdrawAddressResponse { - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; - return message; + return {}; }, toJSON(_: MsgSetWithdrawAddressResponse): unknown { @@ -188,52 +209,39 @@ export const MsgSetWithdrawAddressResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgSetWithdrawAddressResponse { - const message = { - ...baseMsgSetWithdrawAddressResponse, - } as MsgSetWithdrawAddressResponse; + fromPartial, I>>(_: I): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse(); return message; }, }; -const baseMsgWithdrawDelegatorReward: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { + return { delegatorAddress: "", validatorAddress: "" }; +} export const MsgWithdrawDelegatorReward = { - encode( - message: MsgWithdrawDelegatorReward, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawDelegatorReward { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; + const message = createBaseMsgWithdrawDelegatorReward(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -244,85 +252,49 @@ export const MsgWithdrawDelegatorReward = { }, fromJSON(object: any): MsgWithdrawDelegatorReward { - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + }; }, toJSON(message: MsgWithdrawDelegatorReward): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial( - object: DeepPartial - ): MsgWithdrawDelegatorReward { - const message = { - ...baseMsgWithdrawDelegatorReward, - } as MsgWithdrawDelegatorReward; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + fromPartial, I>>(object: I): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseMsgWithdrawDelegatorRewardResponse: object = {}; +function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { + return { amount: [] }; +} export const MsgWithdrawDelegatorRewardResponse = { - encode( - _: MsgWithdrawDelegatorRewardResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgWithdrawDelegatorRewardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawDelegatorRewardResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -331,55 +303,50 @@ export const MsgWithdrawDelegatorRewardResponse = { return message; }, - fromJSON(_: any): MsgWithdrawDelegatorRewardResponse { - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; - return message; + fromJSON(object: any): MsgWithdrawDelegatorRewardResponse { + return { amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(_: MsgWithdrawDelegatorRewardResponse): unknown { + toJSON(message: MsgWithdrawDelegatorRewardResponse): unknown { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } return obj; }, - fromPartial( - _: DeepPartial + fromPartial, I>>( + object: I, ): MsgWithdrawDelegatorRewardResponse { - const message = { - ...baseMsgWithdrawDelegatorRewardResponse, - } as MsgWithdrawDelegatorRewardResponse; + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseMsgWithdrawValidatorCommission: object = { validator_address: "" }; +function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { + return { validatorAddress: "" }; +} export const MsgWithdrawValidatorCommission = { - encode( - message: MsgWithdrawValidatorCommission, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); + encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawValidatorCommission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; + const message = createBaseMsgWithdrawValidatorCommission(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -390,67 +357,46 @@ export const MsgWithdrawValidatorCommission = { }, fromJSON(object: any): MsgWithdrawValidatorCommission { - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" }; }, toJSON(message: MsgWithdrawValidatorCommission): unknown { const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): MsgWithdrawValidatorCommission { - const message = { - ...baseMsgWithdrawValidatorCommission, - } as MsgWithdrawValidatorCommission; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + const message = createBaseMsgWithdrawValidatorCommission(); + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseMsgWithdrawValidatorCommissionResponse: object = {}; +function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { + return { amount: [] }; +} export const MsgWithdrawValidatorCommissionResponse = { - encode( - _: MsgWithdrawValidatorCommissionResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgWithdrawValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWithdrawValidatorCommissionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -459,35 +405,35 @@ export const MsgWithdrawValidatorCommissionResponse = { return message; }, - fromJSON(_: any): MsgWithdrawValidatorCommissionResponse { - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; - return message; + fromJSON(object: any): MsgWithdrawValidatorCommissionResponse { + return { amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(_: MsgWithdrawValidatorCommissionResponse): unknown { + toJSON(message: MsgWithdrawValidatorCommissionResponse): unknown { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } return obj; }, - fromPartial( - _: DeepPartial + fromPartial, I>>( + object: I, ): MsgWithdrawValidatorCommissionResponse { - const message = { - ...baseMsgWithdrawValidatorCommissionResponse, - } as MsgWithdrawValidatorCommissionResponse; + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseMsgFundCommunityPool: object = { depositor: "" }; +function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { + return { amount: [], depositor: "" }; +} export const MsgFundCommunityPool = { - encode( - message: MsgFundCommunityPool, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgFundCommunityPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -497,11 +443,10 @@ export const MsgFundCommunityPool = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgFundCommunityPool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; + const message = createBaseMsgFundCommunityPool(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -520,25 +465,16 @@ export const MsgFundCommunityPool = { }, fromJSON(object: any): MsgFundCommunityPool { - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - return message; + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + depositor: isSet(object.depositor) ? String(object.depositor) : "", + }; }, toJSON(message: MsgFundCommunityPool): unknown { const obj: any = {}; if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } @@ -546,42 +482,126 @@ export const MsgFundCommunityPool = { return obj; }, - fromPartial(object: DeepPartial): MsgFundCommunityPool { - const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); + fromPartial, I>>(object: I): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + message.depositor = object.depositor ?? ""; + return message; + }, +}; + +function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { + return {}; +} + +export const MsgFundCommunityPoolResponse = { + encode(_: MsgFundCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgFundCommunityPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; + return message; + }, + + fromJSON(_: any): MsgFundCommunityPoolResponse { + return {}; + }, + + toJSON(_: MsgFundCommunityPoolResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, }; -const baseMsgFundCommunityPoolResponse: object = {}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} -export const MsgFundCommunityPoolResponse = { - encode( - _: MsgFundCommunityPoolResponse, - writer: Writer = Writer.create() - ): Writer { +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgFundCommunityPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; + const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -593,24 +613,127 @@ export const MsgFundCommunityPoolResponse = { return message; }, - fromJSON(_: any): MsgFundCommunityPoolResponse { - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, +}; + +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { authority: "", recipient: "", amount: [] }; +} + +export const MsgCommunityPoolSpend = { + encode(message: MsgCommunityPoolSpend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.recipient !== "") { + writer.uint32(18).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, - toJSON(_: MsgFundCommunityPoolResponse): unknown { + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCommunityPoolSpend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.recipient = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCommunityPoolSpend { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + recipient: isSet(object.recipient) ? String(object.recipient) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: MsgCommunityPoolSpend): unknown { const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.recipient !== undefined && (obj.recipient = message.recipient); + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } return obj; }, - fromPartial( - _: DeepPartial - ): MsgFundCommunityPoolResponse { - const message = { - ...baseMsgFundCommunityPoolResponse, - } as MsgFundCommunityPoolResponse; + fromPartial, I>>(object: I): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + message.authority = object.authority ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} + +export const MsgCommunityPoolSpendResponse = { + encode(_: MsgCommunityPoolSpendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCommunityPoolSpendResponse { + return {}; + }, + + toJSON(_: MsgCommunityPoolSpendResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); return message; }, }; @@ -621,109 +744,105 @@ export interface Msg { * SetWithdrawAddress defines a method to change the withdraw address * for a delegator (or validator self-delegation). */ - SetWithdrawAddress( - request: MsgSetWithdrawAddress - ): Promise; + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise; /** * WithdrawDelegatorReward defines a method to withdraw rewards of delegator * from a single validator. */ - WithdrawDelegatorReward( - request: MsgWithdrawDelegatorReward - ): Promise; + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; /** * WithdrawValidatorCommission defines a method to withdraw the * full commission to the validator address. */ - WithdrawValidatorCommission( - request: MsgWithdrawValidatorCommission - ): Promise; + WithdrawValidatorCommission(request: MsgWithdrawValidatorCommission): Promise; /** * FundCommunityPool defines a method to allow an account to directly * fund the community pool. */ - FundCommunityPool( - request: MsgFundCommunityPool - ): Promise; + FundCommunityPool(request: MsgFundCommunityPool): Promise; + /** + * UpdateParams defines a governance operation for updating the x/distribution + * module parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; + /** + * CommunityPoolSpend defines a governance operation for sending tokens from + * the community pool in the x/distribution module to another account, which + * could be the governance module itself. The authority is defined in the + * keeper. + * + * Since: cosmos-sdk 0.47 + */ + CommunityPoolSpend(request: MsgCommunityPoolSpend): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.SetWithdrawAddress = this.SetWithdrawAddress.bind(this); + this.WithdrawDelegatorReward = this.WithdrawDelegatorReward.bind(this); + this.WithdrawValidatorCommission = this.WithdrawValidatorCommission.bind(this); + this.FundCommunityPool = this.FundCommunityPool.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); + this.CommunityPoolSpend = this.CommunityPoolSpend.bind(this); } - SetWithdrawAddress( - request: MsgSetWithdrawAddress - ): Promise { + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "SetWithdrawAddress", - data - ); - return promise.then((data) => - MsgSetWithdrawAddressResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); + return promise.then((data) => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); } - WithdrawDelegatorReward( - request: MsgWithdrawDelegatorReward - ): Promise { + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { const data = MsgWithdrawDelegatorReward.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "WithdrawDelegatorReward", - data - ); - return promise.then((data) => - MsgWithdrawDelegatorRewardResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); + return promise.then((data) => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); } WithdrawValidatorCommission( - request: MsgWithdrawValidatorCommission + request: MsgWithdrawValidatorCommission, ): Promise { const data = MsgWithdrawValidatorCommission.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "WithdrawValidatorCommission", - data - ); - return promise.then((data) => - MsgWithdrawValidatorCommissionResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); + return promise.then((data) => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); } - FundCommunityPool( - request: MsgFundCommunityPool - ): Promise { + FundCommunityPool(request: MsgFundCommunityPool): Promise { const data = MsgFundCommunityPool.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.distribution.v1beta1.Msg", - "FundCommunityPool", - data - ); - return promise.then((data) => - MsgFundCommunityPoolResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); + return promise.then((data) => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } + + CommunityPoolSpend(request: MsgCommunityPoolSpend): Promise { + const data = MsgCommunityPoolSpend.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); + return promise.then((data) => MsgCommunityPoolSpendResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/index.ts index e2c1a83658..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/index.ts @@ -1,61 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx"; - - -const types = [ - ["/cosmos.evidence.v1beta1.MsgSubmitEvidence", MsgSubmitEvidence], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitEvidence: (data: MsgSubmitEvidence): EncodeObject => ({ typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", value: MsgSubmitEvidence.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/module.ts new file mode 100755 index 0000000000..d558ef724e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/module.ts @@ -0,0 +1,132 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx"; + +import { Equivocation as typeEquivocation} from "./types" + +export { MsgSubmitEvidence }; + +type sendMsgSubmitEvidenceParams = { + value: MsgSubmitEvidence, + fee?: StdFee, + memo?: string +}; + + +type msgSubmitEvidenceParams = { + value: MsgSubmitEvidence, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgSubmitEvidence({ value, fee, memo }: sendMsgSubmitEvidenceParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSubmitEvidence: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSubmitEvidence({ value: MsgSubmitEvidence.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSubmitEvidence: Could not broadcast Tx: '+ e.message) + } + }, + + + msgSubmitEvidence({ value }: msgSubmitEvidenceParams): EncodeObject { + try { + return { typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", value: MsgSubmitEvidence.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSubmitEvidence: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Equivocation: getStructure(typeEquivocation.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosEvidenceV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/registry.ts new file mode 100755 index 0000000000..e6ec92c71e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/registry.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.evidence.v1beta1.MsgSubmitEvidence", MsgSubmitEvidence], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/rest.ts index a3dc469a3c..d56d5e6b26 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -201,10 +198,19 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } @@ -228,10 +234,11 @@ export interface V1Beta1QueryEvidenceResponse { evidence?: ProtobufAny; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -241,30 +248,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -272,149 +270,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -456,12 +391,13 @@ export class Api extends HttpClient + queryEvidence = (hash: string, query?: { evidence_hash?: string }, params: RequestParams = {}) => this.request({ - path: `/cosmos/evidence/v1beta1/evidence/${evidence_hash}`, + path: `/cosmos/evidence/v1beta1/evidence/${hash}`, method: "GET", + query: query, format: "json", ...params, }); diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types.ts new file mode 100755 index 0000000000..e0f369cb40 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { Equivocation } from "./types/cosmos/evidence/v1beta1/evidence" + + +export { + Equivocation, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts index 9d4f0176e0..14e54b849b 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts @@ -1,8 +1,8 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "cosmos.evidence.v1beta1"; @@ -11,38 +11,43 @@ export const protobufPackage = "cosmos.evidence.v1beta1"; * signing misbehavior. */ export interface Equivocation { + /** height is the equivocation height. */ height: number; - time: Date | undefined; + /** time is the equivocation time. */ + time: + | Date + | undefined; + /** power is the equivocation validator power. */ power: number; - consensus_address: string; + /** consensus_address is the equivocation validator consensus address. */ + consensusAddress: string; } -const baseEquivocation: object = { height: 0, power: 0, consensus_address: "" }; +function createBaseEquivocation(): Equivocation { + return { height: 0, time: undefined, power: 0, consensusAddress: "" }; +} export const Equivocation = { - encode(message: Equivocation, writer: Writer = Writer.create()): Writer { + encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); } if (message.power !== 0) { writer.uint32(24).int64(message.power); } - if (message.consensus_address !== "") { - writer.uint32(34).string(message.consensus_address); + if (message.consensusAddress !== "") { + writer.uint32(34).string(message.consensusAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Equivocation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEquivocation } as Equivocation; + const message = createBaseEquivocation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -50,15 +55,13 @@ export const Equivocation = { message.height = longToNumber(reader.int64() as Long); break; case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 3: message.power = longToNumber(reader.int64() as Long); break; case 4: - message.consensus_address = reader.string(); + message.consensusAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -69,95 +72,63 @@ export const Equivocation = { }, fromJSON(object: any): Equivocation { - const message = { ...baseEquivocation } as Equivocation; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - if ( - object.consensus_address !== undefined && - object.consensus_address !== null - ) { - message.consensus_address = String(object.consensus_address); - } else { - message.consensus_address = ""; - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + power: isSet(object.power) ? Number(object.power) : 0, + consensusAddress: isSet(object.consensusAddress) ? String(object.consensusAddress) : "", + }; }, toJSON(message: Equivocation): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.power !== undefined && (obj.power = message.power); - message.consensus_address !== undefined && - (obj.consensus_address = message.consensus_address); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.power !== undefined && (obj.power = Math.round(message.power)); + message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); return obj; }, - fromPartial(object: DeepPartial): Equivocation { - const message = { ...baseEquivocation } as Equivocation; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } - if ( - object.consensus_address !== undefined && - object.consensus_address !== null - ) { - message.consensus_address = object.consensus_address; - } else { - message.consensus_address = ""; - } + fromPartial, I>>(object: I): Equivocation { + const message = createBaseEquivocation(); + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.power = object.power ?? 0; + message.consensusAddress = object.consensusAddress ?? ""; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -187,7 +158,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/genesis.ts index 652afe1d8f..3cc140e670 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/genesis.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "cosmos.evidence.v1beta1"; @@ -11,21 +11,22 @@ export interface GenesisState { evidence: Any[]; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { evidence: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -41,47 +42,33 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromJSON(e)); - } - } - return message; + return { evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromJSON(e)) : [] }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Any.toJSON(e) : undefined - ); + obj.evidence = message.evidence.map((e) => e ? Any.toJSON(e) : undefined); } else { obj.evidence = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts index 883e6b4551..b7639b3a42 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts @@ -1,18 +1,26 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; export const protobufPackage = "cosmos.evidence.v1beta1"; /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { - /** evidence_hash defines the hash of the requested evidence. */ - evidence_hash: Uint8Array; + /** + * evidence_hash defines the hash of the requested evidence. + * Deprecated: Use hash, a HEX encoded string, instead. + * + * @deprecated + */ + evidenceHash: Uint8Array; + /** + * hash defines the evidence hash of the requested evidence. + * + * Since: cosmos-sdk 0.47 + */ + hash: string; } /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ @@ -41,28 +49,33 @@ export interface QueryAllEvidenceResponse { pagination: PageResponse | undefined; } -const baseQueryEvidenceRequest: object = {}; +function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { + return { evidenceHash: new Uint8Array(), hash: "" }; +} export const QueryEvidenceRequest = { - encode( - message: QueryEvidenceRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.evidence_hash.length !== 0) { - writer.uint32(10).bytes(message.evidence_hash); + encode(message: QueryEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.evidenceHash.length !== 0) { + writer.uint32(10).bytes(message.evidenceHash); + } + if (message.hash !== "") { + writer.uint32(18).string(message.hash); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryEvidenceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; + const message = createBaseQueryEvidenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.evidence_hash = reader.bytes(); + message.evidenceHash = reader.bytes(); + break; + case 2: + message.hash = reader.string(); break; default: reader.skipType(tag & 7); @@ -73,52 +86,46 @@ export const QueryEvidenceRequest = { }, fromJSON(object: any): QueryEvidenceRequest { - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - return message; + return { + evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), + hash: isSet(object.hash) ? String(object.hash) : "", + }; }, toJSON(message: QueryEvidenceRequest): unknown { const obj: any = {}; - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() + message.evidenceHash !== undefined + && (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), )); + message.hash !== undefined && (obj.hash = message.hash); return obj; }, - fromPartial(object: DeepPartial): QueryEvidenceRequest { - const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } + fromPartial, I>>(object: I): QueryEvidenceRequest { + const message = createBaseQueryEvidenceRequest(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.hash = object.hash ?? ""; return message; }, }; -const baseQueryEvidenceResponse: object = {}; +function createBaseQueryEvidenceResponse(): QueryEvidenceResponse { + return { evidence: undefined }; +} export const QueryEvidenceResponse = { - encode( - message: QueryEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.evidence !== undefined) { Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; + const message = createBaseQueryEvidenceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -134,56 +141,40 @@ export const QueryEvidenceResponse = { }, fromJSON(object: any): QueryEvidenceResponse { - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - return message; + return { evidence: isSet(object.evidence) ? Any.fromJSON(object.evidence) : undefined }; }, toJSON(message: QueryEvidenceResponse): unknown { const obj: any = {}; - message.evidence !== undefined && - (obj.evidence = message.evidence - ? Any.toJSON(message.evidence) - : undefined); + message.evidence !== undefined && (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryEvidenceResponse { - const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } + fromPartial, I>>(object: I): QueryEvidenceResponse { + const message = createBaseQueryEvidenceResponse(); + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? Any.fromPartial(object.evidence) + : undefined; return message; }, }; -const baseQueryAllEvidenceRequest: object = {}; +function createBaseQueryAllEvidenceRequest(): QueryAllEvidenceRequest { + return { pagination: undefined }; +} export const QueryAllEvidenceRequest = { - encode( - message: QueryAllEvidenceRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; + const message = createBaseQueryAllEvidenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -199,70 +190,44 @@ export const QueryAllEvidenceRequest = { }, fromJSON(object: any): QueryAllEvidenceRequest { - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryAllEvidenceRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllEvidenceRequest { - const message = { - ...baseQueryAllEvidenceRequest, - } as QueryAllEvidenceRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllEvidenceRequest { + const message = createBaseQueryAllEvidenceRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllEvidenceResponse: object = {}; +function createBaseQueryAllEvidenceResponse(): QueryAllEvidenceResponse { + return { evidence: [], pagination: undefined }; +} export const QueryAllEvidenceResponse = { - encode( - message: QueryAllEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; + const message = createBaseQueryAllEvidenceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -281,56 +246,30 @@ export const QueryAllEvidenceResponse = { }, fromJSON(object: any): QueryAllEvidenceResponse { - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllEvidenceResponse): unknown { const obj: any = {}; if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Any.toJSON(e) : undefined - ); + obj.evidence = message.evidence.map((e) => e ? Any.toJSON(e) : undefined); } else { obj.evidence = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllEvidenceResponse { - const message = { - ...baseQueryAllEvidenceResponse, - } as QueryAllEvidenceResponse; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Any.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllEvidenceResponse { + const message = createBaseQueryAllEvidenceResponse(); + message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; @@ -340,91 +279,88 @@ export interface Query { /** Evidence queries evidence based on evidence hash. */ Evidence(request: QueryEvidenceRequest): Promise; /** AllEvidence queries all evidence. */ - AllEvidence( - request: QueryAllEvidenceRequest - ): Promise; + AllEvidence(request: QueryAllEvidenceRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Evidence = this.Evidence.bind(this); + this.AllEvidence = this.AllEvidence.bind(this); } Evidence(request: QueryEvidenceRequest): Promise { const data = QueryEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Query", - "Evidence", - data - ); - return promise.then((data) => - QueryEvidenceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data); + return promise.then((data) => QueryEvidenceResponse.decode(new _m0.Reader(data))); } - AllEvidence( - request: QueryAllEvidenceRequest - ): Promise { + AllEvidence(request: QueryAllEvidenceRequest): Promise { const data = QueryAllEvidenceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Query", - "AllEvidence", - data - ); - return promise.then((data) => - QueryAllEvidenceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "AllEvidence", data); + return promise.then((data) => QueryAllEvidenceResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts index 3dab1800d7..2dd6d7b54c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; export const protobufPackage = "cosmos.evidence.v1beta1"; @@ -10,7 +10,9 @@ export const protobufPackage = "cosmos.evidence.v1beta1"; * Evidence of misbehavior such as equivocation or counterfactual signing. */ export interface MsgSubmitEvidence { + /** submitter is the signer account address of evidence. */ submitter: string; + /** evidence defines the evidence of misbehavior. */ evidence: Any | undefined; } @@ -20,10 +22,12 @@ export interface MsgSubmitEvidenceResponse { hash: Uint8Array; } -const baseMsgSubmitEvidence: object = { submitter: "" }; +function createBaseMsgSubmitEvidence(): MsgSubmitEvidence { + return { submitter: "", evidence: undefined }; +} export const MsgSubmitEvidence = { - encode(message: MsgSubmitEvidence, writer: Writer = Writer.create()): Writer { + encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.submitter !== "") { writer.uint32(10).string(message.submitter); } @@ -33,10 +37,10 @@ export const MsgSubmitEvidence = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSubmitEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; + const message = createBaseMsgSubmitEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -55,68 +59,45 @@ export const MsgSubmitEvidence = { }, fromJSON(object: any): MsgSubmitEvidence { - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = String(object.submitter); - } else { - message.submitter = ""; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - return message; + return { + submitter: isSet(object.submitter) ? String(object.submitter) : "", + evidence: isSet(object.evidence) ? Any.fromJSON(object.evidence) : undefined, + }; }, toJSON(message: MsgSubmitEvidence): unknown { const obj: any = {}; message.submitter !== undefined && (obj.submitter = message.submitter); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? Any.toJSON(message.evidence) - : undefined); + message.evidence !== undefined && (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgSubmitEvidence { - const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = object.submitter; - } else { - message.submitter = ""; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = Any.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } + fromPartial, I>>(object: I): MsgSubmitEvidence { + const message = createBaseMsgSubmitEvidence(); + message.submitter = object.submitter ?? ""; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? Any.fromPartial(object.evidence) + : undefined; return message; }, }; -const baseMsgSubmitEvidenceResponse: object = {}; +function createBaseMsgSubmitEvidenceResponse(): MsgSubmitEvidenceResponse { + return { hash: new Uint8Array() }; +} export const MsgSubmitEvidenceResponse = { - encode( - message: MsgSubmitEvidenceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSubmitEvidenceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; + const message = createBaseMsgSubmitEvidenceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -132,35 +113,19 @@ export const MsgSubmitEvidenceResponse = { }, fromJSON(object: any): MsgSubmitEvidenceResponse { - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; + return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array() }; }, toJSON(message: MsgSubmitEvidenceResponse): unknown { const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): MsgSubmitEvidenceResponse { - const message = { - ...baseMsgSubmitEvidenceResponse, - } as MsgSubmitEvidenceResponse; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } + fromPartial, I>>(object: I): MsgSubmitEvidenceResponse { + const message = createBaseMsgSubmitEvidenceResponse(); + message.hash = object.hash ?? new Uint8Array(); return message; }, }; @@ -171,79 +136,81 @@ export interface Msg { * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or * counterfactual signing. */ - SubmitEvidence( - request: MsgSubmitEvidence - ): Promise; + SubmitEvidence(request: MsgSubmitEvidence): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.SubmitEvidence = this.SubmitEvidence.bind(this); } - SubmitEvidence( - request: MsgSubmitEvidence - ): Promise { + SubmitEvidence(request: MsgSubmitEvidence): Promise { const data = MsgSubmitEvidence.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.evidence.v1beta1.Msg", - "SubmitEvidence", - data - ); - return promise.then((data) => - MsgSubmitEvidenceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); + return promise.then((data) => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.evidence.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/index.ts index 0a0f9fe99e..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/index.ts @@ -1,64 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgGrantAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; -import { MsgRevokeAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; - - -const types = [ - ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], - ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgGrantAllowance: (data: MsgGrantAllowance): EncodeObject => ({ typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", value: MsgGrantAllowance.fromPartial( data ) }), - msgRevokeAllowance: (data: MsgRevokeAllowance): EncodeObject => ({ typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: MsgRevokeAllowance.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/module.ts new file mode 100755 index 0000000000..e39a589222 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/module.ts @@ -0,0 +1,171 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgGrantAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; +import { MsgRevokeAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; + +import { BasicAllowance as typeBasicAllowance} from "./types" +import { PeriodicAllowance as typePeriodicAllowance} from "./types" +import { AllowedMsgAllowance as typeAllowedMsgAllowance} from "./types" +import { Grant as typeGrant} from "./types" + +export { MsgGrantAllowance, MsgRevokeAllowance }; + +type sendMsgGrantAllowanceParams = { + value: MsgGrantAllowance, + fee?: StdFee, + memo?: string +}; + +type sendMsgRevokeAllowanceParams = { + value: MsgRevokeAllowance, + fee?: StdFee, + memo?: string +}; + + +type msgGrantAllowanceParams = { + value: MsgGrantAllowance, +}; + +type msgRevokeAllowanceParams = { + value: MsgRevokeAllowance, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgGrantAllowance({ value, fee, memo }: sendMsgGrantAllowanceParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgGrantAllowance: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgGrantAllowance({ value: MsgGrantAllowance.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgGrantAllowance: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgRevokeAllowance({ value, fee, memo }: sendMsgRevokeAllowanceParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgRevokeAllowance: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgRevokeAllowance({ value: MsgRevokeAllowance.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgRevokeAllowance: Could not broadcast Tx: '+ e.message) + } + }, + + + msgGrantAllowance({ value }: msgGrantAllowanceParams): EncodeObject { + try { + return { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", value: MsgGrantAllowance.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgGrantAllowance: Could not create message: ' + e.message) + } + }, + + msgRevokeAllowance({ value }: msgRevokeAllowanceParams): EncodeObject { + try { + return { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: MsgRevokeAllowance.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgRevokeAllowance: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + BasicAllowance: getStructure(typeBasicAllowance.fromPartial({})), + PeriodicAllowance: getStructure(typePeriodicAllowance.fromPartial({})), + AllowedMsgAllowance: getStructure(typeAllowedMsgAllowance.fromPartial({})), + Grant: getStructure(typeGrant.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosFeegrantV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/registry.ts new file mode 100755 index 0000000000..5cc62ebf26 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/registry.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgGrantAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; +import { MsgRevokeAllowance } from "./types/cosmos/feegrant/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], + ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/rest.ts index 73f501aa84..09c3116148 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -141,7 +138,7 @@ export interface V1Beta1Grant { /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee?: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: ProtobufAny; } @@ -211,10 +208,19 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } @@ -227,8 +233,10 @@ export interface V1Beta1QueryAllowanceResponse { } /** - * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. - */ +* QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + +Since: cosmos-sdk 0.46 +*/ export interface V1Beta1QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ allowances?: V1Beta1Grant[]; @@ -248,10 +256,11 @@ export interface V1Beta1QueryAllowancesResponse { pagination?: V1Beta1PageResponse; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -261,30 +270,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -292,149 +292,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -488,14 +425,13 @@ export class Api extends HttpClient>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/feegrant.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/feegrant.ts index 719f455c3f..611c7b3f76 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/feegrant.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/feegrant.ts @@ -1,26 +1,26 @@ //@ts-nocheck /* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Duration } from "../../../google/protobuf/duration"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Writer, Reader } from "protobufjs/minimal"; +import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.feegrant.v1beta1"; /** Since: cosmos-sdk 0.43 */ /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowance { /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is + * spend_limit specifies the maximum amount of coins that can be spent + * by this allowance and will be updated as coins are spent. If it is * empty, there is no spend limit and any amount of coins can be spent. */ - spend_limit: Coin[]; + spendLimit: Coin[]; /** expiration specifies an optional time when this allowance expires */ expiration: Date | undefined; } @@ -31,33 +31,39 @@ export interface BasicAllowance { */ export interface PeriodicAllowance { /** basic specifies a struct of `BasicAllowance` */ - basic: BasicAllowance | undefined; + basic: + | BasicAllowance + | undefined; /** * period specifies the time duration in which period_spend_limit coins can * be spent before that allowance is reset */ - period: Duration | undefined; + period: + | Duration + | undefined; /** * period_spend_limit specifies the maximum number of coins that can be spent * in the period */ - period_spend_limit: Coin[]; + periodSpendLimit: Coin[]; /** period_can_spend is the number of coins left to be spent before the period_reset time */ - period_can_spend: Coin[]; + periodCanSpend: Coin[]; /** * period_reset is the time at which this period resets and a new one begins, * it is calculated from the start time of the first transaction after the * last period ended */ - period_reset: Date | undefined; + periodReset: Date | undefined; } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowance { - /** allowance can be any of basic and filtered fee allowance. */ - allowance: Any | undefined; + /** allowance can be any of basic and periodic fee allowance. */ + allowance: + | Any + | undefined; /** allowed_messages are the messages for which the grantee has the access. */ - allowed_messages: string[]; + allowedMessages: string[]; } /** Grant is stored in the KVStore to record a grant with full context */ @@ -66,41 +72,37 @@ export interface Grant { granter: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance: Any | undefined; } -const baseBasicAllowance: object = {}; +function createBaseBasicAllowance(): BasicAllowance { + return { spendLimit: [], expiration: undefined }; +} export const BasicAllowance = { - encode(message: BasicAllowance, writer: Writer = Writer.create()): Writer { - for (const v of message.spend_limit) { + encode(message: BasicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.expiration !== undefined) { - Timestamp.encode( - toTimestamp(message.expiration), - writer.uint32(18).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BasicAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BasicAllowance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; + const message = createBaseBasicAllowance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.spend_limit.push(Coin.decode(reader, reader.uint32())); + message.spendLimit.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.expiration = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -111,86 +113,59 @@ export const BasicAllowance = { }, fromJSON(object: any): BasicAllowance { - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromJSON(e)); - } - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = fromJsonTimestamp(object.expiration); - } else { - message.expiration = undefined; - } - return message; + return { + spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], + expiration: isSet(object.expiration) ? fromJsonTimestamp(object.expiration) : undefined, + }; }, toJSON(message: BasicAllowance): unknown { const obj: any = {}; - if (message.spend_limit) { - obj.spend_limit = message.spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.spendLimit) { + obj.spendLimit = message.spendLimit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.spend_limit = []; + obj.spendLimit = []; } - message.expiration !== undefined && - (obj.expiration = - message.expiration !== undefined - ? message.expiration.toISOString() - : null); + message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); return obj; }, - fromPartial(object: DeepPartial): BasicAllowance { - const message = { ...baseBasicAllowance } as BasicAllowance; - message.spend_limit = []; - if (object.spend_limit !== undefined && object.spend_limit !== null) { - for (const e of object.spend_limit) { - message.spend_limit.push(Coin.fromPartial(e)); - } - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = object.expiration; - } else { - message.expiration = undefined; - } + fromPartial, I>>(object: I): BasicAllowance { + const message = createBaseBasicAllowance(); + message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; + message.expiration = object.expiration ?? undefined; return message; }, }; -const basePeriodicAllowance: object = {}; +function createBasePeriodicAllowance(): PeriodicAllowance { + return { basic: undefined, period: undefined, periodSpendLimit: [], periodCanSpend: [], periodReset: undefined }; +} export const PeriodicAllowance = { - encode(message: PeriodicAllowance, writer: Writer = Writer.create()): Writer { + encode(message: PeriodicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.basic !== undefined) { BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); } if (message.period !== undefined) { Duration.encode(message.period, writer.uint32(18).fork()).ldelim(); } - for (const v of message.period_spend_limit) { + for (const v of message.periodSpendLimit) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.period_can_spend) { + for (const v of message.periodCanSpend) { Coin.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.period_reset !== undefined) { - Timestamp.encode( - toTimestamp(message.period_reset), - writer.uint32(42).fork() - ).ldelim(); + if (message.periodReset !== undefined) { + Timestamp.encode(toTimestamp(message.periodReset), writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): PeriodicAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicAllowance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; + const message = createBasePeriodicAllowance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -201,15 +176,13 @@ export const PeriodicAllowance = { message.period = Duration.decode(reader, reader.uint32()); break; case 3: - message.period_spend_limit.push(Coin.decode(reader, reader.uint32())); + message.periodSpendLimit.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.period_can_spend.push(Coin.decode(reader, reader.uint32())); + message.periodCanSpend.push(Coin.decode(reader, reader.uint32())); break; case 5: - message.period_reset = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.periodReset = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -220,135 +193,71 @@ export const PeriodicAllowance = { }, fromJSON(object: any): PeriodicAllowance { - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; - if (object.basic !== undefined && object.basic !== null) { - message.basic = BasicAllowance.fromJSON(object.basic); - } else { - message.basic = undefined; - } - if (object.period !== undefined && object.period !== null) { - message.period = Duration.fromJSON(object.period); - } else { - message.period = undefined; - } - if ( - object.period_spend_limit !== undefined && - object.period_spend_limit !== null - ) { - for (const e of object.period_spend_limit) { - message.period_spend_limit.push(Coin.fromJSON(e)); - } - } - if ( - object.period_can_spend !== undefined && - object.period_can_spend !== null - ) { - for (const e of object.period_can_spend) { - message.period_can_spend.push(Coin.fromJSON(e)); - } - } - if (object.period_reset !== undefined && object.period_reset !== null) { - message.period_reset = fromJsonTimestamp(object.period_reset); - } else { - message.period_reset = undefined; - } - return message; + return { + basic: isSet(object.basic) ? BasicAllowance.fromJSON(object.basic) : undefined, + period: isSet(object.period) ? Duration.fromJSON(object.period) : undefined, + periodSpendLimit: Array.isArray(object?.periodSpendLimit) + ? object.periodSpendLimit.map((e: any) => Coin.fromJSON(e)) + : [], + periodCanSpend: Array.isArray(object?.periodCanSpend) + ? object.periodCanSpend.map((e: any) => Coin.fromJSON(e)) + : [], + periodReset: isSet(object.periodReset) ? fromJsonTimestamp(object.periodReset) : undefined, + }; }, toJSON(message: PeriodicAllowance): unknown { const obj: any = {}; - message.basic !== undefined && - (obj.basic = message.basic - ? BasicAllowance.toJSON(message.basic) - : undefined); - message.period !== undefined && - (obj.period = message.period - ? Duration.toJSON(message.period) - : undefined); - if (message.period_spend_limit) { - obj.period_spend_limit = message.period_spend_limit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + message.basic !== undefined && (obj.basic = message.basic ? BasicAllowance.toJSON(message.basic) : undefined); + message.period !== undefined && (obj.period = message.period ? Duration.toJSON(message.period) : undefined); + if (message.periodSpendLimit) { + obj.periodSpendLimit = message.periodSpendLimit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.period_spend_limit = []; + obj.periodSpendLimit = []; } - if (message.period_can_spend) { - obj.period_can_spend = message.period_can_spend.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.periodCanSpend) { + obj.periodCanSpend = message.periodCanSpend.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.period_can_spend = []; + obj.periodCanSpend = []; } - message.period_reset !== undefined && - (obj.period_reset = - message.period_reset !== undefined - ? message.period_reset.toISOString() - : null); + message.periodReset !== undefined && (obj.periodReset = message.periodReset.toISOString()); return obj; }, - fromPartial(object: DeepPartial): PeriodicAllowance { - const message = { ...basePeriodicAllowance } as PeriodicAllowance; - message.period_spend_limit = []; - message.period_can_spend = []; - if (object.basic !== undefined && object.basic !== null) { - message.basic = BasicAllowance.fromPartial(object.basic); - } else { - message.basic = undefined; - } - if (object.period !== undefined && object.period !== null) { - message.period = Duration.fromPartial(object.period); - } else { - message.period = undefined; - } - if ( - object.period_spend_limit !== undefined && - object.period_spend_limit !== null - ) { - for (const e of object.period_spend_limit) { - message.period_spend_limit.push(Coin.fromPartial(e)); - } - } - if ( - object.period_can_spend !== undefined && - object.period_can_spend !== null - ) { - for (const e of object.period_can_spend) { - message.period_can_spend.push(Coin.fromPartial(e)); - } - } - if (object.period_reset !== undefined && object.period_reset !== null) { - message.period_reset = object.period_reset; - } else { - message.period_reset = undefined; - } + fromPartial, I>>(object: I): PeriodicAllowance { + const message = createBasePeriodicAllowance(); + message.basic = (object.basic !== undefined && object.basic !== null) + ? BasicAllowance.fromPartial(object.basic) + : undefined; + message.period = (object.period !== undefined && object.period !== null) + ? Duration.fromPartial(object.period) + : undefined; + message.periodSpendLimit = object.periodSpendLimit?.map((e) => Coin.fromPartial(e)) || []; + message.periodCanSpend = object.periodCanSpend?.map((e) => Coin.fromPartial(e)) || []; + message.periodReset = object.periodReset ?? undefined; return message; }, }; -const baseAllowedMsgAllowance: object = { allowed_messages: "" }; +function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { + return { allowance: undefined, allowedMessages: [] }; +} export const AllowedMsgAllowance = { - encode( - message: AllowedMsgAllowance, - writer: Writer = Writer.create() - ): Writer { + encode(message: AllowedMsgAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.allowance !== undefined) { Any.encode(message.allowance, writer.uint32(10).fork()).ldelim(); } - for (const v of message.allowed_messages) { + for (const v of message.allowedMessages) { writer.uint32(18).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AllowedMsgAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AllowedMsgAllowance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; + const message = createBaseAllowedMsgAllowance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -356,7 +265,7 @@ export const AllowedMsgAllowance = { message.allowance = Any.decode(reader, reader.uint32()); break; case 2: - message.allowed_messages.push(reader.string()); + message.allowedMessages.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -367,62 +276,39 @@ export const AllowedMsgAllowance = { }, fromJSON(object: any): AllowedMsgAllowance { - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - if ( - object.allowed_messages !== undefined && - object.allowed_messages !== null - ) { - for (const e of object.allowed_messages) { - message.allowed_messages.push(String(e)); - } - } - return message; + return { + allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, + allowedMessages: Array.isArray(object?.allowedMessages) ? object.allowedMessages.map((e: any) => String(e)) : [], + }; }, toJSON(message: AllowedMsgAllowance): unknown { const obj: any = {}; - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); - if (message.allowed_messages) { - obj.allowed_messages = message.allowed_messages.map((e) => e); + message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); + if (message.allowedMessages) { + obj.allowedMessages = message.allowedMessages.map((e) => e); } else { - obj.allowed_messages = []; + obj.allowedMessages = []; } return obj; }, - fromPartial(object: DeepPartial): AllowedMsgAllowance { - const message = { ...baseAllowedMsgAllowance } as AllowedMsgAllowance; - message.allowed_messages = []; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } - if ( - object.allowed_messages !== undefined && - object.allowed_messages !== null - ) { - for (const e of object.allowed_messages) { - message.allowed_messages.push(e); - } - } + fromPartial, I>>(object: I): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance(); + message.allowance = (object.allowance !== undefined && object.allowance !== null) + ? Any.fromPartial(object.allowance) + : undefined; + message.allowedMessages = object.allowedMessages?.map((e) => e) || []; return message; }, }; -const baseGrant: object = { granter: "", grantee: "" }; +function createBaseGrant(): Grant { + return { granter: "", grantee: "", allowance: undefined }; +} export const Grant = { - encode(message: Grant, writer: Writer = Writer.create()): Writer { + encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -435,10 +321,10 @@ export const Grant = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Grant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGrant } as Grant; + const message = createBaseGrant(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -460,68 +346,43 @@ export const Grant = { }, fromJSON(object: any): Grant { - const message = { ...baseGrant } as Grant; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; + return { + granter: isSet(object.granter) ? String(object.granter) : "", + grantee: isSet(object.grantee) ? String(object.grantee) : "", + allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, + }; }, toJSON(message: Grant): unknown { const obj: any = {}; message.granter !== undefined && (obj.granter = message.granter); message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); + message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); return obj; }, - fromPartial(object: DeepPartial): Grant { - const message = { ...baseGrant } as Grant; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } + fromPartial, I>>(object: I): Grant { + const message = createBaseGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = (object.allowance !== undefined && object.allowance !== null) + ? Any.fromPartial(object.allowance) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -543,3 +404,7 @@ function fromJsonTimestamp(o: any): Date { return fromTimestamp(Timestamp.fromJSON(o)); } } + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/genesis.ts index 2562c93321..10fe39c2cc 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/genesis.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import { Grant } from "../../../cosmos/feegrant/v1beta1/feegrant"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Grant } from "./feegrant"; export const protobufPackage = "cosmos.feegrant.v1beta1"; @@ -12,21 +12,22 @@ export interface GenesisState { allowances: Grant[]; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { allowances: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -42,47 +43,35 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromJSON(e)); - } - } - return message; + return { + allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; if (message.allowances) { - obj.allowances = message.allowances.map((e) => - e ? Grant.toJSON(e) : undefined - ); + obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); } else { obj.allowances = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/query.ts index d2b13f3efa..a7c236331c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/query.ts @@ -1,11 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Grant } from "../../../cosmos/feegrant/v1beta1/feegrant"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Grant } from "./feegrant"; export const protobufPackage = "cosmos.feegrant.v1beta1"; @@ -40,14 +37,22 @@ export interface QueryAllowancesResponse { pagination: PageResponse | undefined; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequest { granter: string; /** pagination defines an pagination for the request. */ pagination: PageRequest | undefined; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ allowances: Grant[]; @@ -55,13 +60,12 @@ export interface QueryAllowancesByGranterResponse { pagination: PageResponse | undefined; } -const baseQueryAllowanceRequest: object = { granter: "", grantee: "" }; +function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { + return { granter: "", grantee: "" }; +} export const QueryAllowanceRequest = { - encode( - message: QueryAllowanceRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -71,10 +75,10 @@ export const QueryAllowanceRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllowanceRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; + const message = createBaseQueryAllowanceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -93,18 +97,10 @@ export const QueryAllowanceRequest = { }, fromJSON(object: any): QueryAllowanceRequest { - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - return message; + return { + granter: isSet(object.granter) ? String(object.granter) : "", + grantee: isSet(object.grantee) ? String(object.grantee) : "", + }; }, toJSON(message: QueryAllowanceRequest): unknown { @@ -114,41 +110,30 @@ export const QueryAllowanceRequest = { return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllowanceRequest { - const message = { ...baseQueryAllowanceRequest } as QueryAllowanceRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } + fromPartial, I>>(object: I): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; return message; }, }; -const baseQueryAllowanceResponse: object = {}; +function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { + return { allowance: undefined }; +} export const QueryAllowanceResponse = { - encode( - message: QueryAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.allowance !== undefined) { Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; + const message = createBaseQueryAllowanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -164,44 +149,31 @@ export const QueryAllowanceResponse = { }, fromJSON(object: any): QueryAllowanceResponse { - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Grant.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; + return { allowance: isSet(object.allowance) ? Grant.fromJSON(object.allowance) : undefined }; }, toJSON(message: QueryAllowanceResponse): unknown { const obj: any = {}; - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Grant.toJSON(message.allowance) - : undefined); + message.allowance !== undefined + && (obj.allowance = message.allowance ? Grant.toJSON(message.allowance) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllowanceResponse { - const message = { ...baseQueryAllowanceResponse } as QueryAllowanceResponse; - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Grant.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } + fromPartial, I>>(object: I): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse(); + message.allowance = (object.allowance !== undefined && object.allowance !== null) + ? Grant.fromPartial(object.allowance) + : undefined; return message; }, }; -const baseQueryAllowancesRequest: object = { grantee: "" }; +function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { + return { grantee: "", pagination: undefined }; +} export const QueryAllowancesRequest = { - encode( - message: QueryAllowancesRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -211,10 +183,10 @@ export const QueryAllowancesRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllowancesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; + const message = createBaseQueryAllowancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -233,74 +205,49 @@ export const QueryAllowancesRequest = { }, fromJSON(object: any): QueryAllowancesRequest { - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + grantee: isSet(object.grantee) ? String(object.grantee) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllowancesRequest): unknown { const obj: any = {}; message.grantee !== undefined && (obj.grantee = message.grantee); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllowancesRequest { - const message = { ...baseQueryAllowancesRequest } as QueryAllowancesRequest; - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest(); + message.grantee = object.grantee ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllowancesResponse: object = {}; +function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { + return { allowances: [], pagination: undefined }; +} export const QueryAllowancesResponse = { - encode( - message: QueryAllowancesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAllowancesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; + const message = createBaseQueryAllowancesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -319,67 +266,40 @@ export const QueryAllowancesResponse = { }, fromJSON(object: any): QueryAllowancesResponse { - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllowancesResponse): unknown { const obj: any = {}; if (message.allowances) { - obj.allowances = message.allowances.map((e) => - e ? Grant.toJSON(e) : undefined - ); + obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); } else { obj.allowances = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllowancesResponse { - const message = { - ...baseQueryAllowancesResponse, - } as QueryAllowancesResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllowancesByGranterRequest: object = { granter: "" }; +function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRequest { + return { granter: "", pagination: undefined }; +} export const QueryAllowancesByGranterRequest = { - encode( - message: QueryAllowancesByGranterRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowancesByGranterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -389,15 +309,10 @@ export const QueryAllowancesByGranterRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllowancesByGranterRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllowancesByGranterRequest, - } as QueryAllowancesByGranterRequest; + const message = createBaseQueryAllowancesByGranterRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -416,81 +331,51 @@ export const QueryAllowancesByGranterRequest = { }, fromJSON(object: any): QueryAllowancesByGranterRequest { - const message = { - ...baseQueryAllowancesByGranterRequest, - } as QueryAllowancesByGranterRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + granter: isSet(object.granter) ? String(object.granter) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllowancesByGranterRequest): unknown { const obj: any = {}; message.granter !== undefined && (obj.granter = message.granter); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryAllowancesByGranterRequest { - const message = { - ...baseQueryAllowancesByGranterRequest, - } as QueryAllowancesByGranterRequest; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryAllowancesByGranterRequest(); + message.granter = object.granter ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllowancesByGranterResponse: object = {}; +function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterResponse { + return { allowances: [], pagination: undefined }; +} export const QueryAllowancesByGranterResponse = { - encode( - message: QueryAllowancesByGranterResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllowancesByGranterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllowancesByGranterResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllowancesByGranterResponse, - } as QueryAllowancesByGranterResponse; - message.allowances = []; + const message = createBaseQueryAllowancesByGranterResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -509,56 +394,32 @@ export const QueryAllowancesByGranterResponse = { }, fromJSON(object: any): QueryAllowancesByGranterResponse { - const message = { - ...baseQueryAllowancesByGranterResponse, - } as QueryAllowancesByGranterResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + allowances: Array.isArray(object?.allowances) ? object.allowances.map((e: any) => Grant.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllowancesByGranterResponse): unknown { const obj: any = {}; if (message.allowances) { - obj.allowances = message.allowances.map((e) => - e ? Grant.toJSON(e) : undefined - ); + obj.allowances = message.allowances.map((e) => e ? Grant.toJSON(e) : undefined); } else { obj.allowances = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryAllowancesByGranterResponse { - const message = { - ...baseQueryAllowancesByGranterResponse, - } as QueryAllowancesByGranterResponse; - message.allowances = []; - if (object.allowances !== undefined && object.allowances !== null) { - for (const e of object.allowances) { - message.allowances.push(Grant.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; @@ -571,74 +432,54 @@ export interface Query { Allowances(request: QueryAllowancesRequest): Promise; /** * AllowancesByGranter returns all the grants given by an address - * Since v0.46 + * + * Since: cosmos-sdk 0.46 */ - AllowancesByGranter( - request: QueryAllowancesByGranterRequest - ): Promise; + AllowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Allowance = this.Allowance.bind(this); + this.Allowances = this.Allowances.bind(this); + this.AllowancesByGranter = this.AllowancesByGranter.bind(this); } Allowance(request: QueryAllowanceRequest): Promise { const data = QueryAllowanceRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Query", - "Allowance", - data - ); - return promise.then((data) => - QueryAllowanceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); + return promise.then((data) => QueryAllowanceResponse.decode(new _m0.Reader(data))); } - Allowances( - request: QueryAllowancesRequest - ): Promise { + Allowances(request: QueryAllowancesRequest): Promise { const data = QueryAllowancesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Query", - "Allowances", - data - ); - return promise.then((data) => - QueryAllowancesResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); + return promise.then((data) => QueryAllowancesResponse.decode(new _m0.Reader(data))); } - AllowancesByGranter( - request: QueryAllowancesByGranterRequest - ): Promise { + AllowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { const data = QueryAllowancesByGranterRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Query", - "AllowancesByGranter", - data - ); - return promise.then((data) => - QueryAllowancesByGranterResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); + return promise.then((data) => QueryAllowancesByGranterResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/tx.ts index 6c0eea4c81..b532e3a831 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/tx.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; export const protobufPackage = "cosmos.feegrant.v1beta1"; @@ -16,12 +16,13 @@ export interface MsgGrantAllowance { granter: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance: Any | undefined; } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ -export interface MsgGrantAllowanceResponse {} +export interface MsgGrantAllowanceResponse { +} /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowance { @@ -32,12 +33,15 @@ export interface MsgRevokeAllowance { } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ -export interface MsgRevokeAllowanceResponse {} +export interface MsgRevokeAllowanceResponse { +} -const baseMsgGrantAllowance: object = { granter: "", grantee: "" }; +function createBaseMsgGrantAllowance(): MsgGrantAllowance { + return { granter: "", grantee: "", allowance: undefined }; +} export const MsgGrantAllowance = { - encode(message: MsgGrantAllowance, writer: Writer = Writer.create()): Writer { + encode(message: MsgGrantAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -50,10 +54,10 @@ export const MsgGrantAllowance = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgGrantAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; + const message = createBaseMsgGrantAllowance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -75,76 +79,45 @@ export const MsgGrantAllowance = { }, fromJSON(object: any): MsgGrantAllowance { - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromJSON(object.allowance); - } else { - message.allowance = undefined; - } - return message; + return { + granter: isSet(object.granter) ? String(object.granter) : "", + grantee: isSet(object.grantee) ? String(object.grantee) : "", + allowance: isSet(object.allowance) ? Any.fromJSON(object.allowance) : undefined, + }; }, toJSON(message: MsgGrantAllowance): unknown { const obj: any = {}; message.granter !== undefined && (obj.granter = message.granter); message.grantee !== undefined && (obj.grantee = message.grantee); - message.allowance !== undefined && - (obj.allowance = message.allowance - ? Any.toJSON(message.allowance) - : undefined); + message.allowance !== undefined && (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgGrantAllowance { - const message = { ...baseMsgGrantAllowance } as MsgGrantAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Any.fromPartial(object.allowance); - } else { - message.allowance = undefined; - } + fromPartial, I>>(object: I): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = (object.allowance !== undefined && object.allowance !== null) + ? Any.fromPartial(object.allowance) + : undefined; return message; }, }; -const baseMsgGrantAllowanceResponse: object = {}; +function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { + return {}; +} export const MsgGrantAllowanceResponse = { - encode( - _: MsgGrantAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgGrantAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgGrantAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; + const message = createBaseMsgGrantAllowanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -157,10 +130,7 @@ export const MsgGrantAllowanceResponse = { }, fromJSON(_: any): MsgGrantAllowanceResponse { - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; - return message; + return {}; }, toJSON(_: MsgGrantAllowanceResponse): unknown { @@ -168,23 +138,18 @@ export const MsgGrantAllowanceResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgGrantAllowanceResponse { - const message = { - ...baseMsgGrantAllowanceResponse, - } as MsgGrantAllowanceResponse; + fromPartial, I>>(_: I): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); return message; }, }; -const baseMsgRevokeAllowance: object = { granter: "", grantee: "" }; +function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { + return { granter: "", grantee: "" }; +} export const MsgRevokeAllowance = { - encode( - message: MsgRevokeAllowance, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgRevokeAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -194,10 +159,10 @@ export const MsgRevokeAllowance = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgRevokeAllowance { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; + const message = createBaseMsgRevokeAllowance(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -216,18 +181,10 @@ export const MsgRevokeAllowance = { }, fromJSON(object: any): MsgRevokeAllowance { - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = String(object.grantee); - } else { - message.grantee = ""; - } - return message; + return { + granter: isSet(object.granter) ? String(object.granter) : "", + grantee: isSet(object.grantee) ? String(object.grantee) : "", + }; }, toJSON(message: MsgRevokeAllowance): unknown { @@ -237,41 +194,27 @@ export const MsgRevokeAllowance = { return obj; }, - fromPartial(object: DeepPartial): MsgRevokeAllowance { - const message = { ...baseMsgRevokeAllowance } as MsgRevokeAllowance; - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } else { - message.grantee = ""; - } + fromPartial, I>>(object: I): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; return message; }, }; -const baseMsgRevokeAllowanceResponse: object = {}; +function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { + return {}; +} export const MsgRevokeAllowanceResponse = { - encode( - _: MsgRevokeAllowanceResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgRevokeAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgRevokeAllowanceResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; + const message = createBaseMsgRevokeAllowanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -284,10 +227,7 @@ export const MsgRevokeAllowanceResponse = { }, fromJSON(_: any): MsgRevokeAllowanceResponse { - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; - return message; + return {}; }, toJSON(_: MsgRevokeAllowanceResponse): unknown { @@ -295,12 +235,8 @@ export const MsgRevokeAllowanceResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgRevokeAllowanceResponse { - const message = { - ...baseMsgRevokeAllowanceResponse, - } as MsgRevokeAllowanceResponse; + fromPartial, I>>(_: I): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); return message; }, }; @@ -311,67 +247,49 @@ export interface Msg { * GrantAllowance grants fee allowance to the grantee on the granter's * account with the provided expiration time. */ - GrantAllowance( - request: MsgGrantAllowance - ): Promise; + GrantAllowance(request: MsgGrantAllowance): Promise; /** * RevokeAllowance revokes any fee allowance of granter's account that * has been granted to the grantee. */ - RevokeAllowance( - request: MsgRevokeAllowance - ): Promise; + RevokeAllowance(request: MsgRevokeAllowance): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.GrantAllowance = this.GrantAllowance.bind(this); + this.RevokeAllowance = this.RevokeAllowance.bind(this); } - GrantAllowance( - request: MsgGrantAllowance - ): Promise { + GrantAllowance(request: MsgGrantAllowance): Promise { const data = MsgGrantAllowance.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Msg", - "GrantAllowance", - data - ); - return promise.then((data) => - MsgGrantAllowanceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); + return promise.then((data) => MsgGrantAllowanceResponse.decode(new _m0.Reader(data))); } - RevokeAllowance( - request: MsgRevokeAllowance - ): Promise { + RevokeAllowance(request: MsgRevokeAllowance): Promise { const data = MsgRevokeAllowance.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.feegrant.v1beta1.Msg", - "RevokeAllowance", - data - ); - return promise.then((data) => - MsgRevokeAllowanceResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); + return promise.then((data) => MsgRevokeAllowanceResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/duration.ts index 0cb51f5a90..01ce7b0bf9 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/duration.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/duration.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -83,10 +83,12 @@ export interface Duration { nanos: number; } -const baseDuration: object = { seconds: 0, nanos: 0 }; +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -96,10 +98,10 @@ export const Duration = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDuration } as Duration; + const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,64 +120,57 @@ export const Duration = { }, fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -183,7 +178,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.feegrant.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/module.ts new file mode 100755 index 0000000000..d1276d4646 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/module.ts @@ -0,0 +1,280 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx"; +import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx"; +import { MsgVote } from "./types/cosmos/gov/v1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; +import { MsgUpdateParams } from "./types/cosmos/gov/v1/tx"; + +import { WeightedVoteOption as typeWeightedVoteOption} from "./types" +import { Deposit as typeDeposit} from "./types" +import { Proposal as typeProposal} from "./types" +import { TallyResult as typeTallyResult} from "./types" +import { Vote as typeVote} from "./types" +import { DepositParams as typeDepositParams} from "./types" +import { VotingParams as typeVotingParams} from "./types" +import { TallyParams as typeTallyParams} from "./types" +import { Params as typeParams} from "./types" + +export { MsgSubmitProposal, MsgVoteWeighted, MsgVote, MsgDeposit, MsgUpdateParams }; + +type sendMsgSubmitProposalParams = { + value: MsgSubmitProposal, + fee?: StdFee, + memo?: string +}; + +type sendMsgVoteWeightedParams = { + value: MsgVoteWeighted, + fee?: StdFee, + memo?: string +}; + +type sendMsgVoteParams = { + value: MsgVote, + fee?: StdFee, + memo?: string +}; + +type sendMsgDepositParams = { + value: MsgDeposit, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateParamsParams = { + value: MsgUpdateParams, + fee?: StdFee, + memo?: string +}; + + +type msgSubmitProposalParams = { + value: MsgSubmitProposal, +}; + +type msgVoteWeightedParams = { + value: MsgVoteWeighted, +}; + +type msgVoteParams = { + value: MsgVote, +}; + +type msgDepositParams = { + value: MsgDeposit, +}; + +type msgUpdateParamsParams = { + value: MsgUpdateParams, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgVoteWeighted({ value, fee, memo }: sendMsgVoteWeightedParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message) + } + }, + + + msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) + } + }, + + msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message) + } + }, + + msgVote({ value }: msgVoteParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgVote", value: MsgVote.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgVote: Could not create message: ' + e.message) + } + }, + + msgDeposit({ value }: msgDepositParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) + } + }, + + msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + WeightedVoteOption: getStructure(typeWeightedVoteOption.fromPartial({})), + Deposit: getStructure(typeDeposit.fromPartial({})), + Proposal: getStructure(typeProposal.fromPartial({})), + TallyResult: getStructure(typeTallyResult.fromPartial({})), + Vote: getStructure(typeVote.fromPartial({})), + DepositParams: getStructure(typeDepositParams.fromPartial({})), + VotingParams: getStructure(typeVotingParams.fromPartial({})), + TallyParams: getStructure(typeTallyParams.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosGovV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/registry.ts new file mode 100755 index 0000000000..52f693fb2a --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/registry.ts @@ -0,0 +1,18 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx"; +import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx"; +import { MsgVote } from "./types/cosmos/gov/v1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; +import { MsgUpdateParams } from "./types/cosmos/gov/v1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted], + ["/cosmos.gov.v1.MsgVote", MsgVote], + ["/cosmos.gov.v1.MsgDeposit", MsgDeposit], + ["/cosmos.gov.v1.MsgUpdateParams", MsgUpdateParams], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/rest.ts new file mode 100644 index 0000000000..e100759745 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/rest.ts @@ -0,0 +1,913 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** +* Deposit defines an amount deposited by an account address to an active +proposal. +*/ +export interface Govv1Deposit { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + + /** amount to be deposited by depositor. */ + amount?: V1Beta1Coin[]; +} + +/** +* Params defines the parameters for the x/gov module. + +Since: cosmos-sdk 0.47 +*/ +export interface Govv1Params { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: V1Beta1Coin[]; + + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: string; + + /** Duration of the voting period. */ + voting_period?: string; + + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; + + /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ + min_initial_deposit_ratio?: string; + + /** burn deposits if a proposal does not meet quorum */ + burn_vote_quorum?: boolean; + + /** burn deposits if the proposal does not enter voting period */ + burn_proposal_deposit_prevote?: boolean; + + /** burn deposits if quorum with vote type no_veto is met */ + burn_vote_veto?: boolean; +} + +/** + * Proposal defines the core field members of a governance proposal. + */ +export interface Govv1Proposal { + /** + * id defines the unique id of the proposal. + * @format uint64 + */ + id?: string; + + /** messages are the arbitrary messages to be executed if the proposal passes. */ + messages?: ProtobufAny[]; + + /** status defines the proposal status. */ + status?: V1ProposalStatus; + + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: Govv1TallyResult; + + /** + * submit_time is the time of proposal submission. + * @format date-time + */ + submit_time?: string; + + /** + * deposit_end_time is the end time for deposition. + * @format date-time + */ + deposit_end_time?: string; + + /** total_deposit is the total deposit on the proposal. */ + total_deposit?: V1Beta1Coin[]; + + /** + * voting_start_time is the starting time to vote on a proposal. + * @format date-time + */ + voting_start_time?: string; + + /** + * voting_end_time is the end time of voting on a proposal. + * @format date-time + */ + voting_end_time?: string; + + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; + + /** + * title is the title of the proposal + * Since: cosmos-sdk 0.47 + */ + title?: string; + + /** + * summary is a short summary of the proposal + * Since: cosmos-sdk 0.47 + */ + summary?: string; + + /** + * Proposer is the address of the proposal sumbitter + * Since: cosmos-sdk 0.47 + */ + proposer?: string; +} + +/** + * TallyResult defines a standard tally for a governance proposal. + */ +export interface Govv1TallyResult { + /** yes_count is the number of yes votes on a proposal. */ + yes_count?: string; + + /** abstain_count is the number of abstain votes on a proposal. */ + abstain_count?: string; + + /** no_count is the number of no votes on a proposal. */ + no_count?: string; + + /** no_with_veto_count is the number of no with veto votes on a proposal. */ + no_with_veto_count?: string; +} + +/** +* Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. +*/ +export interface Govv1Vote { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** voter is the voter address of the proposal. */ + voter?: string; + + /** options is the weighted vote options. */ + options?: V1WeightedVoteOption[]; + + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; +} + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** + * DepositParams defines the params for deposits on governance proposals. + */ +export interface V1DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: V1Beta1Coin[]; + + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: string; +} + +/** + * MsgDepositResponse defines the Msg/Deposit response type. + */ +export type V1MsgDepositResponse = object; + +/** + * MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. + */ +export type V1MsgExecLegacyContentResponse = object; + +/** + * MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + */ +export interface V1MsgSubmitProposalResponse { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; +} + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1MsgUpdateParamsResponse = object; + +/** + * MsgVoteResponse defines the Msg/Vote response type. + */ +export type V1MsgVoteResponse = object; + +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + */ +export type V1MsgVoteWeightedResponse = object; + +/** +* ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit +period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting +period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has +passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has +been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has +failed. +*/ +export enum V1ProposalStatus { + PROPOSAL_STATUS_UNSPECIFIED = "PROPOSAL_STATUS_UNSPECIFIED", + PROPOSAL_STATUS_DEPOSIT_PERIOD = "PROPOSAL_STATUS_DEPOSIT_PERIOD", + PROPOSAL_STATUS_VOTING_PERIOD = "PROPOSAL_STATUS_VOTING_PERIOD", + PROPOSAL_STATUS_PASSED = "PROPOSAL_STATUS_PASSED", + PROPOSAL_STATUS_REJECTED = "PROPOSAL_STATUS_REJECTED", + PROPOSAL_STATUS_FAILED = "PROPOSAL_STATUS_FAILED", +} + +/** + * QueryDepositResponse is the response type for the Query/Deposit RPC method. + */ +export interface V1QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit?: Govv1Deposit; +} + +/** + * QueryDepositsResponse is the response type for the Query/Deposits RPC method. + */ +export interface V1QueryDepositsResponse { + /** deposits defines the requested deposits. */ + deposits?: Govv1Deposit[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +/** + * QueryParamsResponse is the response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines the parameters related to voting. + */ + voting_params?: V1VotingParams; + + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines the parameters related to deposit. + */ + deposit_params?: V1DepositParams; + + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines the parameters related to tally. + */ + tally_params?: V1TallyParams; + + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params?: Govv1Params; +} + +/** + * QueryProposalResponse is the response type for the Query/Proposal RPC method. + */ +export interface V1QueryProposalResponse { + /** proposal is the requested governance proposal. */ + proposal?: Govv1Proposal; +} + +/** +* QueryProposalsResponse is the response type for the Query/Proposals RPC +method. +*/ +export interface V1QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ + proposals?: Govv1Proposal[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +/** + * QueryTallyResultResponse is the response type for the Query/Tally RPC method. + */ +export interface V1QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally?: Govv1TallyResult; +} + +/** + * QueryVoteResponse is the response type for the Query/Vote RPC method. + */ +export interface V1QueryVoteResponse { + /** vote defines the queried vote. */ + vote?: Govv1Vote; +} + +/** + * QueryVotesResponse is the response type for the Query/Votes RPC method. + */ +export interface V1QueryVotesResponse { + /** votes defines the queried votes. */ + votes?: Govv1Vote[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +/** + * TallyParams defines the params for tallying votes on governance proposals. + */ +export interface V1TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; +} + +/** +* VoteOption enumerates the valid vote options for a given governance proposal. + + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. +*/ +export enum V1VoteOption { + VOTE_OPTION_UNSPECIFIED = "VOTE_OPTION_UNSPECIFIED", + VOTE_OPTION_YES = "VOTE_OPTION_YES", + VOTE_OPTION_ABSTAIN = "VOTE_OPTION_ABSTAIN", + VOTE_OPTION_NO = "VOTE_OPTION_NO", + VOTE_OPTION_NO_WITH_VETO = "VOTE_OPTION_NO_WITH_VETO", +} + +/** + * VotingParams defines the params for voting on governance proposals. + */ +export interface V1VotingParams { + /** Duration of the voting period. */ + voting_period?: string; +} + +/** + * WeightedVoteOption defines a unit of vote for vote split. + */ +export interface V1WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option?: V1VoteOption; + + /** weight is the vote weight associated with the vote option. */ + weight?: string; +} + +/** +* 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 V1Beta1Coin { + denom?: string; + amount?: string; +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title cosmos/gov/v1/genesis.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Params queries all parameters of the gov module. + * @request GET:/cosmos/gov/v1/params/{params_type} + */ + queryParams = (paramsType: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/gov/v1/params/${paramsType}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryProposals + * @summary Proposals queries all proposals based on given status. + * @request GET:/cosmos/gov/v1/proposals + */ + queryProposals = ( + query?: { + proposal_status?: + | "PROPOSAL_STATUS_UNSPECIFIED" + | "PROPOSAL_STATUS_DEPOSIT_PERIOD" + | "PROPOSAL_STATUS_VOTING_PERIOD" + | "PROPOSAL_STATUS_PASSED" + | "PROPOSAL_STATUS_REJECTED" + | "PROPOSAL_STATUS_FAILED"; + voter?: string; + depositor?: string; + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/gov/v1/proposals`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryProposal + * @summary Proposal queries proposal details based on ProposalID. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id} + */ + queryProposal = (proposalId: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDeposits + * @summary Deposits queries all deposits of a single proposal. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id}/deposits + */ + queryDeposits = ( + proposalId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}/deposits`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDeposit + * @summary Deposit queries single deposit information based proposalID, depositAddr. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor} + */ + queryDeposit = (proposalId: string, depositor: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}/deposits/${depositor}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryTallyResult + * @summary TallyResult queries the tally of a proposal vote. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id}/tally + */ + queryTallyResult = (proposalId: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}/tally`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryVotes + * @summary Votes queries votes of a given proposal. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id}/votes + */ + queryVotes = ( + proposalId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}/votes`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryVote + * @summary Vote queries voted information based on proposalID, voterAddr. + * @request GET:/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter} + */ + queryVote = (proposalId: string, voter: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/gov/v1/proposals/${proposalId}/votes/${voter}`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types.ts new file mode 100755 index 0000000000..dae4876e4e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { WeightedVoteOption } from "./types/cosmos/gov/v1/gov" +import { Deposit } from "./types/cosmos/gov/v1/gov" +import { Proposal } from "./types/cosmos/gov/v1/gov" +import { TallyResult } from "./types/cosmos/gov/v1/gov" +import { Vote } from "./types/cosmos/gov/v1/gov" +import { DepositParams } from "./types/cosmos/gov/v1/gov" +import { VotingParams } from "./types/cosmos/gov/v1/gov" +import { TallyParams } from "./types/cosmos/gov/v1/gov" +import { Params } from "./types/cosmos/gov/v1/gov" + + +export { + WeightedVoteOption, + Deposit, + Proposal, + TallyResult, + Vote, + DepositParams, + VotingParams, + TallyParams, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/v1beta1/coin.ts new file mode 100644 index 0000000000..d11d12c100 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,262 @@ +//@ts-nocheck +/* eslint-disable */ +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. */ +export interface IntProto { + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/genesis.ts new file mode 100644 index 0000000000..5ed50b2841 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/genesis.ts @@ -0,0 +1,244 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Deposit, DepositParams, Params, Proposal, TallyParams, Vote, VotingParams } from "./gov"; + +export const protobufPackage = "cosmos.gov.v1"; + +/** Since: cosmos-sdk 0.46 */ + +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: number; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines all the paramaters of related to deposit. + * + * @deprecated + */ + depositParams: + | DepositParams + | undefined; + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines all the paramaters of related to voting. + * + * @deprecated + */ + votingParams: + | VotingParams + | undefined; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines all the paramaters of related to tally. + * + * @deprecated + */ + tallyParams: + | TallyParams + | undefined; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { + startingProposalId: 0, + deposits: [], + votes: [], + proposals: [], + depositParams: undefined, + votingParams: undefined, + tallyParams: undefined, + params: undefined, + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.startingProposalId !== 0) { + writer.uint32(8).uint64(message.startingProposalId); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + } + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 3: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 4: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + case 8: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + startingProposalId: isSet(object.startingProposalId) ? Number(object.startingProposalId) : 0, + deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], + proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], + depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, + votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, + tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.startingProposalId !== undefined && (obj.startingProposalId = Math.round(message.startingProposalId)); + if (message.deposits) { + obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); + } else { + obj.deposits = []; + } + if (message.votes) { + obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); + } else { + obj.votes = []; + } + if (message.proposals) { + obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); + } else { + obj.proposals = []; + } + message.depositParams !== undefined + && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.votingParams !== undefined + && (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.tallyParams !== undefined + && (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.startingProposalId = object.startingProposalId ?? 0; + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; + message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) + ? DepositParams.fromPartial(object.depositParams) + : undefined; + message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) + ? VotingParams.fromPartial(object.votingParams) + : undefined; + message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) + ? TallyParams.fromPartial(object.tallyParams) + : undefined; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/gov.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/gov.ts new file mode 100644 index 0000000000..8870157b07 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/gov.ts @@ -0,0 +1,1197 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin } from "../../base/v1beta1/coin"; + +export const protobufPackage = "cosmos.gov.v1"; + +/** Since: cosmos-sdk 0.46 */ + +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} + +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} + +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} + +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} + +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option: VoteOption; + /** weight is the vote weight associated with the vote option. */ + weight: string; +} + +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** amount to be deposited by depositor. */ + amount: Coin[]; +} + +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + /** id defines the unique id of the proposal. */ + id: number; + /** messages are the arbitrary messages to be executed if the proposal passes. */ + messages: Any[]; + /** status defines the proposal status. */ + status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + finalTallyResult: + | TallyResult + | undefined; + /** submit_time is the time of proposal submission. */ + submitTime: + | Date + | undefined; + /** deposit_end_time is the end time for deposition. */ + depositEndTime: + | Date + | undefined; + /** total_deposit is the total deposit on the proposal. */ + totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ + votingStartTime: + | Date + | undefined; + /** voting_end_time is the end time of voting on a proposal. */ + votingEndTime: + | Date + | undefined; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; + /** + * title is the title of the proposal + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is a short summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string; + /** + * Proposer is the address of the proposal sumbitter + * + * Since: cosmos-sdk 0.47 + */ + proposer: string; +} + +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + /** yes_count is the number of yes votes on a proposal. */ + yesCount: string; + /** abstain_count is the number of abstain votes on a proposal. */ + abstainCount: string; + /** no_count is the number of no votes on a proposal. */ + noCount: string; + /** no_with_veto_count is the number of no with veto votes on a proposal. */ + noWithVetoCount: string; +} + +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address of the proposal. */ + voter: string; + /** options is the weighted vote options. */ + options: WeightedVoteOption[]; + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata: string; +} + +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod: Duration | undefined; +} + +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Duration of the voting period. */ + votingPeriod: Duration | undefined; +} + +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: string; +} + +/** + * Params defines the parameters for the x/gov module. + * + * Since: cosmos-sdk 0.47 + */ +export interface Params { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod: + | Duration + | undefined; + /** Duration of the voting period. */ + votingPeriod: + | Duration + | undefined; + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: string; + /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ + minInitialDepositRatio: string; + /** burn deposits if a proposal does not meet quorum */ + burnVoteQuorum: boolean; + /** burn deposits if the proposal does not enter voting period */ + burnProposalDepositPrevote: boolean; + /** burn deposits if quorum with vote type no_veto is met */ + burnVoteVeto: boolean; +} + +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { option: 0, weight: "" }; +} + +export const WeightedVoteOption = { + encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.option !== 0) { + writer.uint32(8).int32(message.option); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightedVoteOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.option = reader.int32() as any; + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WeightedVoteOption { + return { + option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + weight: isSet(object.weight) ? String(object.weight) : "", + }; + }, + + toJSON(message: WeightedVoteOption): unknown { + const obj: any = {}; + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, + + fromPartial, I>>(object: I): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + message.option = object.option ?? 0; + message.weight = object.weight ?? ""; + return message; + }, +}; + +function createBaseDeposit(): Deposit { + return { proposalId: 0, depositor: "", amount: [] }; +} + +export const Deposit = { + encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Deposit { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: Deposit): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Deposit { + const message = createBaseDeposit(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseProposal(): Proposal { + return { + id: 0, + messages: [], + status: 0, + finalTallyResult: undefined, + submitTime: undefined, + depositEndTime: undefined, + totalDeposit: [], + votingStartTime: undefined, + votingEndTime: undefined, + metadata: "", + title: "", + summary: "", + proposer: "", + }; +} + +export const Proposal = { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).uint64(message.id); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + } + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(82).string(message.metadata); + } + if (message.title !== "") { + writer.uint32(90).string(message.title); + } + if (message.summary !== "") { + writer.uint32(98).string(message.summary); + } + if (message.proposer !== "") { + writer.uint32(106).string(message.proposer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.uint64() as Long); + break; + case 2: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 3: + message.status = reader.int32() as any; + break; + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.metadata = reader.string(); + break; + case 11: + message.title = reader.string(); + break; + case 12: + message.summary = reader.string(); + break; + case 13: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Proposal { + return { + id: isSet(object.id) ? Number(object.id) : 0, + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, + submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, + depositEndTime: isSet(object.depositEndTime) ? fromJsonTimestamp(object.depositEndTime) : undefined, + totalDeposit: Array.isArray(object?.totalDeposit) ? object.totalDeposit.map((e: any) => Coin.fromJSON(e)) : [], + votingStartTime: isSet(object.votingStartTime) ? fromJsonTimestamp(object.votingStartTime) : undefined, + votingEndTime: isSet(object.votingEndTime) ? fromJsonTimestamp(object.votingEndTime) : undefined, + metadata: isSet(object.metadata) ? String(object.metadata) : "", + title: isSet(object.title) ? String(object.title) : "", + summary: isSet(object.summary) ? String(object.summary) : "", + proposer: isSet(object.proposer) ? String(object.proposer) : "", + }; + }, + + toJSON(message: Proposal): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = Math.round(message.id)); + if (message.messages) { + obj.messages = message.messages.map((e) => e ? Any.toJSON(e) : undefined); + } else { + obj.messages = []; + } + message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); + message.finalTallyResult !== undefined + && (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) : undefined); + message.submitTime !== undefined && (obj.submitTime = message.submitTime.toISOString()); + message.depositEndTime !== undefined && (obj.depositEndTime = message.depositEndTime.toISOString()); + if (message.totalDeposit) { + obj.totalDeposit = message.totalDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalDeposit = []; + } + message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString()); + message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString()); + message.metadata !== undefined && (obj.metadata = message.metadata); + message.title !== undefined && (obj.title = message.title); + message.summary !== undefined && (obj.summary = message.summary); + message.proposer !== undefined && (obj.proposer = message.proposer); + return obj; + }, + + fromPartial, I>>(object: I): Proposal { + const message = createBaseProposal(); + message.id = object.id ?? 0; + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; + message.status = object.status ?? 0; + message.finalTallyResult = (object.finalTallyResult !== undefined && object.finalTallyResult !== null) + ? TallyResult.fromPartial(object.finalTallyResult) + : undefined; + message.submitTime = object.submitTime ?? undefined; + message.depositEndTime = object.depositEndTime ?? undefined; + message.totalDeposit = object.totalDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.votingStartTime = object.votingStartTime ?? undefined; + message.votingEndTime = object.votingEndTime ?? undefined; + message.metadata = object.metadata ?? ""; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + message.proposer = object.proposer ?? ""; + return message; + }, +}; + +function createBaseTallyResult(): TallyResult { + return { yesCount: "", abstainCount: "", noCount: "", noWithVetoCount: "" }; +} + +export const TallyResult = { + encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.yesCount !== "") { + writer.uint32(10).string(message.yesCount); + } + if (message.abstainCount !== "") { + writer.uint32(18).string(message.abstainCount); + } + if (message.noCount !== "") { + writer.uint32(26).string(message.noCount); + } + if (message.noWithVetoCount !== "") { + writer.uint32(34).string(message.noWithVetoCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yesCount = reader.string(); + break; + case 2: + message.abstainCount = reader.string(); + break; + case 3: + message.noCount = reader.string(); + break; + case 4: + message.noWithVetoCount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TallyResult { + return { + yesCount: isSet(object.yesCount) ? String(object.yesCount) : "", + abstainCount: isSet(object.abstainCount) ? String(object.abstainCount) : "", + noCount: isSet(object.noCount) ? String(object.noCount) : "", + noWithVetoCount: isSet(object.noWithVetoCount) ? String(object.noWithVetoCount) : "", + }; + }, + + toJSON(message: TallyResult): unknown { + const obj: any = {}; + message.yesCount !== undefined && (obj.yesCount = message.yesCount); + message.abstainCount !== undefined && (obj.abstainCount = message.abstainCount); + message.noCount !== undefined && (obj.noCount = message.noCount); + message.noWithVetoCount !== undefined && (obj.noWithVetoCount = message.noWithVetoCount); + return obj; + }, + + fromPartial, I>>(object: I): TallyResult { + const message = createBaseTallyResult(); + message.yesCount = object.yesCount ?? ""; + message.abstainCount = object.abstainCount ?? ""; + message.noCount = object.noCount ?? ""; + message.noWithVetoCount = object.noWithVetoCount ?? ""; + return message; + }, +}; + +function createBaseVote(): Vote { + return { proposalId: 0, voter: "", options: [], metadata: "" }; +} + +export const Vote = { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(42).string(message.metadata); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.voter = reader.string(); + break; + case 4: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 5: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Vote { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], + metadata: isSet(object.metadata) ? String(object.metadata) : "", + }; + }, + + toJSON(message: Vote): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.voter !== undefined && (obj.voter = message.voter); + if (message.options) { + obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); + } else { + obj.options = []; + } + message.metadata !== undefined && (obj.metadata = message.metadata); + return obj; + }, + + fromPartial, I>>(object: I): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, +}; + +function createBaseDepositParams(): DepositParams { + return { minDeposit: [], maxDepositPeriod: undefined }; +} + +export const DepositParams = { + encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DepositParams { + return { + minDeposit: Array.isArray(object?.minDeposit) ? object.minDeposit.map((e: any) => Coin.fromJSON(e)) : [], + maxDepositPeriod: isSet(object.maxDepositPeriod) ? Duration.fromJSON(object.maxDepositPeriod) : undefined, + }; + }, + + toJSON(message: DepositParams): unknown { + const obj: any = {}; + if (message.minDeposit) { + obj.minDeposit = message.minDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.minDeposit = []; + } + message.maxDepositPeriod !== undefined + && (obj.maxDepositPeriod = message.maxDepositPeriod ? Duration.toJSON(message.maxDepositPeriod) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) + ? Duration.fromPartial(object.maxDepositPeriod) + : undefined; + return message; + }, +}; + +function createBaseVotingParams(): VotingParams { + return { votingPeriod: undefined }; +} + +export const VotingParams = { + encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VotingParams { + return { votingPeriod: isSet(object.votingPeriod) ? Duration.fromJSON(object.votingPeriod) : undefined }; + }, + + toJSON(message: VotingParams): unknown { + const obj: any = {}; + message.votingPeriod !== undefined + && (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): VotingParams { + const message = createBaseVotingParams(); + message.votingPeriod = (object.votingPeriod !== undefined && object.votingPeriod !== null) + ? Duration.fromPartial(object.votingPeriod) + : undefined; + return message; + }, +}; + +function createBaseTallyParams(): TallyParams { + return { quorum: "", threshold: "", vetoThreshold: "" }; +} + +export const TallyParams = { + encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.quorum !== "") { + writer.uint32(10).string(message.quorum); + } + if (message.threshold !== "") { + writer.uint32(18).string(message.threshold); + } + if (message.vetoThreshold !== "") { + writer.uint32(26).string(message.vetoThreshold); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.string(); + break; + case 2: + message.threshold = reader.string(); + break; + case 3: + message.vetoThreshold = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TallyParams { + return { + quorum: isSet(object.quorum) ? String(object.quorum) : "", + threshold: isSet(object.threshold) ? String(object.threshold) : "", + vetoThreshold: isSet(object.vetoThreshold) ? String(object.vetoThreshold) : "", + }; + }, + + toJSON(message: TallyParams): unknown { + const obj: any = {}; + message.quorum !== undefined && (obj.quorum = message.quorum); + message.threshold !== undefined && (obj.threshold = message.threshold); + message.vetoThreshold !== undefined && (obj.vetoThreshold = message.vetoThreshold); + return obj; + }, + + fromPartial, I>>(object: I): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? ""; + message.threshold = object.threshold ?? ""; + message.vetoThreshold = object.vetoThreshold ?? ""; + return message; + }, +}; + +function createBaseParams(): Params { + return { + minDeposit: [], + maxDepositPeriod: undefined, + votingPeriod: undefined, + quorum: "", + threshold: "", + vetoThreshold: "", + minInitialDepositRatio: "", + burnVoteQuorum: false, + burnProposalDepositPrevote: false, + burnVoteVeto: false, + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(26).fork()).ldelim(); + } + if (message.quorum !== "") { + writer.uint32(34).string(message.quorum); + } + if (message.threshold !== "") { + writer.uint32(42).string(message.threshold); + } + if (message.vetoThreshold !== "") { + writer.uint32(50).string(message.vetoThreshold); + } + if (message.minInitialDepositRatio !== "") { + writer.uint32(58).string(message.minInitialDepositRatio); + } + if (message.burnVoteQuorum === true) { + writer.uint32(104).bool(message.burnVoteQuorum); + } + if (message.burnProposalDepositPrevote === true) { + writer.uint32(112).bool(message.burnProposalDepositPrevote); + } + if (message.burnVoteVeto === true) { + writer.uint32(120).bool(message.burnVoteVeto); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.quorum = reader.string(); + break; + case 5: + message.threshold = reader.string(); + break; + case 6: + message.vetoThreshold = reader.string(); + break; + case 7: + message.minInitialDepositRatio = reader.string(); + break; + case 13: + message.burnVoteQuorum = reader.bool(); + break; + case 14: + message.burnProposalDepositPrevote = reader.bool(); + break; + case 15: + message.burnVoteVeto = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + minDeposit: Array.isArray(object?.minDeposit) ? object.minDeposit.map((e: any) => Coin.fromJSON(e)) : [], + maxDepositPeriod: isSet(object.maxDepositPeriod) ? Duration.fromJSON(object.maxDepositPeriod) : undefined, + votingPeriod: isSet(object.votingPeriod) ? Duration.fromJSON(object.votingPeriod) : undefined, + quorum: isSet(object.quorum) ? String(object.quorum) : "", + threshold: isSet(object.threshold) ? String(object.threshold) : "", + vetoThreshold: isSet(object.vetoThreshold) ? String(object.vetoThreshold) : "", + minInitialDepositRatio: isSet(object.minInitialDepositRatio) ? String(object.minInitialDepositRatio) : "", + burnVoteQuorum: isSet(object.burnVoteQuorum) ? Boolean(object.burnVoteQuorum) : false, + burnProposalDepositPrevote: isSet(object.burnProposalDepositPrevote) + ? Boolean(object.burnProposalDepositPrevote) + : false, + burnVoteVeto: isSet(object.burnVoteVeto) ? Boolean(object.burnVoteVeto) : false, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.minDeposit) { + obj.minDeposit = message.minDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.minDeposit = []; + } + message.maxDepositPeriod !== undefined + && (obj.maxDepositPeriod = message.maxDepositPeriod ? Duration.toJSON(message.maxDepositPeriod) : undefined); + message.votingPeriod !== undefined + && (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); + message.quorum !== undefined && (obj.quorum = message.quorum); + message.threshold !== undefined && (obj.threshold = message.threshold); + message.vetoThreshold !== undefined && (obj.vetoThreshold = message.vetoThreshold); + message.minInitialDepositRatio !== undefined && (obj.minInitialDepositRatio = message.minInitialDepositRatio); + message.burnVoteQuorum !== undefined && (obj.burnVoteQuorum = message.burnVoteQuorum); + message.burnProposalDepositPrevote !== undefined + && (obj.burnProposalDepositPrevote = message.burnProposalDepositPrevote); + message.burnVoteVeto !== undefined && (obj.burnVoteVeto = message.burnVoteVeto); + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) + ? Duration.fromPartial(object.maxDepositPeriod) + : undefined; + message.votingPeriod = (object.votingPeriod !== undefined && object.votingPeriod !== null) + ? Duration.fromPartial(object.votingPeriod) + : undefined; + message.quorum = object.quorum ?? ""; + message.threshold = object.threshold ?? ""; + message.vetoThreshold = object.vetoThreshold ?? ""; + message.minInitialDepositRatio = object.minInitialDepositRatio ?? ""; + message.burnVoteQuorum = object.burnVoteQuorum ?? false; + message.burnProposalDepositPrevote = object.burnProposalDepositPrevote ?? false; + message.burnVoteVeto = object.burnVoteVeto ?? false; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/query.ts new file mode 100644 index 0000000000..37af06fdd5 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/query.ts @@ -0,0 +1,1241 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { + Deposit, + DepositParams, + Params, + Proposal, + ProposalStatus, + proposalStatusFromJSON, + proposalStatusToJSON, + TallyParams, + TallyResult, + Vote, + VotingParams, +} from "./gov"; + +export const protobufPackage = "cosmos.gov.v1"; + +/** Since: cosmos-sdk 0.46 */ + +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; +} + +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + /** proposal is the requested governance proposal. */ + proposal: Proposal | undefined; +} + +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequest { + /** proposal_status defines the status of the proposals. */ + proposalStatus: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter defines the voter address for the proposals. */ + voter: string; +} + +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponse { + /** vote defines the queried vote. */ + vote: Vote | undefined; +} + +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponse { + /** votes defines the queried votes. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + paramsType: string; +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines the parameters related to voting. + * + * @deprecated + */ + votingParams: + | VotingParams + | undefined; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines the parameters related to deposit. + * + * @deprecated + */ + depositParams: + | DepositParams + | undefined; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines the parameters related to tally. + * + * @deprecated + */ + tallyParams: + | TallyParams + | undefined; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params: Params | undefined; +} + +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; +} + +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit: Deposit | undefined; +} + +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ + deposits: Deposit[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; +} + +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally: TallyResult | undefined; +} + +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { proposalId: 0 }; +} + +export const QueryProposalRequest = { + encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalRequest { + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; + }, + + toJSON(message: QueryProposalRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + return obj; + }, + + fromPartial, I>>(object: I): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId ?? 0; + return message; + }, +}; + +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { proposal: undefined }; +} + +export const QueryProposalResponse = { + encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalResponse { + return { proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined }; + }, + + toJSON(message: QueryProposalResponse): unknown { + const obj: any = {}; + message.proposal !== undefined && (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = (object.proposal !== undefined && object.proposal !== null) + ? Proposal.fromPartial(object.proposal) + : undefined; + return message; + }, +}; + +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { proposalStatus: 0, voter: "", depositor: "", pagination: undefined }; +} + +export const QueryProposalsRequest = { + encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.depositor !== "") { + writer.uint32(26).string(message.depositor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = reader.int32() as any; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalsRequest { + return { + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + depositor: isSet(object.depositor) ? String(object.depositor) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryProposalsRequest): unknown { + const obj: any = {}; + message.proposalStatus !== undefined && (obj.proposalStatus = proposalStatusToJSON(message.proposalStatus)); + message.voter !== undefined && (obj.voter = message.voter); + message.depositor !== undefined && (obj.depositor = message.depositor); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + message.proposalStatus = object.proposalStatus ?? 0; + message.voter = object.voter ?? ""; + message.depositor = object.depositor ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { proposals: [], pagination: undefined }; +} + +export const QueryProposalsResponse = { + encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalsResponse { + return { + proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryProposalsResponse): unknown { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); + } else { + obj.proposals = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { proposalId: 0, voter: "" }; +} + +export const QueryVoteRequest = { + encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVoteRequest { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + }; + }, + + toJSON(message: QueryVoteRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.voter !== undefined && (obj.voter = message.voter); + return obj; + }, + + fromPartial, I>>(object: I): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + return message; + }, +}; + +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { vote: undefined }; +} + +export const QueryVoteResponse = { + encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVoteResponse { + return { vote: isSet(object.vote) ? Vote.fromJSON(object.vote) : undefined }; + }, + + toJSON(message: QueryVoteResponse): unknown { + const obj: any = {}; + message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + message.vote = (object.vote !== undefined && object.vote !== null) ? Vote.fromPartial(object.vote) : undefined; + return message; + }, +}; + +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { proposalId: 0, pagination: undefined }; +} + +export const QueryVotesRequest = { + encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVotesRequest { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryVotesRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + message.proposalId = object.proposalId ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { votes: [], pagination: undefined }; +} + +export const QueryVotesResponse = { + encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVotesResponse { + return { + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryVotesResponse): unknown { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); + } else { + obj.votes = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { paramsType: "" }; +} + +export const QueryParamsRequest = { + encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsRequest { + return { paramsType: isSet(object.paramsType) ? String(object.paramsType) : "" }; + }, + + toJSON(message: QueryParamsRequest): unknown { + const obj: any = {}; + message.paramsType !== undefined && (obj.paramsType = message.paramsType); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.paramsType = object.paramsType ?? ""; + return message; + }, +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { votingParams: undefined, depositParams: undefined, tallyParams: undefined, params: undefined }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { + votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, + depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, + tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.votingParams !== undefined + && (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.depositParams !== undefined + && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.tallyParams !== undefined + && (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) + ? VotingParams.fromPartial(object.votingParams) + : undefined; + message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) + ? DepositParams.fromPartial(object.depositParams) + : undefined; + message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) + ? TallyParams.fromPartial(object.tallyParams) + : undefined; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { proposalId: 0, depositor: "" }; +} + +export const QueryDepositRequest = { + encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositRequest { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + }; + }, + + toJSON(message: QueryDepositRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.depositor !== undefined && (obj.depositor = message.depositor); + return obj; + }, + + fromPartial, I>>(object: I): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; + return message; + }, +}; + +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { deposit: undefined }; +} + +export const QueryDepositResponse = { + encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositResponse { + return { deposit: isSet(object.deposit) ? Deposit.fromJSON(object.deposit) : undefined }; + }, + + toJSON(message: QueryDepositResponse): unknown { + const obj: any = {}; + message.deposit !== undefined && (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + message.deposit = (object.deposit !== undefined && object.deposit !== null) + ? Deposit.fromPartial(object.deposit) + : undefined; + return message; + }, +}; + +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { proposalId: 0, pagination: undefined }; +} + +export const QueryDepositsRequest = { + encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositsRequest { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryDepositsRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.proposalId = object.proposalId ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { deposits: [], pagination: undefined }; +} + +export const QueryDepositsResponse = { + encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositsResponse { + return { + deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryDepositsResponse): unknown { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); + } else { + obj.deposits = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { proposalId: 0 }; +} + +export const QueryTallyResultRequest = { + encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTallyResultRequest { + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; + }, + + toJSON(message: QueryTallyResultRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + return obj; + }, + + fromPartial, I>>(object: I): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId ?? 0; + return message; + }, +}; + +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { tally: undefined }; +} + +export const QueryTallyResultResponse = { + encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTallyResultResponse { + return { tally: isSet(object.tally) ? TallyResult.fromJSON(object.tally) : undefined }; + }, + + toJSON(message: QueryTallyResultResponse): unknown { + const obj: any = {}; + message.tally !== undefined && (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = (object.tally !== undefined && object.tally !== null) + ? TallyResult.fromPartial(object.tally) + : undefined; + return message; + }, +}; + +/** Query defines the gRPC querier service for gov module */ +export interface Query { + /** Proposal queries proposal details based on ProposalID. */ + Proposal(request: QueryProposalRequest): Promise; + /** Proposals queries all proposals based on given status. */ + Proposals(request: QueryProposalsRequest): Promise; + /** Vote queries voted information based on proposalID, voterAddr. */ + Vote(request: QueryVoteRequest): Promise; + /** Votes queries votes of a given proposal. */ + Votes(request: QueryVotesRequest): Promise; + /** Params queries all parameters of the gov module. */ + Params(request: QueryParamsRequest): Promise; + /** Deposit queries single deposit information based proposalID, depositAddr. */ + Deposit(request: QueryDepositRequest): Promise; + /** Deposits queries all deposits of a single proposal. */ + Deposits(request: QueryDepositsRequest): Promise; + /** TallyResult queries the tally of a proposal vote. */ + TallyResult(request: QueryTallyResultRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Proposal = this.Proposal.bind(this); + this.Proposals = this.Proposals.bind(this); + this.Vote = this.Vote.bind(this); + this.Votes = this.Votes.bind(this); + this.Params = this.Params.bind(this); + this.Deposit = this.Deposit.bind(this); + this.Deposits = this.Deposits.bind(this); + this.TallyResult = this.TallyResult.bind(this); + } + Proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposal", data); + return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + } + + Proposals(request: QueryProposalsRequest): Promise { + const data = QueryProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposals", data); + return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); + } + + Vote(request: QueryVoteRequest): Promise { + const data = QueryVoteRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Vote", data); + return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); + } + + Votes(request: QueryVotesRequest): Promise { + const data = QueryVotesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Votes", data); + return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + Deposit(request: QueryDepositRequest): Promise { + const data = QueryDepositRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposit", data); + return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); + } + + Deposits(request: QueryDepositsRequest): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposits", data); + return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + } + + TallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "TallyResult", data); + return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/tx.ts new file mode 100644 index 0000000000..f09568ac7a --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/gov/v1/tx.ts @@ -0,0 +1,947 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Coin } from "../../base/v1beta1/coin"; +import { Params, VoteOption, voteOptionFromJSON, voteOptionToJSON, WeightedVoteOption } from "./gov"; + +export const protobufPackage = "cosmos.gov.v1"; + +/** Since: cosmos-sdk 0.46 */ + +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages: Any[]; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ + proposer: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is the summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string; +} + +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; +} + +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContent { + /** content is the proposal's content. */ + content: + | Any + | undefined; + /** authority must be the gov module address. */ + authority: string; +} + +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponse { +} + +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address for the proposal. */ + voter: string; + /** option defines the vote option. */ + option: VoteOption; + /** metadata is any arbitrary metadata attached to the Vote. */ + metadata: string; +} + +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse { +} + +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address for the proposal. */ + voter: string; + /** options defines the weighted vote options. */ + options: WeightedVoteOption[]; + /** metadata is any arbitrary metadata attached to the VoteWeighted. */ + metadata: string; +} + +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse { +} + +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** amount to be deposited by depositor. */ + amount: Coin[]; +} + +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse { +} + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/gov parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { messages: [], initialDeposit: [], proposer: "", metadata: "", title: "", summary: "" }; +} + +export const MsgSubmitProposal = { + encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.title !== "") { + writer.uint32(42).string(message.title); + } + if (message.summary !== "") { + writer.uint32(50).string(message.summary); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.title = reader.string(); + break; + case 6: + message.summary = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitProposal { + return { + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], + initialDeposit: Array.isArray(object?.initialDeposit) + ? object.initialDeposit.map((e: any) => Coin.fromJSON(e)) + : [], + proposer: isSet(object.proposer) ? String(object.proposer) : "", + metadata: isSet(object.metadata) ? String(object.metadata) : "", + title: isSet(object.title) ? String(object.title) : "", + summary: isSet(object.summary) ? String(object.summary) : "", + }; + }, + + toJSON(message: MsgSubmitProposal): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map((e) => e ? Any.toJSON(e) : undefined); + } else { + obj.messages = []; + } + if (message.initialDeposit) { + obj.initialDeposit = message.initialDeposit.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.initialDeposit = []; + } + message.proposer !== undefined && (obj.proposer = message.proposer); + message.metadata !== undefined && (obj.metadata = message.metadata); + message.title !== undefined && (obj.title = message.title); + message.summary !== undefined && (obj.summary = message.summary); + return obj; + }, + + fromPartial, I>>(object: I): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; + message.initialDeposit = object.initialDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + message.metadata = object.metadata ?? ""; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + return message; + }, +}; + +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { proposalId: 0 }; +} + +export const MsgSubmitProposalResponse = { + encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitProposalResponse { + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; + }, + + toJSON(message: MsgSubmitProposalResponse): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + return obj; + }, + + fromPartial, I>>(object: I): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId ?? 0; + return message; + }, +}; + +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { content: undefined, authority: "" }; +} + +export const MsgExecLegacyContent = { + encode(message: MsgExecLegacyContent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.content !== undefined) { + Any.encode(message.content, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = Any.decode(reader, reader.uint32()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecLegacyContent { + return { + content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, + authority: isSet(object.authority) ? String(object.authority) : "", + }; + }, + + toJSON(message: MsgExecLegacyContent): unknown { + const obj: any = {}; + message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + fromPartial, I>>(object: I): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + message.content = (object.content !== undefined && object.content !== null) + ? Any.fromPartial(object.content) + : undefined; + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {}; +} + +export const MsgExecLegacyContentResponse = { + encode(_: MsgExecLegacyContentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContentResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgExecLegacyContentResponse { + return {}; + }, + + toJSON(_: MsgExecLegacyContentResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, +}; + +function createBaseMsgVote(): MsgVote { + return { proposalId: 0, voter: "", option: 0, metadata: "" }; +} + +export const MsgVote = { + encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgVote { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + metadata: isSet(object.metadata) ? String(object.metadata) : "", + }; + }, + + toJSON(message: MsgVote): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.voter !== undefined && (obj.voter = message.voter); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + message.metadata !== undefined && (obj.metadata = message.metadata); + return obj; + }, + + fromPartial, I>>(object: I): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + return message; + }, +}; + +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} + +export const MsgVoteResponse = { + encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgVoteResponse { + return {}; + }, + + toJSON(_: MsgVoteResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, +}; + +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { proposalId: 0, voter: "", options: [], metadata: "" }; +} + +export const MsgVoteWeighted = { + encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeighted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgVoteWeighted { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], + metadata: isSet(object.metadata) ? String(object.metadata) : "", + }; + }, + + toJSON(message: MsgVoteWeighted): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.voter !== undefined && (obj.voter = message.voter); + if (message.options) { + obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); + } else { + obj.options = []; + } + message.metadata !== undefined && (obj.metadata = message.metadata); + return obj; + }, + + fromPartial, I>>(object: I): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, +}; + +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} + +export const MsgVoteWeightedResponse = { + encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeightedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgVoteWeightedResponse { + return {}; + }, + + toJSON(_: MsgVoteWeightedResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, +}; + +function createBaseMsgDeposit(): MsgDeposit { + return { proposalId: 0, depositor: "", amount: [] }; +} + +export const MsgDeposit = { + encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDeposit { + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: MsgDeposit): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgDeposit { + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} + +export const MsgDepositResponse = { + encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgDepositResponse { + return {}; + }, + + toJSON(_: MsgDepositResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +/** Msg defines the gov Msg service. */ +export interface Msg { + /** SubmitProposal defines a method to create new proposal given the messages. */ + SubmitProposal(request: MsgSubmitProposal): Promise; + /** + * ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + * to execute a legacy content-based proposal. + */ + ExecLegacyContent(request: MsgExecLegacyContent): Promise; + /** Vote defines a method to add a vote on a specific proposal. */ + Vote(request: MsgVote): Promise; + /** VoteWeighted defines a method to add a weighted vote on a specific proposal. */ + VoteWeighted(request: MsgVoteWeighted): Promise; + /** Deposit defines a method to add deposit on a specific proposal. */ + Deposit(request: MsgDeposit): Promise; + /** + * UpdateParams defines a governance operation for updating the x/gov module + * parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SubmitProposal = this.SubmitProposal.bind(this); + this.ExecLegacyContent = this.ExecLegacyContent.bind(this); + this.Vote = this.Vote.bind(this); + this.VoteWeighted = this.VoteWeighted.bind(this); + this.Deposit = this.Deposit.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); + } + SubmitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); + return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + } + + ExecLegacyContent(request: MsgExecLegacyContent): Promise { + const data = MsgExecLegacyContent.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); + return promise.then((data) => MsgExecLegacyContentResponse.decode(new _m0.Reader(data))); + } + + Vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); + return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + } + + VoteWeighted(request: MsgVoteWeighted): Promise { + const data = MsgVoteWeighted.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); + return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + } + + Deposit(request: MsgDeposit): Promise { + const data = MsgDeposit.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); + return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/duration.ts new file mode 100644 index 0000000000..01ce7b0bf9 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/duration.ts @@ -0,0 +1,188 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Duration = { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/timestamp.ts new file mode 100644 index 0000000000..93776d9496 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1/types/google/protobuf/timestamp.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/index.ts index 0fd2e408ca..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/index.ts @@ -1,70 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; - - -const types = [ - ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], - ["/cosmos.gov.v1beta1.MsgVote", MsgVote], - ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], - ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgDeposit: (data: MsgDeposit): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( data ) }), - msgVote: (data: MsgVote): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( data ) }), - msgVoteWeighted: (data: MsgVoteWeighted): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( data ) }), - msgSubmitProposal: (data: MsgSubmitProposal): EncodeObject => ({ typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/module.ts new file mode 100755 index 0000000000..83e0347e56 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/module.ts @@ -0,0 +1,247 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; + +import { WeightedVoteOption as typeWeightedVoteOption} from "./types" +import { TextProposal as typeTextProposal} from "./types" +import { Deposit as typeDeposit} from "./types" +import { Proposal as typeProposal} from "./types" +import { TallyResult as typeTallyResult} from "./types" +import { Vote as typeVote} from "./types" +import { DepositParams as typeDepositParams} from "./types" +import { VotingParams as typeVotingParams} from "./types" +import { TallyParams as typeTallyParams} from "./types" + +export { MsgSubmitProposal, MsgVoteWeighted, MsgDeposit, MsgVote }; + +type sendMsgSubmitProposalParams = { + value: MsgSubmitProposal, + fee?: StdFee, + memo?: string +}; + +type sendMsgVoteWeightedParams = { + value: MsgVoteWeighted, + fee?: StdFee, + memo?: string +}; + +type sendMsgDepositParams = { + value: MsgDeposit, + fee?: StdFee, + memo?: string +}; + +type sendMsgVoteParams = { + value: MsgVote, + fee?: StdFee, + memo?: string +}; + + +type msgSubmitProposalParams = { + value: MsgSubmitProposal, +}; + +type msgVoteWeightedParams = { + value: MsgVoteWeighted, +}; + +type msgDepositParams = { + value: MsgDeposit, +}; + +type msgVoteParams = { + value: MsgVote, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgVoteWeighted({ value, fee, memo }: sendMsgVoteWeightedParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) + } + }, + + + msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) + } + }, + + msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message) + } + }, + + msgDeposit({ value }: msgDepositParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) + } + }, + + msgVote({ value }: msgVoteParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgVote: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + WeightedVoteOption: getStructure(typeWeightedVoteOption.fromPartial({})), + TextProposal: getStructure(typeTextProposal.fromPartial({})), + Deposit: getStructure(typeDeposit.fromPartial({})), + Proposal: getStructure(typeProposal.fromPartial({})), + TallyResult: getStructure(typeTallyResult.fromPartial({})), + Vote: getStructure(typeVote.fromPartial({})), + DepositParams: getStructure(typeDepositParams.fromPartial({})), + VotingParams: getStructure(typeVotingParams.fromPartial({})), + TallyParams: getStructure(typeTallyParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosGovV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/registry.ts new file mode 100755 index 0000000000..757c249b9b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/registry.ts @@ -0,0 +1,16 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], + ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], + ["/cosmos.gov.v1beta1.MsgVote", MsgVote], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/rest.ts index e9c32fa085..8b11cd737c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/rest.ts @@ -10,6 +10,121 @@ * --------------------------------------------------------------- */ +/** +* Deposit defines an amount deposited by an account address to an active +proposal. +*/ +export interface Govv1Beta1Deposit { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + + /** amount to be deposited by depositor. */ + amount?: V1Beta1Coin[]; +} + +/** + * Proposal defines the core field members of a governance proposal. + */ +export interface Govv1Beta1Proposal { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** content is the proposal's content. */ + content?: ProtobufAny; + + /** status defines the proposal status. */ + status?: V1Beta1ProposalStatus; + + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: Govv1Beta1TallyResult; + + /** + * submit_time is the time of proposal submission. + * @format date-time + */ + submit_time?: string; + + /** + * deposit_end_time is the end time for deposition. + * @format date-time + */ + deposit_end_time?: string; + + /** total_deposit is the total deposit on the proposal. */ + total_deposit?: V1Beta1Coin[]; + + /** + * voting_start_time is the starting time to vote on a proposal. + * @format date-time + */ + voting_start_time?: string; + + /** + * voting_end_time is the end time of voting on a proposal. + * @format date-time + */ + voting_end_time?: string; +} + +/** + * TallyResult defines a standard tally for a governance proposal. + */ +export interface Govv1Beta1TallyResult { + /** yes is the number of yes votes on a proposal. */ + yes?: string; + + /** abstain is the number of abstain votes on a proposal. */ + abstain?: string; + + /** no is the number of no votes on a proposal. */ + no?: string; + + /** no_with_veto is the number of no with veto votes on a proposal. */ + no_with_veto?: string; +} + +/** +* Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. +*/ +export interface Govv1Beta1Vote { + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** voter is the voter address of the proposal. */ + voter?: string; + + /** + * Deprecated: Prefer to use `options` instead. This field is set in queries + * if and only if `len(options) == 1` and that option has weight 1. In all + * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + */ + option?: V1Beta1VoteOption; + + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options?: V1Beta1WeightedVoteOption[]; +} + /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -107,7 +222,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +230,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -145,17 +257,6 @@ export interface V1Beta1Coin { amount?: string; } -/** -* Deposit defines an amount deposited by an account address to an active -proposal. -*/ -export interface V1Beta1Deposit { - /** @format uint64 */ - proposal_id?: string; - depositor?: string; - amount?: V1Beta1Coin[]; -} - /** * DepositParams defines the params for deposits on governance proposals. */ @@ -165,7 +266,7 @@ export interface V1Beta1DepositParams { /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ max_deposit_period?: string; } @@ -179,7 +280,10 @@ export type V1Beta1MsgDepositResponse = object; * MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface V1Beta1MsgSubmitProposalResponse { - /** @format uint64 */ + /** + * proposal_id defines the unique id of the proposal. + * @format uint64 + */ proposal_id?: string; } @@ -251,144 +355,26 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Proposal defines the core field members of a governance proposal. - */ -export interface V1Beta1Proposal { - /** @format uint64 */ - proposal_id?: string; - /** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } + * 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. + * @format byte */ - content?: ProtobufAny; + next_key?: string; /** - * ProposalStatus enumerates the valid statuses of a proposal. - * - * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - * period. - * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - * period. - * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - * passed. - * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - * been rejected. - * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - * failed. + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 */ - status?: V1Beta1ProposalStatus; - - /** TallyResult defines a standard tally for a governance proposal. */ - final_tally_result?: V1Beta1TallyResult; - - /** @format date-time */ - submit_time?: string; - - /** @format date-time */ - deposit_end_time?: string; - total_deposit?: V1Beta1Coin[]; - - /** @format date-time */ - voting_start_time?: string; - - /** @format date-time */ - voting_end_time?: string; + total?: string; } /** * ProposalStatus enumerates the valid statuses of a proposal. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting @@ -414,14 +400,15 @@ export enum V1Beta1ProposalStatus { */ export interface V1Beta1QueryDepositResponse { /** deposit defines the requested deposit. */ - deposit?: V1Beta1Deposit; + deposit?: Govv1Beta1Deposit; } /** * QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface V1Beta1QueryDepositsResponse { - deposits?: V1Beta1Deposit[]; + /** deposits defines the requested deposits. */ + deposits?: Govv1Beta1Deposit[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -446,7 +433,7 @@ export interface V1Beta1QueryParamsResponse { */ export interface V1Beta1QueryProposalResponse { /** Proposal defines the core field members of a governance proposal. */ - proposal?: V1Beta1Proposal; + proposal?: Govv1Beta1Proposal; } /** @@ -454,7 +441,8 @@ export interface V1Beta1QueryProposalResponse { method. */ export interface V1Beta1QueryProposalsResponse { - proposals?: V1Beta1Proposal[]; + /** proposals defines all the requested governance proposals. */ + proposals?: Govv1Beta1Proposal[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -465,23 +453,23 @@ export interface V1Beta1QueryProposalsResponse { */ export interface V1Beta1QueryTallyResultResponse { /** tally defines the requested tally. */ - tally?: V1Beta1TallyResult; + tally?: Govv1Beta1TallyResult; } /** * QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface V1Beta1QueryVoteResponse { - /** vote defined the queried vote. */ - vote?: V1Beta1Vote; + /** vote defines the queried vote. */ + vote?: Govv1Beta1Vote; } /** * QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface V1Beta1QueryVotesResponse { - /** votes defined the queried votes. */ - votes?: V1Beta1Vote[]; + /** votes defines the queried votes. */ + votes?: Govv1Beta1Vote[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -493,7 +481,7 @@ export interface V1Beta1QueryVotesResponse { export interface V1Beta1TallyParams { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. * @format byte */ quorum?: string; @@ -506,40 +494,12 @@ export interface V1Beta1TallyParams { /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. * @format byte */ veto_threshold?: string; } -/** - * TallyResult defines a standard tally for a governance proposal. - */ -export interface V1Beta1TallyResult { - yes?: string; - abstain?: string; - no?: string; - no_with_veto?: string; -} - -/** -* Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. -*/ -export interface V1Beta1Vote { - /** @format uint64 */ - proposal_id?: string; - voter?: string; - - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - */ - option?: V1Beta1VoteOption; - options?: V1Beta1WeightedVoteOption[]; -} - /** * VoteOption enumerates the valid vote options for a given governance proposal. @@ -561,7 +521,7 @@ export enum V1Beta1VoteOption { * VotingParams defines the params for voting on governance proposals. */ export interface V1Beta1VotingParams { - /** Length of the voting period. */ + /** Duration of the voting period. */ voting_period?: string; } @@ -571,23 +531,18 @@ export interface V1Beta1VotingParams { Since: cosmos-sdk 0.43 */ export interface V1Beta1WeightedVoteOption { - /** - * VoteOption enumerates the valid vote options for a given governance proposal. - * - * - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - * - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - * - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - * - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - * - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - */ + /** option defines the valid vote options, it must not contain duplicate vote options. */ option?: V1Beta1VoteOption; + + /** weight is the vote weight associated with the vote option. */ weight?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -597,30 +552,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -628,149 +574,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -788,9 +671,9 @@ export class Api extends HttpClient + queryParams = (paramsType: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/gov/v1beta1/params/${params_type}`, + path: `/cosmos/gov/v1beta1/params/${paramsType}`, method: "GET", format: "json", ...params, @@ -839,9 +722,9 @@ export class Api extends HttpClient + queryProposal = (proposalId: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}`, method: "GET", format: "json", ...params, @@ -856,7 +739,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/deposits`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}/deposits`, method: "GET", query: query, format: "json", @@ -882,9 +765,9 @@ export class Api extends HttpClient + queryDeposit = (proposalId: string, depositor: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/deposits/${depositor}`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}/deposits/${depositor}`, method: "GET", format: "json", ...params, @@ -898,9 +781,9 @@ export class Api extends HttpClient + queryTallyResult = (proposalId: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/tally`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}/tally`, method: "GET", format: "json", ...params, @@ -915,7 +798,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/votes`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}/votes`, method: "GET", query: query, format: "json", @@ -941,9 +824,9 @@ export class Api extends HttpClient + queryVote = (proposalId: string, voter: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/gov/v1beta1/proposals/${proposal_id}/votes/${voter}`, + path: `/cosmos/gov/v1beta1/proposals/${proposalId}/votes/${voter}`, method: "GET", format: "json", ...params, diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types.ts new file mode 100755 index 0000000000..3b6c48336c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { WeightedVoteOption } from "./types/cosmos/gov/v1beta1/gov" +import { TextProposal } from "./types/cosmos/gov/v1beta1/gov" +import { Deposit } from "./types/cosmos/gov/v1beta1/gov" +import { Proposal } from "./types/cosmos/gov/v1beta1/gov" +import { TallyResult } from "./types/cosmos/gov/v1beta1/gov" +import { Vote } from "./types/cosmos/gov/v1beta1/gov" +import { DepositParams } from "./types/cosmos/gov/v1beta1/gov" +import { VotingParams } from "./types/cosmos/gov/v1beta1/gov" +import { TallyParams } from "./types/cosmos/gov/v1beta1/gov" + + +export { + WeightedVoteOption, + TextProposal, + Deposit, + Proposal, + TallyResult, + Vote, + DepositParams, + VotingParams, + TallyParams, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts index d6086cde8c..ea12fba1be 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts @@ -1,42 +1,49 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Deposit, - Vote, - Proposal, - DepositParams, - VotingParams, - TallyParams, -} from "../../../cosmos/gov/v1beta1/gov"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Deposit, DepositParams, Proposal, TallyParams, Vote, VotingParams } from "./gov"; export const protobufPackage = "cosmos.gov.v1beta1"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: number; + startingProposalId: number; /** deposits defines all the deposits present at genesis. */ deposits: Deposit[]; /** votes defines all the votes present at genesis. */ votes: Vote[]; /** proposals defines all the proposals present at genesis. */ proposals: Proposal[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params: DepositParams | undefined; - /** params defines all the paramaters of related to voting. */ - voting_params: VotingParams | undefined; - /** params defines all the paramaters of related to tally. */ - tally_params: TallyParams | undefined; + /** params defines all the parameters of related to deposit. */ + depositParams: + | DepositParams + | undefined; + /** params defines all the parameters of related to voting. */ + votingParams: + | VotingParams + | undefined; + /** params defines all the parameters of related to tally. */ + tallyParams: TallyParams | undefined; } -const baseGenesisState: object = { starting_proposal_id: 0 }; +function createBaseGenesisState(): GenesisState { + return { + startingProposalId: 0, + deposits: [], + votes: [], + proposals: [], + depositParams: undefined, + votingParams: undefined, + tallyParams: undefined, + }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - if (message.starting_proposal_id !== 0) { - writer.uint32(8).uint64(message.starting_proposal_id); + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.startingProposalId !== 0) { + writer.uint32(8).uint64(message.startingProposalId); } for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -47,39 +54,27 @@ export const GenesisState = { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.deposit_params !== undefined) { - DepositParams.encode( - message.deposit_params, - writer.uint32(42).fork() - ).ldelim(); + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); } - if (message.voting_params !== undefined) { - VotingParams.encode( - message.voting_params, - writer.uint32(50).fork() - ).ldelim(); + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); } - if (message.tally_params !== undefined) { - TallyParams.encode( - message.tally_params, - writer.uint32(58).fork() - ).ldelim(); + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.starting_proposal_id = longToNumber(reader.uint64() as Long); + message.startingProposalId = longToNumber(reader.uint64() as Long); break; case 2: message.deposits.push(Deposit.decode(reader, reader.uint32())); @@ -91,16 +86,13 @@ export const GenesisState = { message.proposals.push(Proposal.decode(reader, reader.uint32())); break; case 5: - message.deposit_params = DepositParams.decode( - reader, - reader.uint32() - ); + message.depositParams = DepositParams.decode(reader, reader.uint32()); break; case 6: - message.voting_params = VotingParams.decode(reader, reader.uint32()); + message.votingParams = VotingParams.decode(reader, reader.uint32()); break; case 7: - message.tally_params = TallyParams.decode(reader, reader.uint32()); + message.tallyParams = TallyParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -111,157 +103,93 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.starting_proposal_id = Number(object.starting_proposal_id); - } else { - message.starting_proposal_id = 0; - } - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromJSON(e)); - } - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromJSON(e)); - } - } - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromJSON(e)); - } - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromJSON(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromJSON(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromJSON(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; + return { + startingProposalId: isSet(object.startingProposalId) ? Number(object.startingProposalId) : 0, + deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], + proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], + depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, + votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, + tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.starting_proposal_id !== undefined && - (obj.starting_proposal_id = message.starting_proposal_id); + message.startingProposalId !== undefined && (obj.startingProposalId = Math.round(message.startingProposalId)); if (message.deposits) { - obj.deposits = message.deposits.map((e) => - e ? Deposit.toJSON(e) : undefined - ); + obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); } else { obj.deposits = []; } if (message.votes) { - obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); + obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); } else { obj.votes = []; } if (message.proposals) { - obj.proposals = message.proposals.map((e) => - e ? Proposal.toJSON(e) : undefined - ); + obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); } else { obj.proposals = []; } - message.deposit_params !== undefined && - (obj.deposit_params = message.deposit_params - ? DepositParams.toJSON(message.deposit_params) - : undefined); - message.voting_params !== undefined && - (obj.voting_params = message.voting_params - ? VotingParams.toJSON(message.voting_params) - : undefined); - message.tally_params !== undefined && - (obj.tally_params = message.tally_params - ? TallyParams.toJSON(message.tally_params) - : undefined); + message.depositParams !== undefined + && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.votingParams !== undefined + && (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.tallyParams !== undefined + && (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.deposits = []; - message.votes = []; - message.proposals = []; - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.starting_proposal_id = object.starting_proposal_id; - } else { - message.starting_proposal_id = 0; - } - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromPartial(e)); - } - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromPartial(e)); - } - } - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromPartial(e)); - } - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromPartial(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromPartial(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromPartial(object.tally_params); - } else { - message.tally_params = undefined; - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.startingProposalId = object.startingProposalId ?? 0; + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; + message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) + ? DepositParams.fromPartial(object.depositParams) + : undefined; + message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) + ? VotingParams.fromPartial(object.votingParams) + : undefined; + message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) + ? TallyParams.fromPartial(object.tallyParams) + : undefined; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -269,7 +197,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts index d93a8dbf9c..057e136b7a 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts @@ -1,11 +1,11 @@ //@ts-nocheck /* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.gov.v1beta1"; @@ -60,14 +60,15 @@ export function voteOptionToJSON(object: VoteOption): string { return "VOTE_OPTION_NO"; case VoteOption.VOTE_OPTION_NO_WITH_VETO: return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit @@ -138,8 +139,9 @@ export function proposalStatusToJSON(object: ProposalStatus): string { return "PROPOSAL_STATUS_REJECTED"; case ProposalStatus.PROPOSAL_STATUS_FAILED: return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -149,7 +151,9 @@ export function proposalStatusToJSON(object: ProposalStatus): string { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ option: VoteOption; + /** weight is the vote weight associated with the vote option. */ weight: string; } @@ -158,7 +162,9 @@ export interface WeightedVoteOption { * manually updated in case of approval. */ export interface TextProposal { + /** title of the proposal. */ title: string; + /** description associated with the proposal. */ description: string; } @@ -167,30 +173,60 @@ export interface TextProposal { * proposal. */ export interface Deposit { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { - proposal_id: number; - content: Any | undefined; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** content is the proposal's content. */ + content: + | Any + | undefined; + /** status defines the proposal status. */ status: ProposalStatus; - final_tally_result: TallyResult | undefined; - submit_time: Date | undefined; - deposit_end_time: Date | undefined; - total_deposit: Coin[]; - voting_start_time: Date | undefined; - voting_end_time: Date | undefined; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + finalTallyResult: + | TallyResult + | undefined; + /** submit_time is the time of proposal submission. */ + submitTime: + | Date + | undefined; + /** deposit_end_time is the end time for deposition. */ + depositEndTime: + | Date + | undefined; + /** total_deposit is the total deposit on the proposal. */ + totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ + votingStartTime: + | Date + | undefined; + /** voting_end_time is the end time of voting on a proposal. */ + votingEndTime: Date | undefined; } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResult { + /** yes is the number of yes votes on a proposal. */ yes: string; + /** abstain is the number of abstain votes on a proposal. */ abstain: string; + /** no is the number of no votes on a proposal. */ no: string; - no_with_veto: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ + noWithVeto: string; } /** @@ -198,7 +234,9 @@ export interface TallyResult { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address of the proposal. */ voter: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -208,50 +246,53 @@ export interface Vote { * @deprecated */ option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOption[]; } /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParams { /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: Coin[]; + minDeposit: Coin[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ - max_deposit_period: Duration | undefined; + maxDepositPeriod: Duration | undefined; } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { - /** Length of the voting period. */ - voting_period: Duration | undefined; + /** Duration of the voting period. */ + votingPeriod: Duration | undefined; } /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParams { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ quorum: Uint8Array; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: Uint8Array; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ - veto_threshold: Uint8Array; + vetoThreshold: Uint8Array; } -const baseWeightedVoteOption: object = { option: 0, weight: "" }; +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { option: 0, weight: "" }; +} export const WeightedVoteOption = { - encode( - message: WeightedVoteOption, - writer: Writer = Writer.create() - ): Writer { + encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.option !== 0) { writer.uint32(8).int32(message.option); } @@ -261,10 +302,10 @@ export const WeightedVoteOption = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; + const message = createBaseWeightedVoteOption(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -283,48 +324,33 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = String(object.weight); - } else { - message.weight = ""; - } - return message; + return { + option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + weight: isSet(object.weight) ? String(object.weight) : "", + }; }, toJSON(message: WeightedVoteOption): unknown { const obj: any = {}; - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.weight !== undefined && (obj.weight = message.weight); return obj; }, - fromPartial(object: DeepPartial): WeightedVoteOption { - const message = { ...baseWeightedVoteOption } as WeightedVoteOption; - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = object.weight; - } else { - message.weight = ""; - } + fromPartial, I>>(object: I): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + message.option = object.option ?? 0; + message.weight = object.weight ?? ""; return message; }, }; -const baseTextProposal: object = { title: "", description: "" }; +function createBaseTextProposal(): TextProposal { + return { title: "", description: "" }; +} export const TextProposal = { - encode(message: TextProposal, writer: Writer = Writer.create()): Writer { + encode(message: TextProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -334,10 +360,10 @@ export const TextProposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TextProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTextProposal } as TextProposal; + const message = createBaseTextProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -356,50 +382,35 @@ export const TextProposal = { }, fromJSON(object: any): TextProposal { - const message = { ...baseTextProposal } as TextProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; }, toJSON(message: TextProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); + message.description !== undefined && (obj.description = message.description); return obj; }, - fromPartial(object: DeepPartial): TextProposal { - const message = { ...baseTextProposal } as TextProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } + fromPartial, I>>(object: I): TextProposal { + const message = createBaseTextProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; return message; }, }; -const baseDeposit: object = { proposal_id: 0, depositor: "" }; +function createBaseDeposit(): Deposit { + return { proposalId: 0, depositor: "", amount: [] }; +} export const Deposit = { - encode(message: Deposit, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { writer.uint32(18).string(message.depositor); @@ -410,16 +421,15 @@ export const Deposit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDeposit } as Deposit; - message.amount = []; + const message = createBaseDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.depositor = reader.string(); @@ -436,67 +446,52 @@ export const Deposit = { }, fromJSON(object: any): Deposit { - const message = { ...baseDeposit } as Deposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Deposit): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } return obj; }, - fromPartial(object: DeepPartial): Deposit { - const message = { ...baseDeposit } as Deposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Deposit { + const message = createBaseDeposit(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseProposal: object = { proposal_id: 0, status: 0 }; +function createBaseProposal(): Proposal { + return { + proposalId: 0, + content: undefined, + status: 0, + finalTallyResult: undefined, + submitTime: undefined, + depositEndTime: undefined, + totalDeposit: [], + votingStartTime: undefined, + votingEndTime: undefined, + }; +} export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.content !== undefined) { Any.encode(message.content, writer.uint32(18).fork()).ldelim(); @@ -504,52 +499,36 @@ export const Proposal = { if (message.status !== 0) { writer.uint32(24).int32(message.status); } - if (message.final_tally_result !== undefined) { - TallyResult.encode( - message.final_tally_result, - writer.uint32(34).fork() - ).ldelim(); + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); } - if (message.submit_time !== undefined) { - Timestamp.encode( - toTimestamp(message.submit_time), - writer.uint32(42).fork() - ).ldelim(); + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); } - if (message.deposit_end_time !== undefined) { - Timestamp.encode( - toTimestamp(message.deposit_end_time), - writer.uint32(50).fork() - ).ldelim(); + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); } - for (const v of message.total_deposit) { + for (const v of message.totalDeposit) { Coin.encode(v!, writer.uint32(58).fork()).ldelim(); } - if (message.voting_start_time !== undefined) { - Timestamp.encode( - toTimestamp(message.voting_start_time), - writer.uint32(66).fork() - ).ldelim(); + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); } - if (message.voting_end_time !== undefined) { - Timestamp.encode( - toTimestamp(message.voting_end_time), - writer.uint32(74).fork() - ).ldelim(); + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; + const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.content = Any.decode(reader, reader.uint32()); @@ -558,33 +537,22 @@ export const Proposal = { message.status = reader.int32() as any; break; case 4: - message.final_tally_result = TallyResult.decode( - reader, - reader.uint32() - ); + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); break; case 5: - message.submit_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 6: - message.deposit_end_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: - message.total_deposit.push(Coin.decode(reader, reader.uint32())); + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); break; case 8: - message.voting_start_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 9: - message.voting_end_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -595,187 +563,63 @@ export const Proposal = { }, fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromJSON(object.content); - } else { - message.content = undefined; - } - if (object.status !== undefined && object.status !== null) { - message.status = proposalStatusFromJSON(object.status); - } else { - message.status = 0; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.final_tally_result = TallyResult.fromJSON( - object.final_tally_result - ); - } else { - message.final_tally_result = undefined; - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submit_time = fromJsonTimestamp(object.submit_time); - } else { - message.submit_time = undefined; - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.deposit_end_time = fromJsonTimestamp(object.deposit_end_time); - } else { - message.deposit_end_time = undefined; - } - if (object.total_deposit !== undefined && object.total_deposit !== null) { - for (const e of object.total_deposit) { - message.total_deposit.push(Coin.fromJSON(e)); - } - } - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.voting_start_time = fromJsonTimestamp(object.voting_start_time); - } else { - message.voting_start_time = undefined; - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.voting_end_time = fromJsonTimestamp(object.voting_end_time); - } else { - message.voting_end_time = undefined; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, + submitTime: isSet(object.submitTime) ? fromJsonTimestamp(object.submitTime) : undefined, + depositEndTime: isSet(object.depositEndTime) ? fromJsonTimestamp(object.depositEndTime) : undefined, + totalDeposit: Array.isArray(object?.totalDeposit) ? object.totalDeposit.map((e: any) => Coin.fromJSON(e)) : [], + votingStartTime: isSet(object.votingStartTime) ? fromJsonTimestamp(object.votingStartTime) : undefined, + votingEndTime: isSet(object.votingEndTime) ? fromJsonTimestamp(object.votingEndTime) : undefined, + }; }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.content !== undefined && - (obj.content = message.content ? Any.toJSON(message.content) : undefined); - message.status !== undefined && - (obj.status = proposalStatusToJSON(message.status)); - message.final_tally_result !== undefined && - (obj.final_tally_result = message.final_tally_result - ? TallyResult.toJSON(message.final_tally_result) - : undefined); - message.submit_time !== undefined && - (obj.submit_time = - message.submit_time !== undefined - ? message.submit_time.toISOString() - : null); - message.deposit_end_time !== undefined && - (obj.deposit_end_time = - message.deposit_end_time !== undefined - ? message.deposit_end_time.toISOString() - : null); - if (message.total_deposit) { - obj.total_deposit = message.total_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); + message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); + message.finalTallyResult !== undefined + && (obj.finalTallyResult = message.finalTallyResult ? TallyResult.toJSON(message.finalTallyResult) : undefined); + message.submitTime !== undefined && (obj.submitTime = message.submitTime.toISOString()); + message.depositEndTime !== undefined && (obj.depositEndTime = message.depositEndTime.toISOString()); + if (message.totalDeposit) { + obj.totalDeposit = message.totalDeposit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.total_deposit = []; + obj.totalDeposit = []; } - message.voting_start_time !== undefined && - (obj.voting_start_time = - message.voting_start_time !== undefined - ? message.voting_start_time.toISOString() - : null); - message.voting_end_time !== undefined && - (obj.voting_end_time = - message.voting_end_time !== undefined - ? message.voting_end_time.toISOString() - : null); + message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString()); + message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString()); return obj; }, - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - message.total_deposit = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromPartial(object.content); - } else { - message.content = undefined; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = 0; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.final_tally_result = TallyResult.fromPartial( - object.final_tally_result - ); - } else { - message.final_tally_result = undefined; - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submit_time = object.submit_time; - } else { - message.submit_time = undefined; - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.deposit_end_time = object.deposit_end_time; - } else { - message.deposit_end_time = undefined; - } - if (object.total_deposit !== undefined && object.total_deposit !== null) { - for (const e of object.total_deposit) { - message.total_deposit.push(Coin.fromPartial(e)); - } - } - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.voting_start_time = object.voting_start_time; - } else { - message.voting_start_time = undefined; - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.voting_end_time = object.voting_end_time; - } else { - message.voting_end_time = undefined; - } + fromPartial, I>>(object: I): Proposal { + const message = createBaseProposal(); + message.proposalId = object.proposalId ?? 0; + message.content = (object.content !== undefined && object.content !== null) + ? Any.fromPartial(object.content) + : undefined; + message.status = object.status ?? 0; + message.finalTallyResult = (object.finalTallyResult !== undefined && object.finalTallyResult !== null) + ? TallyResult.fromPartial(object.finalTallyResult) + : undefined; + message.submitTime = object.submitTime ?? undefined; + message.depositEndTime = object.depositEndTime ?? undefined; + message.totalDeposit = object.totalDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.votingStartTime = object.votingStartTime ?? undefined; + message.votingEndTime = object.votingEndTime ?? undefined; return message; }, }; -const baseTallyResult: object = { - yes: "", - abstain: "", - no: "", - no_with_veto: "", -}; +function createBaseTallyResult(): TallyResult { + return { yes: "", abstain: "", no: "", noWithVeto: "" }; +} export const TallyResult = { - encode(message: TallyResult, writer: Writer = Writer.create()): Writer { + encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.yes !== "") { writer.uint32(10).string(message.yes); } @@ -785,16 +629,16 @@ export const TallyResult = { if (message.no !== "") { writer.uint32(26).string(message.no); } - if (message.no_with_veto !== "") { - writer.uint32(34).string(message.no_with_veto); + if (message.noWithVeto !== "") { + writer.uint32(34).string(message.noWithVeto); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTallyResult } as TallyResult; + const message = createBaseTallyResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -808,7 +652,7 @@ export const TallyResult = { message.no = reader.string(); break; case 4: - message.no_with_veto = reader.string(); + message.noWithVeto = reader.string(); break; default: reader.skipType(tag & 7); @@ -819,28 +663,12 @@ export const TallyResult = { }, fromJSON(object: any): TallyResult { - const message = { ...baseTallyResult } as TallyResult; - if (object.yes !== undefined && object.yes !== null) { - message.yes = String(object.yes); - } else { - message.yes = ""; - } - if (object.abstain !== undefined && object.abstain !== null) { - message.abstain = String(object.abstain); - } else { - message.abstain = ""; - } - if (object.no !== undefined && object.no !== null) { - message.no = String(object.no); - } else { - message.no = ""; - } - if (object.no_with_veto !== undefined && object.no_with_veto !== null) { - message.no_with_veto = String(object.no_with_veto); - } else { - message.no_with_veto = ""; - } - return message; + return { + yes: isSet(object.yes) ? String(object.yes) : "", + abstain: isSet(object.abstain) ? String(object.abstain) : "", + no: isSet(object.no) ? String(object.no) : "", + noWithVeto: isSet(object.noWithVeto) ? String(object.noWithVeto) : "", + }; }, toJSON(message: TallyResult): unknown { @@ -848,43 +676,28 @@ export const TallyResult = { message.yes !== undefined && (obj.yes = message.yes); message.abstain !== undefined && (obj.abstain = message.abstain); message.no !== undefined && (obj.no = message.no); - message.no_with_veto !== undefined && - (obj.no_with_veto = message.no_with_veto); + message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto); return obj; }, - fromPartial(object: DeepPartial): TallyResult { - const message = { ...baseTallyResult } as TallyResult; - if (object.yes !== undefined && object.yes !== null) { - message.yes = object.yes; - } else { - message.yes = ""; - } - if (object.abstain !== undefined && object.abstain !== null) { - message.abstain = object.abstain; - } else { - message.abstain = ""; - } - if (object.no !== undefined && object.no !== null) { - message.no = object.no; - } else { - message.no = ""; - } - if (object.no_with_veto !== undefined && object.no_with_veto !== null) { - message.no_with_veto = object.no_with_veto; - } else { - message.no_with_veto = ""; - } + fromPartial, I>>(object: I): TallyResult { + const message = createBaseTallyResult(); + message.yes = object.yes ?? ""; + message.abstain = object.abstain ?? ""; + message.no = object.no ?? ""; + message.noWithVeto = object.noWithVeto ?? ""; return message; }, }; -const baseVote: object = { proposal_id: 0, voter: "", option: 0 }; +function createBaseVote(): Vote { + return { proposalId: 0, voter: "", option: 0, options: [] }; +} export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); @@ -898,16 +711,15 @@ export const Vote = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; - message.options = []; + const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.voter = reader.string(); @@ -916,9 +728,7 @@ export const Vote = { message.option = reader.int32() as any; break; case 4: - message.options.push( - WeightedVoteOption.decode(reader, reader.uint32()) - ); + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -929,104 +739,64 @@ export const Vote = { }, fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromJSON(e)); - } - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], + }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); if (message.options) { - obj.options = message.options.map((e) => - e ? WeightedVoteOption.toJSON(e) : undefined - ); + obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); } else { obj.options = []; } return obj; }, - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; return message; }, }; -const baseDepositParams: object = {}; +function createBaseDepositParams(): DepositParams { + return { minDeposit: [], maxDepositPeriod: undefined }; +} export const DepositParams = { - encode(message: DepositParams, writer: Writer = Writer.create()): Writer { - for (const v of message.min_deposit) { + encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.max_deposit_period !== undefined) { - Duration.encode( - message.max_deposit_period, - writer.uint32(18).fork() - ).ldelim(); + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; + const message = createBaseDepositParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.min_deposit.push(Coin.decode(reader, reader.uint32())); + message.minDeposit.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.max_deposit_period = Duration.decode(reader, reader.uint32()); + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1037,81 +807,55 @@ export const DepositParams = { }, fromJSON(object: any): DepositParams { - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; - if (object.min_deposit !== undefined && object.min_deposit !== null) { - for (const e of object.min_deposit) { - message.min_deposit.push(Coin.fromJSON(e)); - } - } - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.max_deposit_period = Duration.fromJSON(object.max_deposit_period); - } else { - message.max_deposit_period = undefined; - } - return message; + return { + minDeposit: Array.isArray(object?.minDeposit) ? object.minDeposit.map((e: any) => Coin.fromJSON(e)) : [], + maxDepositPeriod: isSet(object.maxDepositPeriod) ? Duration.fromJSON(object.maxDepositPeriod) : undefined, + }; }, toJSON(message: DepositParams): unknown { const obj: any = {}; - if (message.min_deposit) { - obj.min_deposit = message.min_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.minDeposit) { + obj.minDeposit = message.minDeposit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.min_deposit = []; + obj.minDeposit = []; } - message.max_deposit_period !== undefined && - (obj.max_deposit_period = message.max_deposit_period - ? Duration.toJSON(message.max_deposit_period) - : undefined); + message.maxDepositPeriod !== undefined + && (obj.maxDepositPeriod = message.maxDepositPeriod ? Duration.toJSON(message.maxDepositPeriod) : undefined); return obj; }, - fromPartial(object: DeepPartial): DepositParams { - const message = { ...baseDepositParams } as DepositParams; - message.min_deposit = []; - if (object.min_deposit !== undefined && object.min_deposit !== null) { - for (const e of object.min_deposit) { - message.min_deposit.push(Coin.fromPartial(e)); - } - } - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.max_deposit_period = Duration.fromPartial( - object.max_deposit_period - ); - } else { - message.max_deposit_period = undefined; - } + fromPartial, I>>(object: I): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) + ? Duration.fromPartial(object.maxDepositPeriod) + : undefined; return message; }, }; -const baseVotingParams: object = {}; +function createBaseVotingParams(): VotingParams { + return { votingPeriod: undefined }; +} export const VotingParams = { - encode(message: VotingParams, writer: Writer = Writer.create()): Writer { - if (message.voting_period !== undefined) { - Duration.encode(message.voting_period, writer.uint32(10).fork()).ldelim(); + encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVotingParams } as VotingParams; + const message = createBaseVotingParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.voting_period = Duration.decode(reader, reader.uint32()); + message.votingPeriod = Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1122,55 +866,47 @@ export const VotingParams = { }, fromJSON(object: any): VotingParams { - const message = { ...baseVotingParams } as VotingParams; - if (object.voting_period !== undefined && object.voting_period !== null) { - message.voting_period = Duration.fromJSON(object.voting_period); - } else { - message.voting_period = undefined; - } - return message; + return { votingPeriod: isSet(object.votingPeriod) ? Duration.fromJSON(object.votingPeriod) : undefined }; }, toJSON(message: VotingParams): unknown { const obj: any = {}; - message.voting_period !== undefined && - (obj.voting_period = message.voting_period - ? Duration.toJSON(message.voting_period) - : undefined); + message.votingPeriod !== undefined + && (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); return obj; }, - fromPartial(object: DeepPartial): VotingParams { - const message = { ...baseVotingParams } as VotingParams; - if (object.voting_period !== undefined && object.voting_period !== null) { - message.voting_period = Duration.fromPartial(object.voting_period); - } else { - message.voting_period = undefined; - } + fromPartial, I>>(object: I): VotingParams { + const message = createBaseVotingParams(); + message.votingPeriod = (object.votingPeriod !== undefined && object.votingPeriod !== null) + ? Duration.fromPartial(object.votingPeriod) + : undefined; return message; }, }; -const baseTallyParams: object = {}; +function createBaseTallyParams(): TallyParams { + return { quorum: new Uint8Array(), threshold: new Uint8Array(), vetoThreshold: new Uint8Array() }; +} export const TallyParams = { - encode(message: TallyParams, writer: Writer = Writer.create()): Writer { + encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.quorum.length !== 0) { writer.uint32(10).bytes(message.quorum); } if (message.threshold.length !== 0) { writer.uint32(18).bytes(message.threshold); } - if (message.veto_threshold.length !== 0) { - writer.uint32(26).bytes(message.veto_threshold); + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(message.vetoThreshold); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTallyParams } as TallyParams; + const message = createBaseTallyParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1181,7 +917,7 @@ export const TallyParams = { message.threshold = reader.bytes(); break; case 3: - message.veto_threshold = reader.bytes(); + message.vetoThreshold = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1192,103 +928,90 @@ export const TallyParams = { }, fromJSON(object: any): TallyParams { - const message = { ...baseTallyParams } as TallyParams; - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = bytesFromBase64(object.quorum); - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = bytesFromBase64(object.threshold); - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.veto_threshold = bytesFromBase64(object.veto_threshold); - } - return message; + return { + quorum: isSet(object.quorum) ? bytesFromBase64(object.quorum) : new Uint8Array(), + threshold: isSet(object.threshold) ? bytesFromBase64(object.threshold) : new Uint8Array(), + vetoThreshold: isSet(object.vetoThreshold) ? bytesFromBase64(object.vetoThreshold) : new Uint8Array(), + }; }, toJSON(message: TallyParams): unknown { const obj: any = {}; - message.quorum !== undefined && - (obj.quorum = base64FromBytes( - message.quorum !== undefined ? message.quorum : new Uint8Array() - )); - message.threshold !== undefined && - (obj.threshold = base64FromBytes( - message.threshold !== undefined ? message.threshold : new Uint8Array() - )); - message.veto_threshold !== undefined && - (obj.veto_threshold = base64FromBytes( - message.veto_threshold !== undefined - ? message.veto_threshold - : new Uint8Array() + message.quorum !== undefined + && (obj.quorum = base64FromBytes(message.quorum !== undefined ? message.quorum : new Uint8Array())); + message.threshold !== undefined + && (obj.threshold = base64FromBytes(message.threshold !== undefined ? message.threshold : new Uint8Array())); + message.vetoThreshold !== undefined + && (obj.vetoThreshold = base64FromBytes( + message.vetoThreshold !== undefined ? message.vetoThreshold : new Uint8Array(), )); return obj; }, - fromPartial(object: DeepPartial): TallyParams { - const message = { ...baseTallyParams } as TallyParams; - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = object.quorum; - } else { - message.quorum = new Uint8Array(); - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = object.threshold; - } else { - message.threshold = new Uint8Array(); - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.veto_threshold = object.veto_threshold; - } else { - message.veto_threshold = new Uint8Array(); - } + fromPartial, I>>(object: I): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? new Uint8Array(); + message.threshold = object.threshold ?? new Uint8Array(); + message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -1318,7 +1041,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts index 15957d1008..933534ceab 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts @@ -1,30 +1,27 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { - ProposalStatus, - Proposal, - Vote, - VotingParams, - DepositParams, - TallyParams, Deposit, - TallyResult, + DepositParams, + Proposal, + ProposalStatus, proposalStatusFromJSON, proposalStatusToJSON, -} from "../../../cosmos/gov/v1beta1/gov"; -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; + TallyParams, + TallyResult, + Vote, + VotingParams, +} from "./gov"; export const protobufPackage = "cosmos.gov.v1beta1"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; + proposalId: number; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ @@ -35,7 +32,7 @@ export interface QueryProposalResponse { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequest { /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; + proposalStatus: ProposalStatus; /** voter defines the voter address for the proposals. */ voter: string; /** depositor defines the deposit addresses from the proposals. */ @@ -49,6 +46,7 @@ export interface QueryProposalsRequest { * method. */ export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ proposals: Proposal[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; @@ -57,28 +55,28 @@ export interface QueryProposalsResponse { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; - /** voter defines the oter address for the proposals. */ + proposalId: number; + /** voter defines the voter address for the proposals. */ voter: string; } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { - /** vote defined the queried vote. */ + /** vote defines the queried vote. */ vote: Vote | undefined; } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; + proposalId: number; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; @@ -90,23 +88,27 @@ export interface QueryParamsRequest { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - params_type: string; + paramsType: string; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { /** voting_params defines the parameters related to voting. */ - voting_params: VotingParams | undefined; + votingParams: + | VotingParams + | undefined; /** deposit_params defines the parameters related to deposit. */ - deposit_params: DepositParams | undefined; + depositParams: + | DepositParams + | undefined; /** tally_params defines the parameters related to tally. */ - tally_params: TallyParams | undefined; + tallyParams: TallyParams | undefined; } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; + proposalId: number; /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -120,13 +122,14 @@ export interface QueryDepositResponse { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; + proposalId: number; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ deposits: Deposit[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; @@ -135,7 +138,7 @@ export interface QueryDepositsResponse { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposal_id: number; + proposalId: number; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ @@ -144,28 +147,27 @@ export interface QueryTallyResultResponse { tally: TallyResult | undefined; } -const baseQueryProposalRequest: object = { proposal_id: 0 }; +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { proposalId: 0 }; +} export const QueryProposalRequest = { - encode( - message: QueryProposalRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; + const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -176,50 +178,38 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); return obj; }, - fromPartial(object: DeepPartial): QueryProposalRequest { - const message = { ...baseQueryProposalRequest } as QueryProposalRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } + fromPartial, I>>(object: I): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId ?? 0; return message; }, }; -const baseQueryProposalResponse: object = {}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { proposal: undefined }; +} export const QueryProposalResponse = { - encode( - message: QueryProposalResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; + const message = createBaseQueryProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -235,50 +225,32 @@ export const QueryProposalResponse = { }, fromJSON(object: any): QueryProposalResponse { - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromJSON(object.proposal); - } else { - message.proposal = undefined; - } - return message; + return { proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined }; }, toJSON(message: QueryProposalResponse): unknown { const obj: any = {}; - message.proposal !== undefined && - (obj.proposal = message.proposal - ? Proposal.toJSON(message.proposal) - : undefined); + message.proposal !== undefined && (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryProposalResponse { - const message = { ...baseQueryProposalResponse } as QueryProposalResponse; - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromPartial(object.proposal); - } else { - message.proposal = undefined; - } + fromPartial, I>>(object: I): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = (object.proposal !== undefined && object.proposal !== null) + ? Proposal.fromPartial(object.proposal) + : undefined; return message; }, }; -const baseQueryProposalsRequest: object = { - proposal_status: 0, - voter: "", - depositor: "", -}; +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { proposalStatus: 0, voter: "", depositor: "", pagination: undefined }; +} export const QueryProposalsRequest = { - encode( - message: QueryProposalsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_status !== 0) { - writer.uint32(8).int32(message.proposal_status); + encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); } if (message.voter !== "") { writer.uint32(18).string(message.voter); @@ -292,15 +264,15 @@ export const QueryProposalsRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; + const message = createBaseQueryProposalsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_status = reader.int32() as any; + message.proposalStatus = reader.int32() as any; break; case 2: message.voter = reader.string(); @@ -320,101 +292,55 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposal_status = proposalStatusFromJSON(object.proposal_status); - } else { - message.proposal_status = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + depositor: isSet(object.depositor) ? String(object.depositor) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryProposalsRequest): unknown { const obj: any = {}; - message.proposal_status !== undefined && - (obj.proposal_status = proposalStatusToJSON(message.proposal_status)); + message.proposalStatus !== undefined && (obj.proposalStatus = proposalStatusToJSON(message.proposalStatus)); message.voter !== undefined && (obj.voter = message.voter); message.depositor !== undefined && (obj.depositor = message.depositor); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryProposalsRequest { - const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposal_status = object.proposal_status; - } else { - message.proposal_status = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + message.proposalStatus = object.proposalStatus ?? 0; + message.voter = object.voter ?? ""; + message.depositor = object.depositor ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryProposalsResponse: object = {}; +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { proposals: [], pagination: undefined }; +} export const QueryProposalsResponse = { - encode( - message: QueryProposalsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; + const message = createBaseQueryProposalsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -433,62 +359,42 @@ export const QueryProposalsResponse = { }, fromJSON(object: any): QueryProposalsResponse { - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryProposalsResponse): unknown { const obj: any = {}; if (message.proposals) { - obj.proposals = message.proposals.map((e) => - e ? Proposal.toJSON(e) : undefined - ); + obj.proposals = message.proposals.map((e) => e ? Proposal.toJSON(e) : undefined); } else { obj.proposals = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryProposalsResponse { - const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; - message.proposals = []; - if (object.proposals !== undefined && object.proposals !== null) { - for (const e of object.proposals) { - message.proposals.push(Proposal.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryVoteRequest: object = { proposal_id: 0, voter: "" }; +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { proposalId: 0, voter: "" }; +} export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); @@ -496,15 +402,15 @@ export const QueryVoteRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; + const message = createBaseQueryVoteRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.voter = reader.string(); @@ -518,58 +424,43 @@ export const QueryVoteRequest = { }, fromJSON(object: any): QueryVoteRequest { - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + }; }, toJSON(message: QueryVoteRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.voter !== undefined && (obj.voter = message.voter); return obj; }, - fromPartial(object: DeepPartial): QueryVoteRequest { - const message = { ...baseQueryVoteRequest } as QueryVoteRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } + fromPartial, I>>(object: I): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; return message; }, }; -const baseQueryVoteResponse: object = {}; +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { vote: undefined }; +} export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: Writer = Writer.create()): Writer { + encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; + const message = createBaseQueryVoteResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -585,39 +476,30 @@ export const QueryVoteResponse = { }, fromJSON(object: any): QueryVoteResponse { - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromJSON(object.vote); - } else { - message.vote = undefined; - } - return message; + return { vote: isSet(object.vote) ? Vote.fromJSON(object.vote) : undefined }; }, toJSON(message: QueryVoteResponse): unknown { const obj: any = {}; - message.vote !== undefined && - (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); + message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryVoteResponse { - const message = { ...baseQueryVoteResponse } as QueryVoteResponse; - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromPartial(object.vote); - } else { - message.vote = undefined; - } + fromPartial, I>>(object: I): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + message.vote = (object.vote !== undefined && object.vote !== null) ? Vote.fromPartial(object.vote) : undefined; return message; }, }; -const baseQueryVotesRequest: object = { proposal_id: 0 }; +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { proposalId: 0, pagination: undefined }; +} export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -625,15 +507,15 @@ export const QueryVotesRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; + const message = createBaseQueryVotesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -647,71 +529,49 @@ export const QueryVotesRequest = { }, fromJSON(object: any): QueryVotesRequest { - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryVotesRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryVotesRequest { - const message = { ...baseQueryVotesRequest } as QueryVotesRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + message.proposalId = object.proposalId ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryVotesResponse: object = {}; +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { votes: [], pagination: undefined }; +} export const QueryVotesResponse = { - encode( - message: QueryVotesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; + const message = createBaseQueryVotesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -730,74 +590,55 @@ export const QueryVotesResponse = { }, fromJSON(object: any): QueryVotesResponse { - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryVotesResponse): unknown { const obj: any = {}; if (message.votes) { - obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); + obj.votes = message.votes.map((e) => e ? Vote.toJSON(e) : undefined); } else { obj.votes = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryVotesResponse { - const message = { ...baseQueryVotesResponse } as QueryVotesResponse; - message.votes = []; - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(Vote.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryParamsRequest: object = { params_type: "" }; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { paramsType: "" }; +} export const QueryParamsRequest = { - encode( - message: QueryParamsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.params_type !== "") { - writer.uint32(10).string(message.params_type); + encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params_type = reader.string(); + message.paramsType = reader.string(); break; default: reader.skipType(tag & 7); @@ -808,79 +649,55 @@ export const QueryParamsRequest = { }, fromJSON(object: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.params_type !== undefined && object.params_type !== null) { - message.params_type = String(object.params_type); - } else { - message.params_type = ""; - } - return message; + return { paramsType: isSet(object.paramsType) ? String(object.paramsType) : "" }; }, toJSON(message: QueryParamsRequest): unknown { const obj: any = {}; - message.params_type !== undefined && - (obj.params_type = message.params_type); + message.paramsType !== undefined && (obj.paramsType = message.paramsType); return obj; }, - fromPartial(object: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.params_type !== undefined && object.params_type !== null) { - message.params_type = object.params_type; - } else { - message.params_type = ""; - } + fromPartial, I>>(object: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.paramsType = object.paramsType ?? ""; return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { votingParams: undefined, depositParams: undefined, tallyParams: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.voting_params !== undefined) { - VotingParams.encode( - message.voting_params, - writer.uint32(10).fork() - ).ldelim(); + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); } - if (message.deposit_params !== undefined) { - DepositParams.encode( - message.deposit_params, - writer.uint32(18).fork() - ).ldelim(); + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); } - if (message.tally_params !== undefined) { - TallyParams.encode( - message.tally_params, - writer.uint32(26).fork() - ).ldelim(); + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.voting_params = VotingParams.decode(reader, reader.uint32()); + message.votingParams = VotingParams.decode(reader, reader.uint32()); break; case 2: - message.deposit_params = DepositParams.decode( - reader, - reader.uint32() - ); + message.depositParams = DepositParams.decode(reader, reader.uint32()); break; case 3: - message.tally_params = TallyParams.decode(reader, reader.uint32()); + message.tallyParams = TallyParams.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -891,72 +708,47 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromJSON(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromJSON(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromJSON(object.tally_params); - } else { - message.tally_params = undefined; - } - return message; + return { + votingParams: isSet(object.votingParams) ? VotingParams.fromJSON(object.votingParams) : undefined, + depositParams: isSet(object.depositParams) ? DepositParams.fromJSON(object.depositParams) : undefined, + tallyParams: isSet(object.tallyParams) ? TallyParams.fromJSON(object.tallyParams) : undefined, + }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.voting_params !== undefined && - (obj.voting_params = message.voting_params - ? VotingParams.toJSON(message.voting_params) - : undefined); - message.deposit_params !== undefined && - (obj.deposit_params = message.deposit_params - ? DepositParams.toJSON(message.deposit_params) - : undefined); - message.tally_params !== undefined && - (obj.tally_params = message.tally_params - ? TallyParams.toJSON(message.tally_params) - : undefined); + message.votingParams !== undefined + && (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.depositParams !== undefined + && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.tallyParams !== undefined + && (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.voting_params !== undefined && object.voting_params !== null) { - message.voting_params = VotingParams.fromPartial(object.voting_params); - } else { - message.voting_params = undefined; - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.deposit_params = DepositParams.fromPartial(object.deposit_params); - } else { - message.deposit_params = undefined; - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tally_params = TallyParams.fromPartial(object.tally_params); - } else { - message.tally_params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.votingParams = (object.votingParams !== undefined && object.votingParams !== null) + ? VotingParams.fromPartial(object.votingParams) + : undefined; + message.depositParams = (object.depositParams !== undefined && object.depositParams !== null) + ? DepositParams.fromPartial(object.depositParams) + : undefined; + message.tallyParams = (object.tallyParams !== undefined && object.tallyParams !== null) + ? TallyParams.fromPartial(object.tallyParams) + : undefined; return message; }, }; -const baseQueryDepositRequest: object = { proposal_id: 0, depositor: "" }; +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { proposalId: 0, depositor: "" }; +} export const QueryDepositRequest = { - encode( - message: QueryDepositRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { writer.uint32(18).string(message.depositor); @@ -964,15 +756,15 @@ export const QueryDepositRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; + const message = createBaseQueryDepositRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.depositor = reader.string(); @@ -986,61 +778,43 @@ export const QueryDepositRequest = { }, fromJSON(object: any): QueryDepositRequest { - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + }; }, toJSON(message: QueryDepositRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, - fromPartial(object: DeepPartial): QueryDepositRequest { - const message = { ...baseQueryDepositRequest } as QueryDepositRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } + fromPartial, I>>(object: I): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; return message; }, }; -const baseQueryDepositResponse: object = {}; +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { deposit: undefined }; +} export const QueryDepositResponse = { - encode( - message: QueryDepositResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; + const message = createBaseQueryDepositResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1056,44 +830,32 @@ export const QueryDepositResponse = { }, fromJSON(object: any): QueryDepositResponse { - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromJSON(object.deposit); - } else { - message.deposit = undefined; - } - return message; + return { deposit: isSet(object.deposit) ? Deposit.fromJSON(object.deposit) : undefined }; }, toJSON(message: QueryDepositResponse): unknown { const obj: any = {}; - message.deposit !== undefined && - (obj.deposit = message.deposit - ? Deposit.toJSON(message.deposit) - : undefined); + message.deposit !== undefined && (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryDepositResponse { - const message = { ...baseQueryDepositResponse } as QueryDepositResponse; - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromPartial(object.deposit); - } else { - message.deposit = undefined; - } + fromPartial, I>>(object: I): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + message.deposit = (object.deposit !== undefined && object.deposit !== null) + ? Deposit.fromPartial(object.deposit) + : undefined; return message; }, }; -const baseQueryDepositsRequest: object = { proposal_id: 0 }; +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { proposalId: 0, pagination: undefined }; +} export const QueryDepositsRequest = { - encode( - message: QueryDepositsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1101,15 +863,15 @@ export const QueryDepositsRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; + const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1123,71 +885,49 @@ export const QueryDepositsRequest = { }, fromJSON(object: any): QueryDepositsRequest { - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDepositsRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryDepositsRequest { - const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.proposalId = object.proposalId ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDepositsResponse: object = {}; +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { deposits: [], pagination: undefined }; +} export const QueryDepositsResponse = { - encode( - message: QueryDepositsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; + const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1206,80 +946,55 @@ export const QueryDepositsResponse = { }, fromJSON(object: any): QueryDepositsResponse { - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDepositsResponse): unknown { const obj: any = {}; if (message.deposits) { - obj.deposits = message.deposits.map((e) => - e ? Deposit.toJSON(e) : undefined - ); + obj.deposits = message.deposits.map((e) => e ? Deposit.toJSON(e) : undefined); } else { obj.deposits = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDepositsResponse { - const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; - message.deposits = []; - if (object.deposits !== undefined && object.deposits !== null) { - for (const e of object.deposits) { - message.deposits.push(Deposit.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryTallyResultRequest: object = { proposal_id: 0 }; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { proposalId: 0 }; +} export const QueryTallyResultRequest = { - encode( - message: QueryTallyResultRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; + const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -1290,61 +1005,38 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); return obj; }, - fromPartial( - object: DeepPartial - ): QueryTallyResultRequest { - const message = { - ...baseQueryTallyResultRequest, - } as QueryTallyResultRequest; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } + fromPartial, I>>(object: I): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId ?? 0; return message; }, }; -const baseQueryTallyResultResponse: object = {}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { tally: undefined }; +} export const QueryTallyResultResponse = { - encode( - message: QueryTallyResultResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryTallyResultResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; + const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1360,37 +1052,20 @@ export const QueryTallyResultResponse = { }, fromJSON(object: any): QueryTallyResultResponse { - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromJSON(object.tally); - } else { - message.tally = undefined; - } - return message; + return { tally: isSet(object.tally) ? TallyResult.fromJSON(object.tally) : undefined }; }, toJSON(message: QueryTallyResultResponse): unknown { const obj: any = {}; - message.tally !== undefined && - (obj.tally = message.tally - ? TallyResult.toJSON(message.tally) - : undefined); + message.tally !== undefined && (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryTallyResultResponse { - const message = { - ...baseQueryTallyResultResponse, - } as QueryTallyResultResponse; - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromPartial(object.tally); - } else { - message.tally = undefined; - } + fromPartial, I>>(object: I): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = (object.tally !== undefined && object.tally !== null) + ? TallyResult.fromPartial(object.tally) + : undefined; return message; }, }; @@ -1412,130 +1087,105 @@ export interface Query { /** Deposits queries all deposits of a single proposal. */ Deposits(request: QueryDepositsRequest): Promise; /** TallyResult queries the tally of a proposal vote. */ - TallyResult( - request: QueryTallyResultRequest - ): Promise; + TallyResult(request: QueryTallyResultRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Proposal = this.Proposal.bind(this); + this.Proposals = this.Proposals.bind(this); + this.Vote = this.Vote.bind(this); + this.Votes = this.Votes.bind(this); + this.Params = this.Params.bind(this); + this.Deposit = this.Deposit.bind(this); + this.Deposits = this.Deposits.bind(this); + this.TallyResult = this.TallyResult.bind(this); } Proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Proposal", - data - ); - return promise.then((data) => - QueryProposalResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); + return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); } Proposals(request: QueryProposalsRequest): Promise { const data = QueryProposalsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Proposals", - data - ); - return promise.then((data) => - QueryProposalsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); + return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); } Vote(request: QueryVoteRequest): Promise { const data = QueryVoteRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); - return promise.then((data) => QueryVoteResponse.decode(new Reader(data))); + return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); } Votes(request: QueryVotesRequest): Promise { const data = QueryVotesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); - return promise.then((data) => QueryVotesResponse.decode(new Reader(data))); + return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } Deposit(request: QueryDepositRequest): Promise { const data = QueryDepositRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Deposit", - data - ); - return promise.then((data) => - QueryDepositResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); + return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); } Deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "Deposits", - data - ); - return promise.then((data) => - QueryDepositsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); + return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); } - TallyResult( - request: QueryTallyResultRequest - ): Promise { + TallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Query", - "TallyResult", - data - ); - return promise.then((data) => - QueryTallyResultResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); + return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1543,7 +1193,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts index a52478ec87..29b3617007 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts @@ -1,15 +1,10 @@ //@ts-nocheck /* eslint-disable */ -import { - VoteOption, - WeightedVoteOption, - voteOptionFromJSON, - voteOptionToJSON, -} from "../../../cosmos/gov/v1beta1/gov"; -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Coin } from "../../base/v1beta1/coin"; +import { VoteOption, voteOptionFromJSON, voteOptionToJSON, WeightedVoteOption } from "./gov"; export const protobufPackage = "cosmos.gov.v1beta1"; @@ -18,25 +13,35 @@ export const protobufPackage = "cosmos.gov.v1beta1"; * proposal Content. */ export interface MsgSubmitProposal { - content: Any | undefined; - initial_deposit: Coin[]; + /** content is the proposal's content. */ + content: + | Any + | undefined; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ proposer: string; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address for the proposal. */ voter: string; + /** option defines the vote option. */ option: VoteOption; } /** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponse {} +export interface MsgVoteResponse { +} /** * MsgVoteWeighted defines a message to cast a vote. @@ -44,8 +49,11 @@ export interface MsgVoteResponse {} * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** voter is the voter address for the proposal. */ voter: string; + /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } @@ -54,26 +62,33 @@ export interface MsgVoteWeighted { * * Since: cosmos-sdk 0.43 */ -export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponse { +} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { - proposal_id: number; + /** proposal_id defines the unique id of the proposal. */ + proposalId: number; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } /** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponse {} +export interface MsgDepositResponse { +} -const baseMsgSubmitProposal: object = { proposer: "" }; +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { content: undefined, initialDeposit: [], proposer: "" }; +} export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: Writer = Writer.create()): Writer { + encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.content !== undefined) { Any.encode(message.content, writer.uint32(10).fork()).ldelim(); } - for (const v of message.initial_deposit) { + for (const v of message.initialDeposit) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.proposer !== "") { @@ -82,11 +97,10 @@ export const MsgSubmitProposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; + const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -94,7 +108,7 @@ export const MsgSubmitProposal = { message.content = Any.decode(reader, reader.uint32()); break; case 2: - message.initial_deposit.push(Coin.decode(reader, reader.uint32())); + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); break; case 3: message.proposer = reader.string(); @@ -108,96 +122,59 @@ export const MsgSubmitProposal = { }, fromJSON(object: any): MsgSubmitProposal { - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromJSON(object.content); - } else { - message.content = undefined; - } - if ( - object.initial_deposit !== undefined && - object.initial_deposit !== null - ) { - for (const e of object.initial_deposit) { - message.initial_deposit.push(Coin.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = String(object.proposer); - } else { - message.proposer = ""; - } - return message; + return { + content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, + initialDeposit: Array.isArray(object?.initialDeposit) + ? object.initialDeposit.map((e: any) => Coin.fromJSON(e)) + : [], + proposer: isSet(object.proposer) ? String(object.proposer) : "", + }; }, toJSON(message: MsgSubmitProposal): unknown { const obj: any = {}; - message.content !== undefined && - (obj.content = message.content ? Any.toJSON(message.content) : undefined); - if (message.initial_deposit) { - obj.initial_deposit = message.initial_deposit.map((e) => - e ? Coin.toJSON(e) : undefined - ); + message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); + if (message.initialDeposit) { + obj.initialDeposit = message.initialDeposit.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.initial_deposit = []; + obj.initialDeposit = []; } message.proposer !== undefined && (obj.proposer = message.proposer); return obj; }, - fromPartial(object: DeepPartial): MsgSubmitProposal { - const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; - message.initial_deposit = []; - if (object.content !== undefined && object.content !== null) { - message.content = Any.fromPartial(object.content); - } else { - message.content = undefined; - } - if ( - object.initial_deposit !== undefined && - object.initial_deposit !== null - ) { - for (const e of object.initial_deposit) { - message.initial_deposit.push(Coin.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } else { - message.proposer = ""; - } + fromPartial, I>>(object: I): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.content = (object.content !== undefined && object.content !== null) + ? Any.fromPartial(object.content) + : undefined; + message.initialDeposit = object.initialDeposit?.map((e) => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; return message; }, }; -const baseMsgSubmitProposalResponse: object = { proposal_id: 0 }; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { proposalId: 0 }; +} export const MsgSubmitProposalResponse = { - encode( - message: MsgSubmitProposalResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSubmitProposalResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; + const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -208,45 +185,30 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - return message; + return { proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0 }; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); return obj; }, - fromPartial( - object: DeepPartial - ): MsgSubmitProposalResponse { - const message = { - ...baseMsgSubmitProposalResponse, - } as MsgSubmitProposalResponse; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } + fromPartial, I>>(object: I): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId ?? 0; return message; }, }; -const baseMsgVote: object = { proposal_id: 0, voter: "", option: 0 }; +function createBaseMsgVote(): MsgVote { + return { proposalId: 0, voter: "", option: 0 }; +} export const MsgVote = { - encode(message: MsgVote, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); @@ -257,15 +219,15 @@ export const MsgVote = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVote } as MsgVote; + const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.voter = reader.string(); @@ -282,67 +244,43 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { - const message = { ...baseMsgVote } as MsgVote; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = voteOptionFromJSON(object.option); - } else { - message.option = 0; - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + }; }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.voter !== undefined && (obj.voter = message.voter); - message.option !== undefined && - (obj.option = voteOptionToJSON(message.option)); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); return obj; }, - fromPartial(object: DeepPartial): MsgVote { - const message = { ...baseMsgVote } as MsgVote; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } else { - message.option = 0; - } + fromPartial, I>>(object: I): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; return message; }, }; -const baseMsgVoteResponse: object = {}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; + const message = createBaseMsgVoteResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -355,8 +293,7 @@ export const MsgVoteResponse = { }, fromJSON(_: any): MsgVoteResponse { - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; - return message; + return {}; }, toJSON(_: MsgVoteResponse): unknown { @@ -364,18 +301,20 @@ export const MsgVoteResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgVoteResponse { - const message = { ...baseMsgVoteResponse } as MsgVoteResponse; + fromPartial, I>>(_: I): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); return message; }, }; -const baseMsgVoteWeighted: object = { proposal_id: 0, voter: "" }; +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { proposalId: 0, voter: "", options: [] }; +} export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); @@ -386,24 +325,21 @@ export const MsgVoteWeighted = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; + const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.voter = reader.string(); break; case 3: - message.options.push( - WeightedVoteOption.decode(reader, reader.uint32()) - ); + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -414,76 +350,47 @@ export const MsgVoteWeighted = { }, fromJSON(object: any): MsgVoteWeighted { - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = String(object.voter); - } else { - message.voter = ""; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromJSON(e)); - } - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + voter: isSet(object.voter) ? String(object.voter) : "", + options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [], + }; }, toJSON(message: MsgVoteWeighted): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { - obj.options = message.options.map((e) => - e ? WeightedVoteOption.toJSON(e) : undefined - ); + obj.options = message.options.map((e) => e ? WeightedVoteOption.toJSON(e) : undefined); } else { obj.options = []; } return obj; }, - fromPartial(object: DeepPartial): MsgVoteWeighted { - const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; - message.options = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } else { - message.voter = ""; - } - if (object.options !== undefined && object.options !== null) { - for (const e of object.options) { - message.options.push(WeightedVoteOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId ?? 0; + message.voter = object.voter ?? ""; + message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; return message; }, }; -const baseMsgVoteWeightedResponse: object = {}; +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; + const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -496,10 +403,7 @@ export const MsgVoteWeightedResponse = { }, fromJSON(_: any): MsgVoteWeightedResponse { - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; - return message; + return {}; }, toJSON(_: MsgVoteWeightedResponse): unknown { @@ -507,22 +411,20 @@ export const MsgVoteWeightedResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgVoteWeightedResponse { - const message = { - ...baseMsgVoteWeightedResponse, - } as MsgVoteWeightedResponse; + fromPartial, I>>(_: I): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); return message; }, }; -const baseMsgDeposit: object = { proposal_id: 0, depositor: "" }; +function createBaseMsgDeposit(): MsgDeposit { + return { proposalId: 0, depositor: "", amount: [] }; +} export const MsgDeposit = { - encode(message: MsgDeposit, writer: Writer = Writer.create()): Writer { - if (message.proposal_id !== 0) { - writer.uint32(8).uint64(message.proposal_id); + encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalId !== 0) { + writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { writer.uint32(18).string(message.depositor); @@ -533,16 +435,15 @@ export const MsgDeposit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; + const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposal_id = longToNumber(reader.uint64() as Long); + message.proposalId = longToNumber(reader.uint64() as Long); break; case 2: message.depositor = reader.string(); @@ -559,72 +460,47 @@ export const MsgDeposit = { }, fromJSON(object: any): MsgDeposit { - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = Number(object.proposal_id); - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = String(object.depositor); - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; + return { + proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, + depositor: isSet(object.depositor) ? String(object.depositor) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: MsgDeposit): unknown { const obj: any = {}; - message.proposal_id !== undefined && - (obj.proposal_id = message.proposal_id); + message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } return obj; }, - fromPartial(object: DeepPartial): MsgDeposit { - const message = { ...baseMsgDeposit } as MsgDeposit; - message.amount = []; - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposal_id = object.proposal_id; - } else { - message.proposal_id = 0; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } else { - message.depositor = ""; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): MsgDeposit { + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId ?? 0; + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseMsgDepositResponse: object = {}; +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; + const message = createBaseMsgDepositResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -637,8 +513,7 @@ export const MsgDepositResponse = { }, fromJSON(_: any): MsgDepositResponse { - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; - return message; + return {}; }, toJSON(_: MsgDepositResponse): unknown { @@ -646,8 +521,8 @@ export const MsgDepositResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgDepositResponse { - const message = { ...baseMsgDepositResponse } as MsgDepositResponse; + fromPartial, I>>(_: I): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); return message; }, }; @@ -655,9 +530,7 @@ export const MsgDepositResponse = { /** Msg defines the bank Msg service. */ export interface Msg { /** SubmitProposal defines a method to create new proposal given a content. */ - SubmitProposal( - request: MsgSubmitProposal - ): Promise; + SubmitProposal(request: MsgSubmitProposal): Promise; /** Vote defines a method to add a vote on a specific proposal. */ Vote(request: MsgVote): Promise; /** @@ -674,75 +547,70 @@ export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.SubmitProposal = this.SubmitProposal.bind(this); + this.Vote = this.Vote.bind(this); + this.VoteWeighted = this.VoteWeighted.bind(this); + this.Deposit = this.Deposit.bind(this); } - SubmitProposal( - request: MsgSubmitProposal - ): Promise { + SubmitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Msg", - "SubmitProposal", - data - ); - return promise.then((data) => - MsgSubmitProposalResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); + return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); } Vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new Reader(data))); + return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); } VoteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.gov.v1beta1.Msg", - "VoteWeighted", - data - ); - return promise.then((data) => - MsgVoteWeightedResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); + return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); } Deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); - return promise.then((data) => MsgDepositResponse.decode(new Reader(data))); + return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -750,7 +618,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/duration.ts index 0cb51f5a90..01ce7b0bf9 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/duration.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/duration.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -83,10 +83,12 @@ export interface Duration { nanos: number; } -const baseDuration: object = { seconds: 0, nanos: 0 }; +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -96,10 +98,10 @@ export const Duration = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDuration } as Duration; + const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,64 +120,57 @@ export const Duration = { }, fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -183,7 +178,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.gov.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/module.ts new file mode 100755 index 0000000000..3d9b4b2252 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/module.ts @@ -0,0 +1,101 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Minter as typeMinter} from "./types" +import { Params as typeParams} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Minter: getStructure(typeMinter.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosMintV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/rest.ts index d36c60ec60..8b6de706c4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/rest.ts @@ -10,6 +10,32 @@ * --------------------------------------------------------------- */ +/** + * Params defines the parameters for the x/mint module. + */ +export interface Mintv1Beta1Params { + /** type of coin to mint */ + mint_denom?: string; + + /** maximum annual change in inflation rate */ + inflation_rate_change?: string; + + /** maximum inflation rate */ + inflation_max?: string; + + /** minimum inflation rate */ + inflation_min?: string; + + /** goal of percent bonded atoms */ + goal_bonded?: string; + + /** + * expected blocks per year + * @format uint64 + */ + blocks_per_year?: string; +} + export interface ProtobufAny { "@type"?: string; } @@ -22,18 +48,12 @@ export interface RpcStatus { } /** - * Params holds parameters for the mint module. - */ -export interface V1Beta1Params { - mint_denom?: string; - inflation_rate_change?: string; - inflation_max?: string; - inflation_min?: string; - goal_bonded?: string; +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. - /** @format uint64 */ - blocks_per_year?: string; -} +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; /** * QueryAnnualProvisionsResponse is the response type for the @@ -64,13 +84,14 @@ export interface V1Beta1QueryInflationResponse { */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: V1Beta1Params; + params?: Mintv1Beta1Params; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -80,30 +101,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -111,149 +123,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types.ts new file mode 100755 index 0000000000..0ecc045c19 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { Minter } from "./types/cosmos/mint/v1beta1/mint" +import { Params } from "./types/cosmos/mint/v1beta1/mint" + + +export { + Minter, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts index 9cb479b69f..7fa0af11e1 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts @@ -1,22 +1,26 @@ //@ts-nocheck /* eslint-disable */ -import { Minter, Params } from "../../../cosmos/mint/v1beta1/mint"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Minter, Params } from "./mint"; export const protobufPackage = "cosmos.mint.v1beta1"; /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { /** minter is a space for holding current inflation information. */ - minter: Minter | undefined; - /** params defines all the paramaters of the module. */ + minter: + | Minter + | undefined; + /** params defines all the parameters of the module. */ params: Params | undefined; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { minter: undefined, params: undefined }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.minter !== undefined) { Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); } @@ -26,10 +30,10 @@ export const GenesisState = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -48,52 +52,42 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.minter !== undefined && object.minter !== null) { - message.minter = Minter.fromJSON(object.minter); - } else { - message.minter = undefined; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { + minter: isSet(object.minter) ? Minter.fromJSON(object.minter) : undefined, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.minter !== undefined && - (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.minter !== undefined && (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - if (object.minter !== undefined && object.minter !== null) { - message.minter = Minter.fromPartial(object.minter); - } else { - message.minter = undefined; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.minter = (object.minter !== undefined && object.minter !== null) + ? Minter.fromPartial(object.minter) + : undefined; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts index ea7763a3ad..3d6fa4781a 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.mint.v1beta1"; @@ -10,42 +10,44 @@ export interface Minter { /** current annual inflation rate */ inflation: string; /** current annual expected provisions */ - annual_provisions: string; + annualProvisions: string; } -/** Params holds parameters for the mint module. */ +/** Params defines the parameters for the x/mint module. */ export interface Params { /** type of coin to mint */ - mint_denom: string; + mintDenom: string; /** maximum annual change in inflation rate */ - inflation_rate_change: string; + inflationRateChange: string; /** maximum inflation rate */ - inflation_max: string; + inflationMax: string; /** minimum inflation rate */ - inflation_min: string; + inflationMin: string; /** goal of percent bonded atoms */ - goal_bonded: string; + goalBonded: string; /** expected blocks per year */ - blocks_per_year: number; + blocksPerYear: number; } -const baseMinter: object = { inflation: "", annual_provisions: "" }; +function createBaseMinter(): Minter { + return { inflation: "", annualProvisions: "" }; +} export const Minter = { - encode(message: Minter, writer: Writer = Writer.create()): Writer { + encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.inflation !== "") { writer.uint32(10).string(message.inflation); } - if (message.annual_provisions !== "") { - writer.uint32(18).string(message.annual_provisions); + if (message.annualProvisions !== "") { + writer.uint32(18).string(message.annualProvisions); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Minter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Minter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMinter } as Minter; + const message = createBaseMinter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -53,7 +55,7 @@ export const Minter = { message.inflation = reader.string(); break; case 2: - message.annual_provisions = reader.string(); + message.annualProvisions = reader.string(); break; default: reader.skipType(tag & 7); @@ -64,106 +66,85 @@ export const Minter = { }, fromJSON(object: any): Minter { - const message = { ...baseMinter } as Minter; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = String(object.inflation); - } else { - message.inflation = ""; - } - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = String(object.annual_provisions); - } else { - message.annual_provisions = ""; - } - return message; + return { + inflation: isSet(object.inflation) ? String(object.inflation) : "", + annualProvisions: isSet(object.annualProvisions) ? String(object.annualProvisions) : "", + }; }, toJSON(message: Minter): unknown { const obj: any = {}; message.inflation !== undefined && (obj.inflation = message.inflation); - message.annual_provisions !== undefined && - (obj.annual_provisions = message.annual_provisions); + message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); return obj; }, - fromPartial(object: DeepPartial): Minter { - const message = { ...baseMinter } as Minter; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = object.inflation; - } else { - message.inflation = ""; - } - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = object.annual_provisions; - } else { - message.annual_provisions = ""; - } + fromPartial, I>>(object: I): Minter { + const message = createBaseMinter(); + message.inflation = object.inflation ?? ""; + message.annualProvisions = object.annualProvisions ?? ""; return message; }, }; -const baseParams: object = { - mint_denom: "", - inflation_rate_change: "", - inflation_max: "", - inflation_min: "", - goal_bonded: "", - blocks_per_year: 0, -}; +function createBaseParams(): Params { + return { + mintDenom: "", + inflationRateChange: "", + inflationMax: "", + inflationMin: "", + goalBonded: "", + blocksPerYear: 0, + }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.mint_denom !== "") { - writer.uint32(10).string(message.mint_denom); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mintDenom !== "") { + writer.uint32(10).string(message.mintDenom); } - if (message.inflation_rate_change !== "") { - writer.uint32(18).string(message.inflation_rate_change); + if (message.inflationRateChange !== "") { + writer.uint32(18).string(message.inflationRateChange); } - if (message.inflation_max !== "") { - writer.uint32(26).string(message.inflation_max); + if (message.inflationMax !== "") { + writer.uint32(26).string(message.inflationMax); } - if (message.inflation_min !== "") { - writer.uint32(34).string(message.inflation_min); + if (message.inflationMin !== "") { + writer.uint32(34).string(message.inflationMin); } - if (message.goal_bonded !== "") { - writer.uint32(42).string(message.goal_bonded); + if (message.goalBonded !== "") { + writer.uint32(42).string(message.goalBonded); } - if (message.blocks_per_year !== 0) { - writer.uint32(48).uint64(message.blocks_per_year); + if (message.blocksPerYear !== 0) { + writer.uint32(48).uint64(message.blocksPerYear); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mint_denom = reader.string(); + message.mintDenom = reader.string(); break; case 2: - message.inflation_rate_change = reader.string(); + message.inflationRateChange = reader.string(); break; case 3: - message.inflation_max = reader.string(); + message.inflationMax = reader.string(); break; case 4: - message.inflation_min = reader.string(); + message.inflationMin = reader.string(); break; case 5: - message.goal_bonded = reader.string(); + message.goalBonded = reader.string(); break; case 6: - message.blocks_per_year = longToNumber(reader.uint64() as Long); + message.blocksPerYear = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -174,125 +155,69 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.mint_denom !== undefined && object.mint_denom !== null) { - message.mint_denom = String(object.mint_denom); - } else { - message.mint_denom = ""; - } - if ( - object.inflation_rate_change !== undefined && - object.inflation_rate_change !== null - ) { - message.inflation_rate_change = String(object.inflation_rate_change); - } else { - message.inflation_rate_change = ""; - } - if (object.inflation_max !== undefined && object.inflation_max !== null) { - message.inflation_max = String(object.inflation_max); - } else { - message.inflation_max = ""; - } - if (object.inflation_min !== undefined && object.inflation_min !== null) { - message.inflation_min = String(object.inflation_min); - } else { - message.inflation_min = ""; - } - if (object.goal_bonded !== undefined && object.goal_bonded !== null) { - message.goal_bonded = String(object.goal_bonded); - } else { - message.goal_bonded = ""; - } - if ( - object.blocks_per_year !== undefined && - object.blocks_per_year !== null - ) { - message.blocks_per_year = Number(object.blocks_per_year); - } else { - message.blocks_per_year = 0; - } - return message; + return { + mintDenom: isSet(object.mintDenom) ? String(object.mintDenom) : "", + inflationRateChange: isSet(object.inflationRateChange) ? String(object.inflationRateChange) : "", + inflationMax: isSet(object.inflationMax) ? String(object.inflationMax) : "", + inflationMin: isSet(object.inflationMin) ? String(object.inflationMin) : "", + goalBonded: isSet(object.goalBonded) ? String(object.goalBonded) : "", + blocksPerYear: isSet(object.blocksPerYear) ? Number(object.blocksPerYear) : 0, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.mint_denom !== undefined && (obj.mint_denom = message.mint_denom); - message.inflation_rate_change !== undefined && - (obj.inflation_rate_change = message.inflation_rate_change); - message.inflation_max !== undefined && - (obj.inflation_max = message.inflation_max); - message.inflation_min !== undefined && - (obj.inflation_min = message.inflation_min); - message.goal_bonded !== undefined && - (obj.goal_bonded = message.goal_bonded); - message.blocks_per_year !== undefined && - (obj.blocks_per_year = message.blocks_per_year); + message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); + message.inflationRateChange !== undefined && (obj.inflationRateChange = message.inflationRateChange); + message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); + message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); + message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); + message.blocksPerYear !== undefined && (obj.blocksPerYear = Math.round(message.blocksPerYear)); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.mint_denom !== undefined && object.mint_denom !== null) { - message.mint_denom = object.mint_denom; - } else { - message.mint_denom = ""; - } - if ( - object.inflation_rate_change !== undefined && - object.inflation_rate_change !== null - ) { - message.inflation_rate_change = object.inflation_rate_change; - } else { - message.inflation_rate_change = ""; - } - if (object.inflation_max !== undefined && object.inflation_max !== null) { - message.inflation_max = object.inflation_max; - } else { - message.inflation_max = ""; - } - if (object.inflation_min !== undefined && object.inflation_min !== null) { - message.inflation_min = object.inflation_min; - } else { - message.inflation_min = ""; - } - if (object.goal_bonded !== undefined && object.goal_bonded !== null) { - message.goal_bonded = object.goal_bonded; - } else { - message.goal_bonded = ""; - } - if ( - object.blocks_per_year !== undefined && - object.blocks_per_year !== null - ) { - message.blocks_per_year = object.blocks_per_year; - } else { - message.blocks_per_year = 0; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.mintDenom = object.mintDenom ?? ""; + message.inflationRateChange = object.inflationRateChange ?? ""; + message.inflationMax = object.inflationMax ?? ""; + message.inflationMin = object.inflationMin ?? ""; + message.goalBonded = object.goalBonded ?? ""; + message.blocksPerYear = object.blocksPerYear ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -300,7 +225,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/query.ts index 562bb072c0..4b9408a325 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/query.ts @@ -1,12 +1,13 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Params } from "../../../cosmos/mint/v1beta1/mint"; +import _m0 from "protobufjs/minimal"; +import { Params } from "./mint"; export const protobufPackage = "cosmos.mint.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -15,7 +16,8 @@ export interface QueryParamsResponse { } /** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ -export interface QueryInflationRequest {} +export interface QueryInflationRequest { +} /** * QueryInflationResponse is the response type for the Query/Inflation RPC @@ -30,7 +32,8 @@ export interface QueryInflationResponse { * QueryAnnualProvisionsRequest is the request type for the * Query/AnnualProvisions RPC method. */ -export interface QueryAnnualProvisionsRequest {} +export interface QueryAnnualProvisionsRequest { +} /** * QueryAnnualProvisionsResponse is the response type for the @@ -38,20 +41,22 @@ export interface QueryAnnualProvisionsRequest {} */ export interface QueryAnnualProvisionsResponse { /** annual_provisions is the current minting annual provisions value. */ - annual_provisions: Uint8Array; + annualProvisions: Uint8Array; } -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -64,8 +69,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -73,29 +77,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -111,44 +114,37 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -const baseQueryInflationRequest: object = {}; +function createBaseQueryInflationRequest(): QueryInflationRequest { + return {}; +} export const QueryInflationRequest = { - encode(_: QueryInflationRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryInflationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryInflationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; + const message = createBaseQueryInflationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -161,8 +157,7 @@ export const QueryInflationRequest = { }, fromJSON(_: any): QueryInflationRequest { - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; - return message; + return {}; }, toJSON(_: QueryInflationRequest): unknown { @@ -170,29 +165,28 @@ export const QueryInflationRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryInflationRequest { - const message = { ...baseQueryInflationRequest } as QueryInflationRequest; + fromPartial, I>>(_: I): QueryInflationRequest { + const message = createBaseQueryInflationRequest(); return message; }, }; -const baseQueryInflationResponse: object = {}; +function createBaseQueryInflationResponse(): QueryInflationResponse { + return { inflation: new Uint8Array() }; +} export const QueryInflationResponse = { - encode( - message: QueryInflationResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryInflationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.inflation.length !== 0) { writer.uint32(10).bytes(message.inflation); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryInflationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; + const message = createBaseQueryInflationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -208,54 +202,36 @@ export const QueryInflationResponse = { }, fromJSON(object: any): QueryInflationResponse { - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = bytesFromBase64(object.inflation); - } - return message; + return { inflation: isSet(object.inflation) ? bytesFromBase64(object.inflation) : new Uint8Array() }; }, toJSON(message: QueryInflationResponse): unknown { const obj: any = {}; - message.inflation !== undefined && - (obj.inflation = base64FromBytes( - message.inflation !== undefined ? message.inflation : new Uint8Array() - )); + message.inflation !== undefined + && (obj.inflation = base64FromBytes(message.inflation !== undefined ? message.inflation : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): QueryInflationResponse { - const message = { ...baseQueryInflationResponse } as QueryInflationResponse; - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = object.inflation; - } else { - message.inflation = new Uint8Array(); - } + fromPartial, I>>(object: I): QueryInflationResponse { + const message = createBaseQueryInflationResponse(); + message.inflation = object.inflation ?? new Uint8Array(); return message; }, }; -const baseQueryAnnualProvisionsRequest: object = {}; +function createBaseQueryAnnualProvisionsRequest(): QueryAnnualProvisionsRequest { + return {}; +} export const QueryAnnualProvisionsRequest = { - encode( - _: QueryAnnualProvisionsRequest, - writer: Writer = Writer.create() - ): Writer { + encode(_: QueryAnnualProvisionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAnnualProvisionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; + const message = createBaseQueryAnnualProvisionsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -268,10 +244,7 @@ export const QueryAnnualProvisionsRequest = { }, fromJSON(_: any): QueryAnnualProvisionsRequest { - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; - return message; + return {}; }, toJSON(_: QueryAnnualProvisionsRequest): unknown { @@ -279,43 +252,33 @@ export const QueryAnnualProvisionsRequest = { return obj; }, - fromPartial( - _: DeepPartial - ): QueryAnnualProvisionsRequest { - const message = { - ...baseQueryAnnualProvisionsRequest, - } as QueryAnnualProvisionsRequest; + fromPartial, I>>(_: I): QueryAnnualProvisionsRequest { + const message = createBaseQueryAnnualProvisionsRequest(); return message; }, }; -const baseQueryAnnualProvisionsResponse: object = {}; +function createBaseQueryAnnualProvisionsResponse(): QueryAnnualProvisionsResponse { + return { annualProvisions: new Uint8Array() }; +} export const QueryAnnualProvisionsResponse = { - encode( - message: QueryAnnualProvisionsResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.annual_provisions.length !== 0) { - writer.uint32(10).bytes(message.annual_provisions); + encode(message: QueryAnnualProvisionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.annualProvisions.length !== 0) { + writer.uint32(10).bytes(message.annualProvisions); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAnnualProvisionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; + const message = createBaseQueryAnnualProvisionsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.annual_provisions = reader.bytes(); + message.annualProvisions = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -326,43 +289,25 @@ export const QueryAnnualProvisionsResponse = { }, fromJSON(object: any): QueryAnnualProvisionsResponse { - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = bytesFromBase64(object.annual_provisions); - } - return message; + return { + annualProvisions: isSet(object.annualProvisions) ? bytesFromBase64(object.annualProvisions) : new Uint8Array(), + }; }, toJSON(message: QueryAnnualProvisionsResponse): unknown { const obj: any = {}; - message.annual_provisions !== undefined && - (obj.annual_provisions = base64FromBytes( - message.annual_provisions !== undefined - ? message.annual_provisions - : new Uint8Array() + message.annualProvisions !== undefined + && (obj.annualProvisions = base64FromBytes( + message.annualProvisions !== undefined ? message.annualProvisions : new Uint8Array(), )); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryAnnualProvisionsResponse { - const message = { - ...baseQueryAnnualProvisionsResponse, - } as QueryAnnualProvisionsResponse; - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annual_provisions = object.annual_provisions; - } else { - message.annual_provisions = new Uint8Array(); - } + const message = createBaseQueryAnnualProvisionsResponse(); + message.annualProvisions = object.annualProvisions ?? new Uint8Array(); return message; }, }; @@ -374,101 +319,95 @@ export interface Query { /** Inflation returns the current minting inflation value. */ Inflation(request: QueryInflationRequest): Promise; /** AnnualProvisions current minting annual provisions value. */ - AnnualProvisions( - request: QueryAnnualProvisionsRequest - ): Promise; + AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Params = this.Params.bind(this); + this.Inflation = this.Inflation.bind(this); + this.AnnualProvisions = this.AnnualProvisions.bind(this); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } Inflation(request: QueryInflationRequest): Promise { const data = QueryInflationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "Inflation", - data - ); - return promise.then((data) => - QueryInflationResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); + return promise.then((data) => QueryInflationResponse.decode(new _m0.Reader(data))); } - AnnualProvisions( - request: QueryAnnualProvisionsRequest - ): Promise { + AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise { const data = QueryAnnualProvisionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.mint.v1beta1.Query", - "AnnualProvisions", - data - ); - return promise.then((data) => - QueryAnnualProvisionsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); + return promise.then((data) => QueryAnnualProvisionsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/tx.ts new file mode 100644 index 0000000000..173387043f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/tx.ts @@ -0,0 +1,173 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Params } from "./mint"; + +export const protobufPackage = "cosmos.mint.v1beta1"; + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/mint parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +/** Msg defines the x/mint Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/mint module + * parameters. The authority is defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UpdateParams = this.UpdateParams.bind(this); + } + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.mint.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/module.ts new file mode 100755 index 0000000000..af781abd57 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/module.ts @@ -0,0 +1,109 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { EventSend as typeEventSend} from "./types" +import { EventMint as typeEventMint} from "./types" +import { EventBurn as typeEventBurn} from "./types" +import { Entry as typeEntry} from "./types" +import { Class as typeClass} from "./types" +import { NFT as typeNFT} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + EventSend: getStructure(typeEventSend.fromPartial({})), + EventMint: getStructure(typeEventMint.fromPartial({})), + EventBurn: getStructure(typeEventBurn.fromPartial({})), + Entry: getStructure(typeEntry.fromPartial({})), + Class: getStructure(typeClass.fromPartial({})), + NFT: getStructure(typeNFT.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosNftV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/rest.ts new file mode 100644 index 0000000000..f7afca0646 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/rest.ts @@ -0,0 +1,682 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Class defines the class of the nft type. + */ +export interface Nftv1Beta1Class { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id?: string; + + /** name defines the human-readable name of the NFT classification. Optional */ + name?: string; + + /** symbol is an abbreviated name for nft classification. Optional */ + symbol?: string; + + /** description is a brief description of nft classification. Optional */ + description?: string; + + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri?: string; + + /** uri_hash is a hash of the document pointed by uri. Optional */ + uri_hash?: string; + + /** + * data is the app specific metadata of the NFT class. Optional + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + data?: ProtobufAny; +} + +/** + * NFT defines the NFT. + */ +export interface Nftv1Beta1NFT { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + class_id?: string; + + /** id is a unique identifier of the NFT */ + id?: string; + + /** uri for the NFT metadata stored off chain */ + uri?: string; + + /** uri_hash is a hash of the document pointed by uri */ + uri_hash?: string; + + /** + * data is an app specific data of the NFT. Optional + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + data?: ProtobufAny; +} + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** + * MsgSendResponse defines the Msg/Send response type. + */ +export type V1Beta1MsgSendResponse = object; + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +export interface V1Beta1QueryBalanceResponse { + /** + * amount is the number of all NFTs of a given class owned by the owner + * @format uint64 + */ + amount?: string; +} + +export interface V1Beta1QueryClassResponse { + /** class defines the class of the nft type. */ + class?: Nftv1Beta1Class; +} + +export interface V1Beta1QueryClassesResponse { + /** class defines the class of the nft type. */ + classes?: Nftv1Beta1Class[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +export interface V1Beta1QueryNFTResponse { + /** + * owner is the owner address of the nft + * NFT defines the NFT. + */ + nft?: Nftv1Beta1NFT; +} + +export interface V1Beta1QueryNFTsResponse { + /** NFT defines the NFT */ + nfts?: Nftv1Beta1NFT[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +export interface V1Beta1QueryOwnerResponse { + /** owner is the owner address of the nft */ + owner?: string; +} + +export interface V1Beta1QuerySupplyResponse { + /** + * amount is the number of all NFTs from the given class + * @format uint64 + */ + amount?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title cosmos/nft/v1beta1/event.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryBalance + * @summary Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + * @request GET:/cosmos/nft/v1beta1/balance/{owner}/{class_id} + */ + queryBalance = (owner: string, classId: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/nft/v1beta1/balance/${owner}/${classId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryClasses + * @summary Classes queries all NFT classes + * @request GET:/cosmos/nft/v1beta1/classes + */ + queryClasses = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/nft/v1beta1/classes`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryClass + * @summary Class queries an NFT class based on its id + * @request GET:/cosmos/nft/v1beta1/classes/{class_id} + */ + queryClass = (classId: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/nft/v1beta1/classes/${classId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNfTs + * @summary NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in +ERC721Enumerable + * @request GET:/cosmos/nft/v1beta1/nfts + */ + queryNFTs = ( + query?: { + class_id?: string; + owner?: string; + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/cosmos/nft/v1beta1/nfts`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNft + * @summary NFT queries an NFT based on its class and id. + * @request GET:/cosmos/nft/v1beta1/nfts/{class_id}/{id} + */ + queryNFT = (classId: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/nft/v1beta1/nfts/${classId}/${id}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryOwner + * @summary Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + * @request GET:/cosmos/nft/v1beta1/owner/{class_id}/{id} + */ + queryOwner = (classId: string, id: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/nft/v1beta1/owner/${classId}/${id}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QuerySupply + * @summary Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. + * @request GET:/cosmos/nft/v1beta1/supply/{class_id} + */ + querySupply = (classId: string, params: RequestParams = {}) => + this.request({ + path: `/cosmos/nft/v1beta1/supply/${classId}`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types.ts new file mode 100755 index 0000000000..8692417f52 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types.ts @@ -0,0 +1,18 @@ +//@ts-nocheck +import { EventSend } from "./types/cosmos/nft/v1beta1/event" +import { EventMint } from "./types/cosmos/nft/v1beta1/event" +import { EventBurn } from "./types/cosmos/nft/v1beta1/event" +import { Entry } from "./types/cosmos/nft/v1beta1/genesis" +import { Class } from "./types/cosmos/nft/v1beta1/nft" +import { NFT } from "./types/cosmos/nft/v1beta1/nft" + + +export { + EventSend, + EventMint, + EventBurn, + Entry, + Class, + NFT, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/event.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/event.ts new file mode 100644 index 0000000000..93a9ed0a24 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/event.ts @@ -0,0 +1,262 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.nft.v1beta1"; + +/** EventSend is emitted on Msg/Send */ +export interface EventSend { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} + +/** EventMint is emitted on Mint */ +export interface EventMint { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** owner is the owner address of the nft */ + owner: string; +} + +/** EventBurn is emitted on Burn */ +export interface EventBurn { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** owner is the owner address of the nft */ + owner: string; +} + +function createBaseEventSend(): EventSend { + return { classId: "", id: "", sender: "", receiver: "" }; +} + +export const EventSend = { + encode(message: EventSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventSend { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + sender: isSet(object.sender) ? String(object.sender) : "", + receiver: isSet(object.receiver) ? String(object.receiver) : "", + }; + }, + + toJSON(message: EventSend): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + return obj; + }, + + fromPartial, I>>(object: I): EventSend { + const message = createBaseEventSend(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + return message; + }, +}; + +function createBaseEventMint(): EventMint { + return { classId: "", id: "", owner: "" }; +} + +export const EventMint = { + encode(message: EventMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventMint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventMint { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + owner: isSet(object.owner) ? String(object.owner) : "", + }; + }, + + toJSON(message: EventMint): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, + + fromPartial, I>>(object: I): EventMint { + const message = createBaseEventMint(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.owner = object.owner ?? ""; + return message; + }, +}; + +function createBaseEventBurn(): EventBurn { + return { classId: "", id: "", owner: "" }; +} + +export const EventBurn = { + encode(message: EventBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventBurn { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventBurn { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + owner: isSet(object.owner) ? String(object.owner) : "", + }; + }, + + toJSON(message: EventBurn): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, + + fromPartial, I>>(object: I): EventBurn { + const message = createBaseEventBurn(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.owner = object.owner ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/genesis.ts new file mode 100644 index 0000000000..853639fd94 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/genesis.ts @@ -0,0 +1,165 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Class, NFT } from "./nft"; + +export const protobufPackage = "cosmos.nft.v1beta1"; + +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisState { + /** class defines the class of the nft type. */ + classes: Class[]; + /** entry defines all nft owned by a person. */ + entries: Entry[]; +} + +/** Entry Defines all nft owned by a person */ +export interface Entry { + /** owner is the owner address of the following nft */ + owner: string; + /** nfts is a group of nfts of the same owner */ + nfts: NFT[]; +} + +function createBaseGenesisState(): GenesisState { + return { classes: [], entries: [] }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.classes) { + Class.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + Entry.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classes.push(Class.decode(reader, reader.uint32())); + break; + case 2: + message.entries.push(Entry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => Class.fromJSON(e)) : [], + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => Entry.fromJSON(e)) : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.classes) { + obj.classes = message.classes.map((e) => e ? Class.toJSON(e) : undefined); + } else { + obj.classes = []; + } + if (message.entries) { + obj.entries = message.entries.map((e) => e ? Entry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.classes = object.classes?.map((e) => Class.fromPartial(e)) || []; + message.entries = object.entries?.map((e) => Entry.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEntry(): Entry { + return { owner: "", nfts: [] }; +} + +export const Entry = { + encode(message: Entry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + for (const v of message.nfts) { + NFT.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Entry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.nfts.push(NFT.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Entry { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + nfts: Array.isArray(object?.nfts) ? object.nfts.map((e: any) => NFT.fromJSON(e)) : [], + }; + }, + + toJSON(message: Entry): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + if (message.nfts) { + obj.nfts = message.nfts.map((e) => e ? NFT.toJSON(e) : undefined); + } else { + obj.nfts = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Entry { + const message = createBaseEntry(); + message.owner = object.owner ?? ""; + message.nfts = object.nfts?.map((e) => NFT.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/nft.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/nft.ts new file mode 100644 index 0000000000..862ff60be3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/nft.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.nft.v1beta1"; + +/** Class defines the class of the nft type. */ +export interface Class { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id: string; + /** name defines the human-readable name of the NFT classification. Optional */ + name: string; + /** symbol is an abbreviated name for nft classification. Optional */ + symbol: string; + /** description is a brief description of nft classification. Optional */ + description: string; + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri: string; + /** uri_hash is a hash of the document pointed by uri. Optional */ + uriHash: string; + /** data is the app specific metadata of the NFT class. Optional */ + data: Any | undefined; +} + +/** NFT defines the NFT. */ +export interface NFT { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; + /** uri for the NFT metadata stored off chain */ + uri: string; + /** uri_hash is a hash of the document pointed by uri */ + uriHash: string; + /** data is an app specific data of the NFT. Optional */ + data: Any | undefined; +} + +function createBaseClass(): Class { + return { id: "", name: "", symbol: "", description: "", uri: "", uriHash: "", data: undefined }; +} + +export const Class = { + encode(message: Class, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(26).string(message.symbol); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.uri !== "") { + writer.uint32(42).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(50).string(message.uriHash); + } + if (message.data !== undefined) { + Any.encode(message.data, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Class { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClass(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.symbol = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.uri = reader.string(); + break; + case 6: + message.uriHash = reader.string(); + break; + case 7: + message.data = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Class { + return { + id: isSet(object.id) ? String(object.id) : "", + name: isSet(object.name) ? String(object.name) : "", + symbol: isSet(object.symbol) ? String(object.symbol) : "", + description: isSet(object.description) ? String(object.description) : "", + uri: isSet(object.uri) ? String(object.uri) : "", + uriHash: isSet(object.uriHash) ? String(object.uriHash) : "", + data: isSet(object.data) ? Any.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: Class): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.symbol !== undefined && (obj.symbol = message.symbol); + message.description !== undefined && (obj.description = message.description); + message.uri !== undefined && (obj.uri = message.uri); + message.uriHash !== undefined && (obj.uriHash = message.uriHash); + message.data !== undefined && (obj.data = message.data ? Any.toJSON(message.data) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Class { + const message = createBaseClass(); + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.description = object.description ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = (object.data !== undefined && object.data !== null) ? Any.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseNFT(): NFT { + return { classId: "", id: "", uri: "", uriHash: "", data: undefined }; +} + +export const NFT = { + encode(message: NFT, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.uri !== "") { + writer.uint32(26).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(34).string(message.uriHash); + } + if (message.data !== undefined) { + Any.encode(message.data, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NFT { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.uri = reader.string(); + break; + case 4: + message.uriHash = reader.string(); + break; + case 10: + message.data = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NFT { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + uri: isSet(object.uri) ? String(object.uri) : "", + uriHash: isSet(object.uriHash) ? String(object.uriHash) : "", + data: isSet(object.data) ? Any.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: NFT): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + message.uri !== undefined && (obj.uri = message.uri); + message.uriHash !== undefined && (obj.uriHash = message.uriHash); + message.data !== undefined && (obj.data = message.data ? Any.toJSON(message.data) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): NFT { + const message = createBaseNFT(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = (object.data !== undefined && object.data !== null) ? Any.fromPartial(object.data) : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/query.ts new file mode 100644 index 0000000000..fae3200c09 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/query.ts @@ -0,0 +1,985 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Class, NFT } from "./nft"; + +export const protobufPackage = "cosmos.nft.v1beta1"; + +/** QueryBalanceRequest is the request type for the Query/Balance RPC method */ +export interface QueryBalanceRequest { + /** class_id associated with the nft */ + classId: string; + /** owner is the owner address of the nft */ + owner: string; +} + +/** QueryBalanceResponse is the response type for the Query/Balance RPC method */ +export interface QueryBalanceResponse { + /** amount is the number of all NFTs of a given class owned by the owner */ + amount: number; +} + +/** QueryOwnerRequest is the request type for the Query/Owner RPC method */ +export interface QueryOwnerRequest { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; +} + +/** QueryOwnerResponse is the response type for the Query/Owner RPC method */ +export interface QueryOwnerResponse { + /** owner is the owner address of the nft */ + owner: string; +} + +/** QuerySupplyRequest is the request type for the Query/Supply RPC method */ +export interface QuerySupplyRequest { + /** class_id associated with the nft */ + classId: string; +} + +/** QuerySupplyResponse is the response type for the Query/Supply RPC method */ +export interface QuerySupplyResponse { + /** amount is the number of all NFTs from the given class */ + amount: number; +} + +/** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ +export interface QueryNFTsRequest { + /** class_id associated with the nft */ + classId: string; + /** owner is the owner address of the nft */ + owner: string; + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ +export interface QueryNFTsResponse { + /** NFT defines the NFT */ + nfts: NFT[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** QueryNFTRequest is the request type for the Query/NFT RPC method */ +export interface QueryNFTRequest { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; +} + +/** QueryNFTResponse is the response type for the Query/NFT RPC method */ +export interface QueryNFTResponse { + /** owner is the owner address of the nft */ + nft: NFT | undefined; +} + +/** QueryClassRequest is the request type for the Query/Class RPC method */ +export interface QueryClassRequest { + /** class_id associated with the nft */ + classId: string; +} + +/** QueryClassResponse is the response type for the Query/Class RPC method */ +export interface QueryClassResponse { + /** class defines the class of the nft type. */ + class: Class | undefined; +} + +/** QueryClassesRequest is the request type for the Query/Classes RPC method */ +export interface QueryClassesRequest { + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** QueryClassesResponse is the response type for the Query/Classes RPC method */ +export interface QueryClassesResponse { + /** class defines the class of the nft type. */ + classes: Class[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { classId: "", owner: "" }; +} + +export const QueryBalanceRequest = { + encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryBalanceRequest { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + owner: isSet(object.owner) ? String(object.owner) : "", + }; + }, + + toJSON(message: QueryBalanceRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, + + fromPartial, I>>(object: I): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.classId = object.classId ?? ""; + message.owner = object.owner ?? ""; + return message; + }, +}; + +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { amount: 0 }; +} + +export const QueryBalanceResponse = { + encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.amount !== 0) { + writer.uint32(8).uint64(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryBalanceResponse { + return { amount: isSet(object.amount) ? Number(object.amount) : 0 }; + }, + + toJSON(message: QueryBalanceResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = Math.round(message.amount)); + return obj; + }, + + fromPartial, I>>(object: I): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.amount = object.amount ?? 0; + return message; + }, +}; + +function createBaseQueryOwnerRequest(): QueryOwnerRequest { + return { classId: "", id: "" }; +} + +export const QueryOwnerRequest = { + encode(message: QueryOwnerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryOwnerRequest { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + }; + }, + + toJSON(message: QueryOwnerRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>(object: I): QueryOwnerRequest { + const message = createBaseQueryOwnerRequest(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseQueryOwnerResponse(): QueryOwnerResponse { + return { owner: "" }; +} + +export const QueryOwnerResponse = { + encode(message: QueryOwnerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryOwnerResponse { + return { owner: isSet(object.owner) ? String(object.owner) : "" }; + }, + + toJSON(message: QueryOwnerResponse): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, + + fromPartial, I>>(object: I): QueryOwnerResponse { + const message = createBaseQueryOwnerResponse(); + message.owner = object.owner ?? ""; + return message; + }, +}; + +function createBaseQuerySupplyRequest(): QuerySupplyRequest { + return { classId: "" }; +} + +export const QuerySupplyRequest = { + encode(message: QuerySupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySupplyRequest { + return { classId: isSet(object.classId) ? String(object.classId) : "" }; + }, + + toJSON(message: QuerySupplyRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + return obj; + }, + + fromPartial, I>>(object: I): QuerySupplyRequest { + const message = createBaseQuerySupplyRequest(); + message.classId = object.classId ?? ""; + return message; + }, +}; + +function createBaseQuerySupplyResponse(): QuerySupplyResponse { + return { amount: 0 }; +} + +export const QuerySupplyResponse = { + encode(message: QuerySupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.amount !== 0) { + writer.uint32(8).uint64(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySupplyResponse { + return { amount: isSet(object.amount) ? Number(object.amount) : 0 }; + }, + + toJSON(message: QuerySupplyResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = Math.round(message.amount)); + return obj; + }, + + fromPartial, I>>(object: I): QuerySupplyResponse { + const message = createBaseQuerySupplyResponse(); + message.amount = object.amount ?? 0; + return message; + }, +}; + +function createBaseQueryNFTsRequest(): QueryNFTsRequest { + return { classId: "", owner: "", pagination: undefined }; +} + +export const QueryNFTsRequest = { + encode(message: QueryNFTsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNFTsRequest { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + owner: isSet(object.owner) ? String(object.owner) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryNFTsRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.owner !== undefined && (obj.owner = message.owner); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryNFTsRequest { + const message = createBaseQueryNFTsRequest(); + message.classId = object.classId ?? ""; + message.owner = object.owner ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryNFTsResponse(): QueryNFTsResponse { + return { nfts: [], pagination: undefined }; +} + +export const QueryNFTsResponse = { + encode(message: QueryNFTsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.nfts) { + NFT.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nfts.push(NFT.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNFTsResponse { + return { + nfts: Array.isArray(object?.nfts) ? object.nfts.map((e: any) => NFT.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryNFTsResponse): unknown { + const obj: any = {}; + if (message.nfts) { + obj.nfts = message.nfts.map((e) => e ? NFT.toJSON(e) : undefined); + } else { + obj.nfts = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryNFTsResponse { + const message = createBaseQueryNFTsResponse(); + message.nfts = object.nfts?.map((e) => NFT.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryNFTRequest(): QueryNFTRequest { + return { classId: "", id: "" }; +} + +export const QueryNFTRequest = { + encode(message: QueryNFTRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNFTRequest { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + }; + }, + + toJSON(message: QueryNFTRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>(object: I): QueryNFTRequest { + const message = createBaseQueryNFTRequest(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseQueryNFTResponse(): QueryNFTResponse { + return { nft: undefined }; +} + +export const QueryNFTResponse = { + encode(message: QueryNFTResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nft !== undefined) { + NFT.encode(message.nft, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nft = NFT.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNFTResponse { + return { nft: isSet(object.nft) ? NFT.fromJSON(object.nft) : undefined }; + }, + + toJSON(message: QueryNFTResponse): unknown { + const obj: any = {}; + message.nft !== undefined && (obj.nft = message.nft ? NFT.toJSON(message.nft) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryNFTResponse { + const message = createBaseQueryNFTResponse(); + message.nft = (object.nft !== undefined && object.nft !== null) ? NFT.fromPartial(object.nft) : undefined; + return message; + }, +}; + +function createBaseQueryClassRequest(): QueryClassRequest { + return { classId: "" }; +} + +export const QueryClassRequest = { + encode(message: QueryClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClassRequest { + return { classId: isSet(object.classId) ? String(object.classId) : "" }; + }, + + toJSON(message: QueryClassRequest): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + return obj; + }, + + fromPartial, I>>(object: I): QueryClassRequest { + const message = createBaseQueryClassRequest(); + message.classId = object.classId ?? ""; + return message; + }, +}; + +function createBaseQueryClassResponse(): QueryClassResponse { + return { class: undefined }; +} + +export const QueryClassResponse = { + encode(message: QueryClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.class !== undefined) { + Class.encode(message.class, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.class = Class.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClassResponse { + return { class: isSet(object.class) ? Class.fromJSON(object.class) : undefined }; + }, + + toJSON(message: QueryClassResponse): unknown { + const obj: any = {}; + message.class !== undefined && (obj.class = message.class ? Class.toJSON(message.class) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClassResponse { + const message = createBaseQueryClassResponse(); + message.class = (object.class !== undefined && object.class !== null) ? Class.fromPartial(object.class) : undefined; + return message; + }, +}; + +function createBaseQueryClassesRequest(): QueryClassesRequest { + return { pagination: undefined }; +} + +export const QueryClassesRequest = { + encode(message: QueryClassesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClassesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryClassesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClassesRequest { + const message = createBaseQueryClassesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryClassesResponse(): QueryClassesResponse { + return { classes: [], pagination: undefined }; +} + +export const QueryClassesResponse = { + encode(message: QueryClassesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.classes) { + Class.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classes.push(Class.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClassesResponse { + return { + classes: Array.isArray(object?.classes) ? object.classes.map((e: any) => Class.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryClassesResponse): unknown { + const obj: any = {}; + if (message.classes) { + obj.classes = message.classes.map((e) => e ? Class.toJSON(e) : undefined); + } else { + obj.classes = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClassesResponse { + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map((e) => Class.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */ + Balance(request: QueryBalanceRequest): Promise; + /** Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */ + Owner(request: QueryOwnerRequest): Promise; + /** Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. */ + Supply(request: QuerySupplyRequest): Promise; + /** + * NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + * ERC721Enumerable + */ + NFTs(request: QueryNFTsRequest): Promise; + /** NFT queries an NFT based on its class and id. */ + NFT(request: QueryNFTRequest): Promise; + /** Class queries an NFT class based on its id */ + Class(request: QueryClassRequest): Promise; + /** Classes queries all NFT classes */ + Classes(request: QueryClassesRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Balance = this.Balance.bind(this); + this.Owner = this.Owner.bind(this); + this.Supply = this.Supply.bind(this); + this.NFTs = this.NFTs.bind(this); + this.NFT = this.NFT.bind(this); + this.Class = this.Class.bind(this); + this.Classes = this.Classes.bind(this); + } + Balance(request: QueryBalanceRequest): Promise { + const data = QueryBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Balance", data); + return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); + } + + Owner(request: QueryOwnerRequest): Promise { + const data = QueryOwnerRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Owner", data); + return promise.then((data) => QueryOwnerResponse.decode(new _m0.Reader(data))); + } + + Supply(request: QuerySupplyRequest): Promise { + const data = QuerySupplyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Supply", data); + return promise.then((data) => QuerySupplyResponse.decode(new _m0.Reader(data))); + } + + NFTs(request: QueryNFTsRequest): Promise { + const data = QueryNFTsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFTs", data); + return promise.then((data) => QueryNFTsResponse.decode(new _m0.Reader(data))); + } + + NFT(request: QueryNFTRequest): Promise { + const data = QueryNFTRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFT", data); + return promise.then((data) => QueryNFTResponse.decode(new _m0.Reader(data))); + } + + Class(request: QueryClassRequest): Promise { + const data = QueryClassRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Class", data); + return promise.then((data) => QueryClassResponse.decode(new _m0.Reader(data))); + } + + Classes(request: QueryClassesRequest): Promise { + const data = QueryClassesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Classes", data); + return promise.then((data) => QueryClassesResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/tx.ts new file mode 100644 index 0000000000..5d00f17b07 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/tx.ts @@ -0,0 +1,174 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.nft.v1beta1"; + +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSend { + /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ + classId: string; + /** id defines the unique identification of nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} + +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse { +} + +function createBaseMsgSend(): MsgSend { + return { classId: "", id: "", sender: "", receiver: "" }; +} + +export const MsgSend = { + encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSend { + return { + classId: isSet(object.classId) ? String(object.classId) : "", + id: isSet(object.id) ? String(object.id) : "", + sender: isSet(object.sender) ? String(object.sender) : "", + receiver: isSet(object.receiver) ? String(object.receiver) : "", + }; + }, + + toJSON(message: MsgSend): unknown { + const obj: any = {}; + message.classId !== undefined && (obj.classId = message.classId); + message.id !== undefined && (obj.id = message.id); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + return obj; + }, + + fromPartial, I>>(object: I): MsgSend { + const message = createBaseMsgSend(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + return message; + }, +}; + +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} + +export const MsgSendResponse = { + encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSendResponse { + return {}; + }, + + toJSON(_: MsgSendResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, +}; + +/** Msg defines the nft Msg service. */ +export interface Msg { + /** Send defines a method to send a nft from one account to another account. */ + Send(request: MsgSend): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Send = this.Send.bind(this); + } + Send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Msg", "Send", data); + return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.nft.v1beta1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/module.ts new file mode 100755 index 0000000000..a9f92fa32a --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/module.ts @@ -0,0 +1,103 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { ParameterChangeProposal as typeParameterChangeProposal} from "./types" +import { ParamChange as typeParamChange} from "./types" +import { Subspace as typeSubspace} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + ParameterChangeProposal: getStructure(typeParameterChangeProposal.fromPartial({})), + ParamChange: getStructure(typeParamChange.fromPartial({})), + Subspace: getStructure(typeSubspace.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosParamsV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/rest.ts index 173864f349..1041c858b7 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/rest.ts @@ -39,10 +39,32 @@ export interface V1Beta1QueryParamsResponse { param?: V1Beta1ParamChange; } +/** +* QuerySubspacesResponse defines the response types for querying for all +registered subspaces and all keys for a subspace. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1QuerySubspacesResponse { + subspaces?: V1Beta1Subspace[]; +} + +/** +* Subspace defines a parameter subspace name and all the keys that exist for +the subspace. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1Subspace { + subspace?: string; + keys?: string[]; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -52,30 +74,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -83,149 +96,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -252,4 +202,20 @@ key. format: "json", ...params, }); + + /** + * @description Since: cosmos-sdk 0.46 + * + * @tags Query + * @name QuerySubspaces + * @summary Subspaces queries for all registered subspaces and all keys for a subspace. + * @request GET:/cosmos/params/v1beta1/subspaces + */ + querySubspaces = (params: RequestParams = {}) => + this.request({ + path: `/cosmos/params/v1beta1/subspaces`, + method: "GET", + format: "json", + ...params, + }); } diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types.ts new file mode 100755 index 0000000000..fb4ddf0ce8 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { ParameterChangeProposal } from "./types/cosmos/params/v1beta1/params" +import { ParamChange } from "./types/cosmos/params/v1beta1/params" +import { Subspace } from "./types/cosmos/params/v1beta1/query" + + +export { + ParameterChangeProposal, + ParamChange, + Subspace, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/params.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/params.ts index 260a7bee55..c684c7fd0c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/params.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/params.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.params.v1beta1"; @@ -21,13 +21,12 @@ export interface ParamChange { value: string; } -const baseParameterChangeProposal: object = { title: "", description: "" }; +function createBaseParameterChangeProposal(): ParameterChangeProposal { + return { title: "", description: "", changes: [] }; +} export const ParameterChangeProposal = { - encode( - message: ParameterChangeProposal, - writer: Writer = Writer.create() - ): Writer { + encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -40,13 +39,10 @@ export const ParameterChangeProposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ParameterChangeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; + const message = createBaseParameterChangeProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -68,73 +64,40 @@ export const ParameterChangeProposal = { }, fromJSON(object: any): ParameterChangeProposal { - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.changes !== undefined && object.changes !== null) { - for (const e of object.changes) { - message.changes.push(ParamChange.fromJSON(e)); - } - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + changes: Array.isArray(object?.changes) ? object.changes.map((e: any) => ParamChange.fromJSON(e)) : [], + }; }, toJSON(message: ParameterChangeProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); + message.description !== undefined && (obj.description = message.description); if (message.changes) { - obj.changes = message.changes.map((e) => - e ? ParamChange.toJSON(e) : undefined - ); + obj.changes = message.changes.map((e) => e ? ParamChange.toJSON(e) : undefined); } else { obj.changes = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ParameterChangeProposal { - const message = { - ...baseParameterChangeProposal, - } as ParameterChangeProposal; - message.changes = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.changes !== undefined && object.changes !== null) { - for (const e of object.changes) { - message.changes.push(ParamChange.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ParameterChangeProposal { + const message = createBaseParameterChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.changes = object.changes?.map((e) => ParamChange.fromPartial(e)) || []; return message; }, }; -const baseParamChange: object = { subspace: "", key: "", value: "" }; +function createBaseParamChange(): ParamChange { + return { subspace: "", key: "", value: "" }; +} export const ParamChange = { - encode(message: ParamChange, writer: Writer = Writer.create()): Writer { + encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -147,10 +110,10 @@ export const ParamChange = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ParamChange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParamChange } as ParamChange; + const message = createBaseParamChange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -172,23 +135,11 @@ export const ParamChange = { }, fromJSON(object: any): ParamChange { - const message = { ...baseParamChange } as ParamChange; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = String(object.subspace); - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; + return { + subspace: isSet(object.subspace) ? String(object.subspace) : "", + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + }; }, toJSON(message: ParamChange): unknown { @@ -199,34 +150,26 @@ export const ParamChange = { return obj; }, - fromPartial(object: DeepPartial): ParamChange { - const message = { ...baseParamChange } as ParamChange; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } + fromPartial, I>>(object: I): ParamChange { + const message = createBaseParamChange(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; + message.value = object.value ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/query.ts index 5c2198388a..f2998b09fd 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos/params/v1beta1/query.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { ParamChange } from "../../../cosmos/params/v1beta1/params"; +import _m0 from "protobufjs/minimal"; +import { ParamChange } from "./params"; export const protobufPackage = "cosmos.params.v1beta1"; @@ -19,13 +19,42 @@ export interface QueryParamsResponse { param: ParamChange | undefined; } -const baseQueryParamsRequest: object = { subspace: "", key: "" }; +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequest { +} + +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponse { + subspaces: Subspace[]; +} + +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface Subspace { + subspace: string; + keys: string[]; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { subspace: "", key: "" }; +} export const QueryParamsRequest = { - encode( - message: QueryParamsRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -35,10 +64,10 @@ export const QueryParamsRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -57,18 +86,10 @@ export const QueryParamsRequest = { }, fromJSON(object: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = String(object.subspace); - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - return message; + return { + subspace: isSet(object.subspace) ? String(object.subspace) : "", + key: isSet(object.key) ? String(object.key) : "", + }; }, toJSON(message: QueryParamsRequest): unknown { @@ -78,39 +99,30 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(object: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } else { - message.subspace = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } + fromPartial, I>>(object: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { param: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.param !== undefined) { ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -126,31 +138,174 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.param !== undefined && object.param !== null) { - message.param = ParamChange.fromJSON(object.param); - } else { - message.param = undefined; + return { param: isSet(object.param) ? ParamChange.fromJSON(object.param) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.param !== undefined && (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.param = (object.param !== undefined && object.param !== null) + ? ParamChange.fromPartial(object.param) + : undefined; + return message; + }, +}; + +function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { + return {}; +} + +export const QuerySubspacesRequest = { + encode(_: QuerySubspacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: QueryParamsResponse): unknown { + fromJSON(_: any): QuerySubspacesRequest { + return {}; + }, + + toJSON(_: QuerySubspacesRequest): unknown { const obj: any = {}; - message.param !== undefined && - (obj.param = message.param - ? ParamChange.toJSON(message.param) - : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.param !== undefined && object.param !== null) { - message.param = ParamChange.fromPartial(object.param); + fromPartial, I>>(_: I): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, +}; + +function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { + return { subspaces: [] }; +} + +export const QuerySubspacesResponse = { + encode(message: QuerySubspacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.subspaces) { + Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspaces.push(Subspace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySubspacesResponse { + return { + subspaces: Array.isArray(object?.subspaces) ? object.subspaces.map((e: any) => Subspace.fromJSON(e)) : [], + }; + }, + + toJSON(message: QuerySubspacesResponse): unknown { + const obj: any = {}; + if (message.subspaces) { + obj.subspaces = message.subspaces.map((e) => e ? Subspace.toJSON(e) : undefined); } else { - message.param = undefined; + obj.subspaces = []; } + return obj; + }, + + fromPartial, I>>(object: I): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map((e) => Subspace.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSubspace(): Subspace { + return { subspace: "", keys: [] }; +} + +export const Subspace = { + encode(message: Subspace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + for (const v of message.keys) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Subspace { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubspace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Subspace { + return { + subspace: isSet(object.subspace) ? String(object.subspace) : "", + keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Subspace): unknown { + const obj: any = {}; + message.subspace !== undefined && (obj.subspace = message.subspace); + if (message.keys) { + obj.keys = message.keys.map((e) => e); + } else { + obj.keys = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Subspace { + const message = createBaseSubspace(); + message.subspace = object.subspace ?? ""; + message.keys = object.keys?.map((e) => e) || []; return message; }, }; @@ -162,39 +317,49 @@ export interface Query { * key. */ Params(request: QueryParamsRequest): Promise; + /** + * Subspaces queries for all registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ + Subspaces(request: QuerySubspacesRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Params = this.Params.bind(this); + this.Subspaces = this.Subspaces.bind(this); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.params.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + Subspaces(request: QuerySubspacesRequest): Promise { + const data = QuerySubspacesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); + return promise.then((data) => QuerySubspacesResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.params.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/index.ts index c3e209765b..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/index.ts @@ -1,61 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgUnjail } from "./types/cosmos/slashing/v1beta1/tx"; - - -const types = [ - ["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgUnjail: (data: MsgUnjail): EncodeObject => ({ typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value: MsgUnjail.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/module.ts new file mode 100755 index 0000000000..a32737615c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/module.ts @@ -0,0 +1,140 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgUnjail } from "./types/cosmos/slashing/v1beta1/tx"; + +import { SigningInfo as typeSigningInfo} from "./types" +import { ValidatorMissedBlocks as typeValidatorMissedBlocks} from "./types" +import { MissedBlock as typeMissedBlock} from "./types" +import { ValidatorSigningInfo as typeValidatorSigningInfo} from "./types" +import { Params as typeParams} from "./types" + +export { MsgUnjail }; + +type sendMsgUnjailParams = { + value: MsgUnjail, + fee?: StdFee, + memo?: string +}; + + +type msgUnjailParams = { + value: MsgUnjail, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgUnjail({ value, fee, memo }: sendMsgUnjailParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUnjail: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUnjail({ value: MsgUnjail.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUnjail: Could not broadcast Tx: '+ e.message) + } + }, + + + msgUnjail({ value }: msgUnjailParams): EncodeObject { + try { + return { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value: MsgUnjail.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUnjail: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + SigningInfo: getStructure(typeSigningInfo.fromPartial({})), + ValidatorMissedBlocks: getStructure(typeValidatorMissedBlocks.fromPartial({})), + MissedBlock: getStructure(typeMissedBlock.fromPartial({})), + ValidatorSigningInfo: getStructure(typeValidatorSigningInfo.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosSlashingV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/registry.ts new file mode 100755 index 0000000000..b35218ded2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/registry.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgUnjail } from "./types/cosmos/slashing/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/rest.ts index bbc42c1429..1c4af200e3 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/rest.ts @@ -21,8 +21,34 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** + * Params represents the parameters used for by the slashing module. + */ +export interface Slashingv1Beta1Params { + /** @format int64 */ + signed_blocks_window?: string; + + /** @format byte */ + min_signed_per_window?: string; + downtime_jail_duration?: string; + + /** @format byte */ + slash_fraction_double_sign?: string; + + /** @format byte */ + slash_fraction_downtime?: string; +} + export type V1Beta1MsgUnjailResponse = object; +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * message SomeRequest { Foo some_parameter = 1; @@ -79,38 +105,30 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } -/** - * Params represents the parameters used for by the slashing module. - */ -export interface V1Beta1Params { - /** @format int64 */ - signed_blocks_window?: string; - - /** @format byte */ - min_signed_per_window?: string; - downtime_jail_duration?: string; - - /** @format byte */ - slash_fraction_double_sign?: string; - - /** @format byte */ - slash_fraction_downtime?: string; -} - export interface V1Beta1QueryParamsResponse { /** Params represents the parameters used for by the slashing module. */ - params?: V1Beta1Params; + params?: Slashingv1Beta1Params; } export interface V1Beta1QuerySigningInfoResponse { /** + * val_signing_info is the signing info of requested val cons address * ValidatorSigningInfo defines a validator's signing info for monitoring their * liveness activity. */ @@ -118,6 +136,7 @@ export interface V1Beta1QuerySigningInfoResponse { } export interface V1Beta1QuerySigningInfosResponse { + /** info is the signing info of all validators */ info?: V1Beta1ValidatorSigningInfo[]; /** @@ -139,7 +158,10 @@ liveness activity. export interface V1Beta1ValidatorSigningInfo { address?: string; - /** @format int64 */ + /** + * Height at which validator was first a candidate OR was unjailed + * @format int64 + */ start_height?: string; /** @@ -170,10 +192,11 @@ export interface V1Beta1ValidatorSigningInfo { missed_blocks_counter?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -183,30 +206,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -214,149 +228,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -416,9 +367,9 @@ export class Api extends HttpClient + querySigningInfo = (consAddress: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/slashing/v1beta1/signing_infos/${cons_address}`, + path: `/cosmos/slashing/v1beta1/signing_infos/${consAddress}`, method: "GET", format: "json", ...params, diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types.ts new file mode 100755 index 0000000000..a3f23c2134 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types.ts @@ -0,0 +1,16 @@ +//@ts-nocheck +import { SigningInfo } from "./types/cosmos/slashing/v1beta1/genesis" +import { ValidatorMissedBlocks } from "./types/cosmos/slashing/v1beta1/genesis" +import { MissedBlock } from "./types/cosmos/slashing/v1beta1/genesis" +import { ValidatorSigningInfo } from "./types/cosmos/slashing/v1beta1/slashing" +import { Params } from "./types/cosmos/slashing/v1beta1/slashing" + + +export { + SigningInfo, + ValidatorMissedBlocks, + MissedBlock, + ValidatorSigningInfo, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts index 34ed8f49d2..30132a8e82 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts @@ -1,28 +1,27 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Params, - ValidatorSigningInfo, -} from "../../../cosmos/slashing/v1beta1/slashing"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, ValidatorSigningInfo } from "./slashing"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ - params: Params | undefined; + /** params defines all the parameters of the module. */ + params: + | Params + | undefined; /** * signing_infos represents a map between validator addresses and their * signing infos. */ - signing_infos: SigningInfo[]; + signingInfos: SigningInfo[]; /** * missed_blocks represents a map between validator addresses and their * missed blocks. */ - missed_blocks: ValidatorMissedBlocks[]; + missedBlocks: ValidatorMissedBlocks[]; } /** SigningInfo stores validator signing info of corresponding address. */ @@ -30,7 +29,7 @@ export interface SigningInfo { /** address is the validator address. */ address: string; /** validator_signing_info represents the signing info of this validator. */ - validator_signing_info: ValidatorSigningInfo | undefined; + validatorSigningInfo: ValidatorSigningInfo | undefined; } /** @@ -41,7 +40,7 @@ export interface ValidatorMissedBlocks { /** address is the validator address. */ address: string; /** missed_blocks is an array of missed blocks by the validator. */ - missed_blocks: MissedBlock[]; + missedBlocks: MissedBlock[]; } /** MissedBlock contains height and missed status as boolean. */ @@ -52,28 +51,28 @@ export interface MissedBlock { missed: boolean; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { params: undefined, signingInfos: [], missedBlocks: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.signing_infos) { + for (const v of message.signingInfos) { SigningInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } - for (const v of message.missed_blocks) { + for (const v of message.missedBlocks) { ValidatorMissedBlocks.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -81,14 +80,10 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.signing_infos.push( - SigningInfo.decode(reader, reader.uint32()) - ); + message.signingInfos.push(SigningInfo.decode(reader, reader.uint32())); break; case 3: - message.missed_blocks.push( - ValidatorMissedBlocks.decode(reader, reader.uint32()) - ); + message.missedBlocks.push(ValidatorMissedBlocks.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -99,91 +94,63 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.signing_infos !== undefined && object.signing_infos !== null) { - for (const e of object.signing_infos) { - message.signing_infos.push(SigningInfo.fromJSON(e)); - } - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(ValidatorMissedBlocks.fromJSON(e)); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + signingInfos: Array.isArray(object?.signingInfos) + ? object.signingInfos.map((e: any) => SigningInfo.fromJSON(e)) + : [], + missedBlocks: Array.isArray(object?.missedBlocks) + ? object.missedBlocks.map((e: any) => ValidatorMissedBlocks.fromJSON(e)) + : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.signing_infos) { - obj.signing_infos = message.signing_infos.map((e) => - e ? SigningInfo.toJSON(e) : undefined - ); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.signingInfos) { + obj.signingInfos = message.signingInfos.map((e) => e ? SigningInfo.toJSON(e) : undefined); } else { - obj.signing_infos = []; + obj.signingInfos = []; } - if (message.missed_blocks) { - obj.missed_blocks = message.missed_blocks.map((e) => - e ? ValidatorMissedBlocks.toJSON(e) : undefined - ); + if (message.missedBlocks) { + obj.missedBlocks = message.missedBlocks.map((e) => e ? ValidatorMissedBlocks.toJSON(e) : undefined); } else { - obj.missed_blocks = []; + obj.missedBlocks = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.signing_infos = []; - message.missed_blocks = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.signing_infos !== undefined && object.signing_infos !== null) { - for (const e of object.signing_infos) { - message.signing_infos.push(SigningInfo.fromPartial(e)); - } - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(ValidatorMissedBlocks.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.signingInfos = object.signingInfos?.map((e) => SigningInfo.fromPartial(e)) || []; + message.missedBlocks = object.missedBlocks?.map((e) => ValidatorMissedBlocks.fromPartial(e)) || []; return message; }, }; -const baseSigningInfo: object = { address: "" }; +function createBaseSigningInfo(): SigningInfo { + return { address: "", validatorSigningInfo: undefined }; +} export const SigningInfo = { - encode(message: SigningInfo, writer: Writer = Writer.create()): Writer { + encode(message: SigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.validator_signing_info !== undefined) { - ValidatorSigningInfo.encode( - message.validator_signing_info, - writer.uint32(18).fork() - ).ldelim(); + if (message.validatorSigningInfo !== undefined) { + ValidatorSigningInfo.encode(message.validatorSigningInfo, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SigningInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SigningInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSigningInfo } as SigningInfo; + const message = createBaseSigningInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -191,10 +158,7 @@ export const SigningInfo = { message.address = reader.string(); break; case 2: - message.validator_signing_info = ValidatorSigningInfo.decode( - reader, - reader.uint32() - ); + message.validatorSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -205,77 +169,52 @@ export const SigningInfo = { }, fromJSON(object: any): SigningInfo { - const message = { ...baseSigningInfo } as SigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if ( - object.validator_signing_info !== undefined && - object.validator_signing_info !== null - ) { - message.validator_signing_info = ValidatorSigningInfo.fromJSON( - object.validator_signing_info - ); - } else { - message.validator_signing_info = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + validatorSigningInfo: isSet(object.validatorSigningInfo) + ? ValidatorSigningInfo.fromJSON(object.validatorSigningInfo) + : undefined, + }; }, toJSON(message: SigningInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.validator_signing_info !== undefined && - (obj.validator_signing_info = message.validator_signing_info - ? ValidatorSigningInfo.toJSON(message.validator_signing_info) - : undefined); + message.validatorSigningInfo !== undefined && (obj.validatorSigningInfo = message.validatorSigningInfo + ? ValidatorSigningInfo.toJSON(message.validatorSigningInfo) + : undefined); return obj; }, - fromPartial(object: DeepPartial): SigningInfo { - const message = { ...baseSigningInfo } as SigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if ( - object.validator_signing_info !== undefined && - object.validator_signing_info !== null - ) { - message.validator_signing_info = ValidatorSigningInfo.fromPartial( - object.validator_signing_info - ); - } else { - message.validator_signing_info = undefined; - } + fromPartial, I>>(object: I): SigningInfo { + const message = createBaseSigningInfo(); + message.address = object.address ?? ""; + message.validatorSigningInfo = (object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null) + ? ValidatorSigningInfo.fromPartial(object.validatorSigningInfo) + : undefined; return message; }, }; -const baseValidatorMissedBlocks: object = { address: "" }; +function createBaseValidatorMissedBlocks(): ValidatorMissedBlocks { + return { address: "", missedBlocks: [] }; +} export const ValidatorMissedBlocks = { - encode( - message: ValidatorMissedBlocks, - writer: Writer = Writer.create() - ): Writer { + encode(message: ValidatorMissedBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - for (const v of message.missed_blocks) { + for (const v of message.missedBlocks) { MissedBlock.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorMissedBlocks { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorMissedBlocks { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; + const message = createBaseValidatorMissedBlocks(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -283,9 +222,7 @@ export const ValidatorMissedBlocks = { message.address = reader.string(); break; case 2: - message.missed_blocks.push( - MissedBlock.decode(reader, reader.uint32()) - ); + message.missedBlocks.push(MissedBlock.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -296,57 +233,39 @@ export const ValidatorMissedBlocks = { }, fromJSON(object: any): ValidatorMissedBlocks { - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(MissedBlock.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + missedBlocks: Array.isArray(object?.missedBlocks) + ? object.missedBlocks.map((e: any) => MissedBlock.fromJSON(e)) + : [], + }; }, toJSON(message: ValidatorMissedBlocks): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - if (message.missed_blocks) { - obj.missed_blocks = message.missed_blocks.map((e) => - e ? MissedBlock.toJSON(e) : undefined - ); + if (message.missedBlocks) { + obj.missedBlocks = message.missedBlocks.map((e) => e ? MissedBlock.toJSON(e) : undefined); } else { - obj.missed_blocks = []; + obj.missedBlocks = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ValidatorMissedBlocks { - const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; - message.missed_blocks = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.missed_blocks !== undefined && object.missed_blocks !== null) { - for (const e of object.missed_blocks) { - message.missed_blocks.push(MissedBlock.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ValidatorMissedBlocks { + const message = createBaseValidatorMissedBlocks(); + message.address = object.address ?? ""; + message.missedBlocks = object.missedBlocks?.map((e) => MissedBlock.fromPartial(e)) || []; return message; }, }; -const baseMissedBlock: object = { index: 0, missed: false }; +function createBaseMissedBlock(): MissedBlock { + return { index: 0, missed: false }; +} export const MissedBlock = { - encode(message: MissedBlock, writer: Writer = Writer.create()): Writer { + encode(message: MissedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).int64(message.index); } @@ -356,10 +275,10 @@ export const MissedBlock = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MissedBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MissedBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMissedBlock } as MissedBlock; + const message = createBaseMissedBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -378,64 +297,57 @@ export const MissedBlock = { }, fromJSON(object: any): MissedBlock { - const message = { ...baseMissedBlock } as MissedBlock; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.missed !== undefined && object.missed !== null) { - message.missed = Boolean(object.missed); - } else { - message.missed = false; - } - return message; + return { + index: isSet(object.index) ? Number(object.index) : 0, + missed: isSet(object.missed) ? Boolean(object.missed) : false, + }; }, toJSON(message: MissedBlock): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = message.index); + message.index !== undefined && (obj.index = Math.round(message.index)); message.missed !== undefined && (obj.missed = message.missed); return obj; }, - fromPartial(object: DeepPartial): MissedBlock { - const message = { ...baseMissedBlock } as MissedBlock; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.missed !== undefined && object.missed !== null) { - message.missed = object.missed; - } else { - message.missed = false; - } + fromPartial, I>>(object: I): MissedBlock { + const message = createBaseMissedBlock(); + message.index = object.index ?? 0; + message.missed = object.missed ?? false; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -443,7 +355,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/query.ts index 729bc96e7a..648cf2e378 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/query.ts @@ -1,19 +1,14 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - Params, - ValidatorSigningInfo, -} from "../../../cosmos/slashing/v1beta1/slashing"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Params, ValidatorSigningInfo } from "./slashing"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method */ export interface QueryParamsResponse { @@ -26,7 +21,7 @@ export interface QueryParamsResponse { */ export interface QuerySigningInfoRequest { /** cons_address is the address to query signing info of */ - cons_address: string; + consAddress: string; } /** @@ -35,7 +30,7 @@ export interface QuerySigningInfoRequest { */ export interface QuerySigningInfoResponse { /** val_signing_info is the signing info of requested val cons address */ - val_signing_info: ValidatorSigningInfo | undefined; + valSigningInfo: ValidatorSigningInfo | undefined; } /** @@ -56,17 +51,19 @@ export interface QuerySigningInfosResponse { pagination: PageResponse | undefined; } -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -79,8 +76,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -88,29 +84,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -126,57 +121,45 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -const baseQuerySigningInfoRequest: object = { cons_address: "" }; +function createBaseQuerySigningInfoRequest(): QuerySigningInfoRequest { + return { consAddress: "" }; +} export const QuerySigningInfoRequest = { - encode( - message: QuerySigningInfoRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.cons_address !== "") { - writer.uint32(10).string(message.cons_address); + encode(message: QuerySigningInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consAddress !== "") { + writer.uint32(10).string(message.consAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QuerySigningInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; + const message = createBaseQuerySigningInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.cons_address = reader.string(); + message.consAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -187,72 +170,43 @@ export const QuerySigningInfoRequest = { }, fromJSON(object: any): QuerySigningInfoRequest { - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; - if (object.cons_address !== undefined && object.cons_address !== null) { - message.cons_address = String(object.cons_address); - } else { - message.cons_address = ""; - } - return message; + return { consAddress: isSet(object.consAddress) ? String(object.consAddress) : "" }; }, toJSON(message: QuerySigningInfoRequest): unknown { const obj: any = {}; - message.cons_address !== undefined && - (obj.cons_address = message.cons_address); + message.consAddress !== undefined && (obj.consAddress = message.consAddress); return obj; }, - fromPartial( - object: DeepPartial - ): QuerySigningInfoRequest { - const message = { - ...baseQuerySigningInfoRequest, - } as QuerySigningInfoRequest; - if (object.cons_address !== undefined && object.cons_address !== null) { - message.cons_address = object.cons_address; - } else { - message.cons_address = ""; - } + fromPartial, I>>(object: I): QuerySigningInfoRequest { + const message = createBaseQuerySigningInfoRequest(); + message.consAddress = object.consAddress ?? ""; return message; }, }; -const baseQuerySigningInfoResponse: object = {}; +function createBaseQuerySigningInfoResponse(): QuerySigningInfoResponse { + return { valSigningInfo: undefined }; +} export const QuerySigningInfoResponse = { - encode( - message: QuerySigningInfoResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.val_signing_info !== undefined) { - ValidatorSigningInfo.encode( - message.val_signing_info, - writer.uint32(10).fork() - ).ldelim(); + encode(message: QuerySigningInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.valSigningInfo !== undefined) { + ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; + const message = createBaseQuerySigningInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.val_signing_info = ValidatorSigningInfo.decode( - reader, - reader.uint32() - ); + message.valSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -263,73 +217,45 @@ export const QuerySigningInfoResponse = { }, fromJSON(object: any): QuerySigningInfoResponse { - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; - if ( - object.val_signing_info !== undefined && - object.val_signing_info !== null - ) { - message.val_signing_info = ValidatorSigningInfo.fromJSON( - object.val_signing_info - ); - } else { - message.val_signing_info = undefined; - } - return message; + return { + valSigningInfo: isSet(object.valSigningInfo) ? ValidatorSigningInfo.fromJSON(object.valSigningInfo) : undefined, + }; }, toJSON(message: QuerySigningInfoResponse): unknown { const obj: any = {}; - message.val_signing_info !== undefined && - (obj.val_signing_info = message.val_signing_info - ? ValidatorSigningInfo.toJSON(message.val_signing_info) + message.valSigningInfo !== undefined + && (obj.valSigningInfo = message.valSigningInfo + ? ValidatorSigningInfo.toJSON(message.valSigningInfo) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QuerySigningInfoResponse { - const message = { - ...baseQuerySigningInfoResponse, - } as QuerySigningInfoResponse; - if ( - object.val_signing_info !== undefined && - object.val_signing_info !== null - ) { - message.val_signing_info = ValidatorSigningInfo.fromPartial( - object.val_signing_info - ); - } else { - message.val_signing_info = undefined; - } + fromPartial, I>>(object: I): QuerySigningInfoResponse { + const message = createBaseQuerySigningInfoResponse(); + message.valSigningInfo = (object.valSigningInfo !== undefined && object.valSigningInfo !== null) + ? ValidatorSigningInfo.fromPartial(object.valSigningInfo) + : undefined; return message; }, }; -const baseQuerySigningInfosRequest: object = {}; +function createBaseQuerySigningInfosRequest(): QuerySigningInfosRequest { + return { pagination: undefined }; +} export const QuerySigningInfosRequest = { - encode( - message: QuerySigningInfosRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySigningInfosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfosRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; + const message = createBaseQuerySigningInfosRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -345,77 +271,49 @@ export const QuerySigningInfosRequest = { }, fromJSON(object: any): QuerySigningInfosRequest { - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QuerySigningInfosRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QuerySigningInfosRequest { - const message = { - ...baseQuerySigningInfosRequest, - } as QuerySigningInfosRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QuerySigningInfosRequest { + const message = createBaseQuerySigningInfosRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQuerySigningInfosResponse: object = {}; +function createBaseQuerySigningInfosResponse(): QuerySigningInfosResponse { + return { info: [], pagination: undefined }; +} export const QuerySigningInfosResponse = { - encode( - message: QuerySigningInfosResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySigningInfosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.info) { ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySigningInfosResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; + const message = createBaseQuerySigningInfosResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.info.push( - ValidatorSigningInfo.decode(reader, reader.uint32()) - ); + message.info.push(ValidatorSigningInfo.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -429,56 +327,30 @@ export const QuerySigningInfosResponse = { }, fromJSON(object: any): QuerySigningInfosResponse { - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; - if (object.info !== undefined && object.info !== null) { - for (const e of object.info) { - message.info.push(ValidatorSigningInfo.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + info: Array.isArray(object?.info) ? object.info.map((e: any) => ValidatorSigningInfo.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QuerySigningInfosResponse): unknown { const obj: any = {}; if (message.info) { - obj.info = message.info.map((e) => - e ? ValidatorSigningInfo.toJSON(e) : undefined - ); + obj.info = message.info.map((e) => e ? ValidatorSigningInfo.toJSON(e) : undefined); } else { obj.info = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QuerySigningInfosResponse { - const message = { - ...baseQuerySigningInfosResponse, - } as QuerySigningInfosResponse; - message.info = []; - if (object.info !== undefined && object.info !== null) { - for (const e of object.info) { - message.info.push(ValidatorSigningInfo.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QuerySigningInfosResponse { + const message = createBaseQuerySigningInfosResponse(); + message.info = object.info?.map((e) => ValidatorSigningInfo.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; @@ -488,74 +360,53 @@ export interface Query { /** Params queries the parameters of slashing module */ Params(request: QueryParamsRequest): Promise; /** SigningInfo queries the signing info of given cons address */ - SigningInfo( - request: QuerySigningInfoRequest - ): Promise; + SigningInfo(request: QuerySigningInfoRequest): Promise; /** SigningInfos queries signing info of all validators */ - SigningInfos( - request: QuerySigningInfosRequest - ): Promise; + SigningInfos(request: QuerySigningInfosRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Params = this.Params.bind(this); + this.SigningInfo = this.SigningInfo.bind(this); + this.SigningInfos = this.SigningInfos.bind(this); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } - SigningInfo( - request: QuerySigningInfoRequest - ): Promise { + SigningInfo(request: QuerySigningInfoRequest): Promise { const data = QuerySigningInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "SigningInfo", - data - ); - return promise.then((data) => - QuerySigningInfoResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfo", data); + return promise.then((data) => QuerySigningInfoResponse.decode(new _m0.Reader(data))); } - SigningInfos( - request: QuerySigningInfosRequest - ): Promise { + SigningInfos(request: QuerySigningInfosRequest): Promise { const data = QuerySigningInfosRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Query", - "SigningInfos", - data - ); - return promise.then((data) => - QuerySigningInfosResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfos", data); + return promise.then((data) => QuerySigningInfosResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/slashing.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/slashing.ts index 5886db9671..3fbc531bf8 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/slashing.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/slashing.ts @@ -1,9 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; export const protobufPackage = "cosmos.slashing.v1beta1"; @@ -14,15 +14,17 @@ export const protobufPackage = "cosmos.slashing.v1beta1"; export interface ValidatorSigningInfo { address: string; /** Height at which validator was first a candidate OR was unjailed */ - start_height: number; + startHeight: number; /** * Index which is incremented each time the validator was a bonded * in a block and may have signed a precommit or not. This in conjunction with the * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. */ - index_offset: number; + indexOffset: number; /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until: Date | undefined; + jailedUntil: + | Date + | undefined; /** * Whether or not a validator has been tombstoned (killed out of validator set). It is set * once the validator commits an equivocation or for any other configured misbehiavor. @@ -32,59 +34,56 @@ export interface ValidatorSigningInfo { * A counter kept to avoid unnecessary array reads. * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. */ - missed_blocks_counter: number; + missedBlocksCounter: number; } /** Params represents the parameters used for by the slashing module. */ export interface Params { - signed_blocks_window: number; - min_signed_per_window: Uint8Array; - downtime_jail_duration: Duration | undefined; - slash_fraction_double_sign: Uint8Array; - slash_fraction_downtime: Uint8Array; + signedBlocksWindow: number; + minSignedPerWindow: Uint8Array; + downtimeJailDuration: Duration | undefined; + slashFractionDoubleSign: Uint8Array; + slashFractionDowntime: Uint8Array; } -const baseValidatorSigningInfo: object = { - address: "", - start_height: 0, - index_offset: 0, - tombstoned: false, - missed_blocks_counter: 0, -}; +function createBaseValidatorSigningInfo(): ValidatorSigningInfo { + return { + address: "", + startHeight: 0, + indexOffset: 0, + jailedUntil: undefined, + tombstoned: false, + missedBlocksCounter: 0, + }; +} export const ValidatorSigningInfo = { - encode( - message: ValidatorSigningInfo, - writer: Writer = Writer.create() - ): Writer { + encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.start_height !== 0) { - writer.uint32(16).int64(message.start_height); + if (message.startHeight !== 0) { + writer.uint32(16).int64(message.startHeight); } - if (message.index_offset !== 0) { - writer.uint32(24).int64(message.index_offset); + if (message.indexOffset !== 0) { + writer.uint32(24).int64(message.indexOffset); } - if (message.jailed_until !== undefined) { - Timestamp.encode( - toTimestamp(message.jailed_until), - writer.uint32(34).fork() - ).ldelim(); + if (message.jailedUntil !== undefined) { + Timestamp.encode(toTimestamp(message.jailedUntil), writer.uint32(34).fork()).ldelim(); } if (message.tombstoned === true) { writer.uint32(40).bool(message.tombstoned); } - if (message.missed_blocks_counter !== 0) { - writer.uint32(48).int64(message.missed_blocks_counter); + if (message.missedBlocksCounter !== 0) { + writer.uint32(48).int64(message.missedBlocksCounter); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSigningInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; + const message = createBaseValidatorSigningInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -92,21 +91,19 @@ export const ValidatorSigningInfo = { message.address = reader.string(); break; case 2: - message.start_height = longToNumber(reader.int64() as Long); + message.startHeight = longToNumber(reader.int64() as Long); break; case 3: - message.index_offset = longToNumber(reader.int64() as Long); + message.indexOffset = longToNumber(reader.int64() as Long); break; case 4: - message.jailed_until = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.jailedUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: message.tombstoned = reader.bool(); break; case 6: - message.missed_blocks_counter = longToNumber(reader.int64() as Long); + message.missedBlocksCounter = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -117,149 +114,90 @@ export const ValidatorSigningInfo = { }, fromJSON(object: any): ValidatorSigningInfo { - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.start_height !== undefined && object.start_height !== null) { - message.start_height = Number(object.start_height); - } else { - message.start_height = 0; - } - if (object.index_offset !== undefined && object.index_offset !== null) { - message.index_offset = Number(object.index_offset); - } else { - message.index_offset = 0; - } - if (object.jailed_until !== undefined && object.jailed_until !== null) { - message.jailed_until = fromJsonTimestamp(object.jailed_until); - } else { - message.jailed_until = undefined; - } - if (object.tombstoned !== undefined && object.tombstoned !== null) { - message.tombstoned = Boolean(object.tombstoned); - } else { - message.tombstoned = false; - } - if ( - object.missed_blocks_counter !== undefined && - object.missed_blocks_counter !== null - ) { - message.missed_blocks_counter = Number(object.missed_blocks_counter); - } else { - message.missed_blocks_counter = 0; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + startHeight: isSet(object.startHeight) ? Number(object.startHeight) : 0, + indexOffset: isSet(object.indexOffset) ? Number(object.indexOffset) : 0, + jailedUntil: isSet(object.jailedUntil) ? fromJsonTimestamp(object.jailedUntil) : undefined, + tombstoned: isSet(object.tombstoned) ? Boolean(object.tombstoned) : false, + missedBlocksCounter: isSet(object.missedBlocksCounter) ? Number(object.missedBlocksCounter) : 0, + }; }, toJSON(message: ValidatorSigningInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.start_height !== undefined && - (obj.start_height = message.start_height); - message.index_offset !== undefined && - (obj.index_offset = message.index_offset); - message.jailed_until !== undefined && - (obj.jailed_until = - message.jailed_until !== undefined - ? message.jailed_until.toISOString() - : null); + message.startHeight !== undefined && (obj.startHeight = Math.round(message.startHeight)); + message.indexOffset !== undefined && (obj.indexOffset = Math.round(message.indexOffset)); + message.jailedUntil !== undefined && (obj.jailedUntil = message.jailedUntil.toISOString()); message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); - message.missed_blocks_counter !== undefined && - (obj.missed_blocks_counter = message.missed_blocks_counter); + message.missedBlocksCounter !== undefined && (obj.missedBlocksCounter = Math.round(message.missedBlocksCounter)); return obj; }, - fromPartial(object: DeepPartial): ValidatorSigningInfo { - const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.start_height !== undefined && object.start_height !== null) { - message.start_height = object.start_height; - } else { - message.start_height = 0; - } - if (object.index_offset !== undefined && object.index_offset !== null) { - message.index_offset = object.index_offset; - } else { - message.index_offset = 0; - } - if (object.jailed_until !== undefined && object.jailed_until !== null) { - message.jailed_until = object.jailed_until; - } else { - message.jailed_until = undefined; - } - if (object.tombstoned !== undefined && object.tombstoned !== null) { - message.tombstoned = object.tombstoned; - } else { - message.tombstoned = false; - } - if ( - object.missed_blocks_counter !== undefined && - object.missed_blocks_counter !== null - ) { - message.missed_blocks_counter = object.missed_blocks_counter; - } else { - message.missed_blocks_counter = 0; - } + fromPartial, I>>(object: I): ValidatorSigningInfo { + const message = createBaseValidatorSigningInfo(); + message.address = object.address ?? ""; + message.startHeight = object.startHeight ?? 0; + message.indexOffset = object.indexOffset ?? 0; + message.jailedUntil = object.jailedUntil ?? undefined; + message.tombstoned = object.tombstoned ?? false; + message.missedBlocksCounter = object.missedBlocksCounter ?? 0; return message; }, }; -const baseParams: object = { signed_blocks_window: 0 }; +function createBaseParams(): Params { + return { + signedBlocksWindow: 0, + minSignedPerWindow: new Uint8Array(), + downtimeJailDuration: undefined, + slashFractionDoubleSign: new Uint8Array(), + slashFractionDowntime: new Uint8Array(), + }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.signed_blocks_window !== 0) { - writer.uint32(8).int64(message.signed_blocks_window); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedBlocksWindow !== 0) { + writer.uint32(8).int64(message.signedBlocksWindow); } - if (message.min_signed_per_window.length !== 0) { - writer.uint32(18).bytes(message.min_signed_per_window); + if (message.minSignedPerWindow.length !== 0) { + writer.uint32(18).bytes(message.minSignedPerWindow); } - if (message.downtime_jail_duration !== undefined) { - Duration.encode( - message.downtime_jail_duration, - writer.uint32(26).fork() - ).ldelim(); + if (message.downtimeJailDuration !== undefined) { + Duration.encode(message.downtimeJailDuration, writer.uint32(26).fork()).ldelim(); } - if (message.slash_fraction_double_sign.length !== 0) { - writer.uint32(34).bytes(message.slash_fraction_double_sign); + if (message.slashFractionDoubleSign.length !== 0) { + writer.uint32(34).bytes(message.slashFractionDoubleSign); } - if (message.slash_fraction_downtime.length !== 0) { - writer.uint32(42).bytes(message.slash_fraction_downtime); + if (message.slashFractionDowntime.length !== 0) { + writer.uint32(42).bytes(message.slashFractionDowntime); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signed_blocks_window = longToNumber(reader.int64() as Long); + message.signedBlocksWindow = longToNumber(reader.int64() as Long); break; case 2: - message.min_signed_per_window = reader.bytes(); + message.minSignedPerWindow = reader.bytes(); break; case 3: - message.downtime_jail_duration = Duration.decode( - reader, - reader.uint32() - ); + message.downtimeJailDuration = Duration.decode(reader, reader.uint32()); break; case 4: - message.slash_fraction_double_sign = reader.bytes(); + message.slashFractionDoubleSign = reader.bytes(); break; case 5: - message.slash_fraction_downtime = reader.bytes(); + message.slashFractionDowntime = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -270,173 +208,112 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.signed_blocks_window !== undefined && - object.signed_blocks_window !== null - ) { - message.signed_blocks_window = Number(object.signed_blocks_window); - } else { - message.signed_blocks_window = 0; - } - if ( - object.min_signed_per_window !== undefined && - object.min_signed_per_window !== null - ) { - message.min_signed_per_window = bytesFromBase64( - object.min_signed_per_window - ); - } - if ( - object.downtime_jail_duration !== undefined && - object.downtime_jail_duration !== null - ) { - message.downtime_jail_duration = Duration.fromJSON( - object.downtime_jail_duration - ); - } else { - message.downtime_jail_duration = undefined; - } - if ( - object.slash_fraction_double_sign !== undefined && - object.slash_fraction_double_sign !== null - ) { - message.slash_fraction_double_sign = bytesFromBase64( - object.slash_fraction_double_sign - ); - } - if ( - object.slash_fraction_downtime !== undefined && - object.slash_fraction_downtime !== null - ) { - message.slash_fraction_downtime = bytesFromBase64( - object.slash_fraction_downtime - ); - } - return message; + return { + signedBlocksWindow: isSet(object.signedBlocksWindow) ? Number(object.signedBlocksWindow) : 0, + minSignedPerWindow: isSet(object.minSignedPerWindow) + ? bytesFromBase64(object.minSignedPerWindow) + : new Uint8Array(), + downtimeJailDuration: isSet(object.downtimeJailDuration) + ? Duration.fromJSON(object.downtimeJailDuration) + : undefined, + slashFractionDoubleSign: isSet(object.slashFractionDoubleSign) + ? bytesFromBase64(object.slashFractionDoubleSign) + : new Uint8Array(), + slashFractionDowntime: isSet(object.slashFractionDowntime) + ? bytesFromBase64(object.slashFractionDowntime) + : new Uint8Array(), + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.signed_blocks_window !== undefined && - (obj.signed_blocks_window = message.signed_blocks_window); - message.min_signed_per_window !== undefined && - (obj.min_signed_per_window = base64FromBytes( - message.min_signed_per_window !== undefined - ? message.min_signed_per_window - : new Uint8Array() + message.signedBlocksWindow !== undefined && (obj.signedBlocksWindow = Math.round(message.signedBlocksWindow)); + message.minSignedPerWindow !== undefined + && (obj.minSignedPerWindow = base64FromBytes( + message.minSignedPerWindow !== undefined ? message.minSignedPerWindow : new Uint8Array(), )); - message.downtime_jail_duration !== undefined && - (obj.downtime_jail_duration = message.downtime_jail_duration - ? Duration.toJSON(message.downtime_jail_duration) - : undefined); - message.slash_fraction_double_sign !== undefined && - (obj.slash_fraction_double_sign = base64FromBytes( - message.slash_fraction_double_sign !== undefined - ? message.slash_fraction_double_sign - : new Uint8Array() + message.downtimeJailDuration !== undefined && (obj.downtimeJailDuration = message.downtimeJailDuration + ? Duration.toJSON(message.downtimeJailDuration) + : undefined); + message.slashFractionDoubleSign !== undefined + && (obj.slashFractionDoubleSign = base64FromBytes( + message.slashFractionDoubleSign !== undefined ? message.slashFractionDoubleSign : new Uint8Array(), )); - message.slash_fraction_downtime !== undefined && - (obj.slash_fraction_downtime = base64FromBytes( - message.slash_fraction_downtime !== undefined - ? message.slash_fraction_downtime - : new Uint8Array() + message.slashFractionDowntime !== undefined + && (obj.slashFractionDowntime = base64FromBytes( + message.slashFractionDowntime !== undefined ? message.slashFractionDowntime : new Uint8Array(), )); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.signed_blocks_window !== undefined && - object.signed_blocks_window !== null - ) { - message.signed_blocks_window = object.signed_blocks_window; - } else { - message.signed_blocks_window = 0; - } - if ( - object.min_signed_per_window !== undefined && - object.min_signed_per_window !== null - ) { - message.min_signed_per_window = object.min_signed_per_window; - } else { - message.min_signed_per_window = new Uint8Array(); - } - if ( - object.downtime_jail_duration !== undefined && - object.downtime_jail_duration !== null - ) { - message.downtime_jail_duration = Duration.fromPartial( - object.downtime_jail_duration - ); - } else { - message.downtime_jail_duration = undefined; - } - if ( - object.slash_fraction_double_sign !== undefined && - object.slash_fraction_double_sign !== null - ) { - message.slash_fraction_double_sign = object.slash_fraction_double_sign; - } else { - message.slash_fraction_double_sign = new Uint8Array(); - } - if ( - object.slash_fraction_downtime !== undefined && - object.slash_fraction_downtime !== null - ) { - message.slash_fraction_downtime = object.slash_fraction_downtime; - } else { - message.slash_fraction_downtime = new Uint8Array(); - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.signedBlocksWindow = object.signedBlocksWindow ?? 0; + message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array(); + message.downtimeJailDuration = (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null) + ? Duration.fromPartial(object.downtimeJailDuration) + : undefined; + message.slashFractionDoubleSign = object.slashFractionDoubleSign ?? new Uint8Array(); + message.slashFractionDowntime = object.slashFractionDowntime ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -466,7 +343,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts index 122a5bbaf3..aea1495273 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts @@ -1,36 +1,65 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Params } from "./slashing"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { - validator_addr: string; + validatorAddr: string; } /** MsgUnjailResponse defines the Msg/Unjail response type */ -export interface MsgUnjailResponse {} +export interface MsgUnjailResponse { +} + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/slashing parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} -const baseMsgUnjail: object = { validator_addr: "" }; +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgUnjail(): MsgUnjail { + return { validatorAddr: "" }; +} export const MsgUnjail = { - encode(message: MsgUnjail, writer: Writer = Writer.create()): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); + encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUnjail { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUnjail } as MsgUnjail; + const message = createBaseMsgUnjail(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; default: reader.skipType(tag & 7); @@ -41,44 +70,35 @@ export const MsgUnjail = { }, fromJSON(object: any): MsgUnjail { - const message = { ...baseMsgUnjail } as MsgUnjail; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; + return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; }, toJSON(message: MsgUnjail): unknown { const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial(object: DeepPartial): MsgUnjail { - const message = { ...baseMsgUnjail } as MsgUnjail; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } + fromPartial, I>>(object: I): MsgUnjail { + const message = createBaseMsgUnjail(); + message.validatorAddr = object.validatorAddr ?? ""; return message; }, }; -const baseMsgUnjailResponse: object = {}; +function createBaseMsgUnjailResponse(): MsgUnjailResponse { + return {}; +} export const MsgUnjailResponse = { - encode(_: MsgUnjailResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUnjailResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; + const message = createBaseMsgUnjailResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -91,8 +111,7 @@ export const MsgUnjailResponse = { }, fromJSON(_: any): MsgUnjailResponse { - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; - return message; + return {}; }, toJSON(_: MsgUnjailResponse): unknown { @@ -100,8 +119,107 @@ export const MsgUnjailResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgUnjailResponse { - const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; + fromPartial, I>>(_: I): MsgUnjailResponse { + const message = createBaseMsgUnjailResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, }; @@ -114,39 +232,50 @@ export interface Msg { * and rewards again. */ Unjail(request: MsgUnjail): Promise; + /** + * UpdateParams defines a governance operation for updating the x/slashing module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Unjail = this.Unjail.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); } Unjail(request: MsgUnjail): Promise { const data = MsgUnjail.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.slashing.v1beta1.Msg", - "Unjail", - data - ); - return promise.then((data) => MsgUnjailResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); + return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/duration.ts index 0cb51f5a90..01ce7b0bf9 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/duration.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/duration.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -83,10 +83,12 @@ export interface Duration { nanos: number; } -const baseDuration: object = { seconds: 0, nanos: 0 }; +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -96,10 +98,10 @@ export const Duration = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDuration } as Duration; + const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,64 +120,57 @@ export const Duration = { }, fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -183,7 +178,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.slashing.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/index.ts index cce144aa59..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/index.ts @@ -1,73 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; - - -const types = [ - ["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], - ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], - ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], - ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], - ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCreateValidator: (data: MsgCreateValidator): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: MsgCreateValidator.fromPartial( data ) }), - msgDelegate: (data: MsgDelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: MsgDelegate.fromPartial( data ) }), - msgEditValidator: (data: MsgEditValidator): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", value: MsgEditValidator.fromPartial( data ) }), - msgUndelegate: (data: MsgUndelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial( data ) }), - msgBeginRedelegate: (data: MsgBeginRedelegate): EncodeObject => ({ typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: MsgBeginRedelegate.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/module.ts new file mode 100755 index 0000000000..59a1a037ef --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/module.ts @@ -0,0 +1,343 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgCancelUnbondingDelegation } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; + +import { StakeAuthorization as typeStakeAuthorization} from "./types" +import { StakeAuthorization_Validators as typeStakeAuthorization_Validators} from "./types" +import { LastValidatorPower as typeLastValidatorPower} from "./types" +import { HistoricalInfo as typeHistoricalInfo} from "./types" +import { CommissionRates as typeCommissionRates} from "./types" +import { Commission as typeCommission} from "./types" +import { Description as typeDescription} from "./types" +import { Validator as typeValidator} from "./types" +import { ValAddresses as typeValAddresses} from "./types" +import { DVPair as typeDVPair} from "./types" +import { DVPairs as typeDVPairs} from "./types" +import { DVVTriplet as typeDVVTriplet} from "./types" +import { DVVTriplets as typeDVVTriplets} from "./types" +import { Delegation as typeDelegation} from "./types" +import { UnbondingDelegation as typeUnbondingDelegation} from "./types" +import { UnbondingDelegationEntry as typeUnbondingDelegationEntry} from "./types" +import { RedelegationEntry as typeRedelegationEntry} from "./types" +import { Redelegation as typeRedelegation} from "./types" +import { Params as typeParams} from "./types" +import { DelegationResponse as typeDelegationResponse} from "./types" +import { RedelegationEntryResponse as typeRedelegationEntryResponse} from "./types" +import { RedelegationResponse as typeRedelegationResponse} from "./types" +import { Pool as typePool} from "./types" +import { ValidatorUpdates as typeValidatorUpdates} from "./types" + +export { MsgEditValidator, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgCreateValidator, MsgDelegate }; + +type sendMsgEditValidatorParams = { + value: MsgEditValidator, + fee?: StdFee, + memo?: string +}; + +type sendMsgBeginRedelegateParams = { + value: MsgBeginRedelegate, + fee?: StdFee, + memo?: string +}; + +type sendMsgUndelegateParams = { + value: MsgUndelegate, + fee?: StdFee, + memo?: string +}; + +type sendMsgCancelUnbondingDelegationParams = { + value: MsgCancelUnbondingDelegation, + fee?: StdFee, + memo?: string +}; + +type sendMsgCreateValidatorParams = { + value: MsgCreateValidator, + fee?: StdFee, + memo?: string +}; + +type sendMsgDelegateParams = { + value: MsgDelegate, + fee?: StdFee, + memo?: string +}; + + +type msgEditValidatorParams = { + value: MsgEditValidator, +}; + +type msgBeginRedelegateParams = { + value: MsgBeginRedelegate, +}; + +type msgUndelegateParams = { + value: MsgUndelegate, +}; + +type msgCancelUnbondingDelegationParams = { + value: MsgCancelUnbondingDelegation, +}; + +type msgCreateValidatorParams = { + value: MsgCreateValidator, +}; + +type msgDelegateParams = { + value: MsgDelegate, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgEditValidator({ value, fee, memo }: sendMsgEditValidatorParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgEditValidator: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgEditValidator({ value: MsgEditValidator.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgEditValidator: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgBeginRedelegate({ value, fee, memo }: sendMsgBeginRedelegateParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgBeginRedelegate: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgBeginRedelegate({ value: MsgBeginRedelegate.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgBeginRedelegate: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUndelegate({ value, fee, memo }: sendMsgUndelegateParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUndelegate: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUndelegate({ value: MsgUndelegate.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUndelegate: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCancelUnbondingDelegation({ value, fee, memo }: sendMsgCancelUnbondingDelegationParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCancelUnbondingDelegation({ value: MsgCancelUnbondingDelegation.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCreateValidator({ value, fee, memo }: sendMsgCreateValidatorParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreateValidator({ value: MsgCreateValidator.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreateValidator: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDelegate({ value, fee, memo }: sendMsgDelegateParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDelegate: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDelegate({ value: MsgDelegate.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDelegate: Could not broadcast Tx: '+ e.message) + } + }, + + + msgEditValidator({ value }: msgEditValidatorParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", value: MsgEditValidator.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgEditValidator: Could not create message: ' + e.message) + } + }, + + msgBeginRedelegate({ value }: msgBeginRedelegateParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: MsgBeginRedelegate.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgBeginRedelegate: Could not create message: ' + e.message) + } + }, + + msgUndelegate({ value }: msgUndelegateParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUndelegate: Could not create message: ' + e.message) + } + }, + + msgCancelUnbondingDelegation({ value }: msgCancelUnbondingDelegationParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", value: MsgCancelUnbondingDelegation.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCancelUnbondingDelegation: Could not create message: ' + e.message) + } + }, + + msgCreateValidator({ value }: msgCreateValidatorParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: MsgCreateValidator.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreateValidator: Could not create message: ' + e.message) + } + }, + + msgDelegate({ value }: msgDelegateParams): EncodeObject { + try { + return { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: MsgDelegate.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDelegate: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + StakeAuthorization: getStructure(typeStakeAuthorization.fromPartial({})), + StakeAuthorization_Validators: getStructure(typeStakeAuthorization_Validators.fromPartial({})), + LastValidatorPower: getStructure(typeLastValidatorPower.fromPartial({})), + HistoricalInfo: getStructure(typeHistoricalInfo.fromPartial({})), + CommissionRates: getStructure(typeCommissionRates.fromPartial({})), + Commission: getStructure(typeCommission.fromPartial({})), + Description: getStructure(typeDescription.fromPartial({})), + Validator: getStructure(typeValidator.fromPartial({})), + ValAddresses: getStructure(typeValAddresses.fromPartial({})), + DVPair: getStructure(typeDVPair.fromPartial({})), + DVPairs: getStructure(typeDVPairs.fromPartial({})), + DVVTriplet: getStructure(typeDVVTriplet.fromPartial({})), + DVVTriplets: getStructure(typeDVVTriplets.fromPartial({})), + Delegation: getStructure(typeDelegation.fromPartial({})), + UnbondingDelegation: getStructure(typeUnbondingDelegation.fromPartial({})), + UnbondingDelegationEntry: getStructure(typeUnbondingDelegationEntry.fromPartial({})), + RedelegationEntry: getStructure(typeRedelegationEntry.fromPartial({})), + Redelegation: getStructure(typeRedelegation.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + DelegationResponse: getStructure(typeDelegationResponse.fromPartial({})), + RedelegationEntryResponse: getStructure(typeRedelegationEntryResponse.fromPartial({})), + RedelegationResponse: getStructure(typeRedelegationResponse.fromPartial({})), + Pool: getStructure(typePool.fromPartial({})), + ValidatorUpdates: getStructure(typeValidatorUpdates.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosStakingV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/registry.ts new file mode 100755 index 0000000000..0b81625356 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/registry.ts @@ -0,0 +1,20 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgCancelUnbondingDelegation } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], + ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], + ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], + ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], + ["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], + ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/rest.ts index bd94dab87e..0f7f68e074 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -134,6 +131,94 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Delegation represents the bond with tokens held by an account. It is +owned by one delegator, and is associated with the voting power of one +validator. +*/ +export interface Stakingv1Beta1Delegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + + /** shares define the delegation shares received. */ + shares?: string; +} + +/** +* HistoricalInfo contains header and validator information for a given block. +It is stored as part of staking module's state, which persists the `n` most +recent HistoricalInfo +(`n` is set by the staking module's `historical_entries` parameter). +*/ +export interface Stakingv1Beta1HistoricalInfo { + /** Header defines the structure of a block header. */ + header?: TypesHeader; + valset?: Stakingv1Beta1Validator[]; +} + +/** + * Params defines the parameters for the x/staking module. + */ +export interface Stakingv1Beta1Params { + /** unbonding_time is the time duration of unbonding. */ + unbonding_time?: string; + + /** + * max_validators is the maximum number of validators. + * @format int64 + */ + max_validators?: number; + + /** + * max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + * @format int64 + */ + max_entries?: number; + + /** + * historical_entries is the number of historical entries to persist. + * @format int64 + */ + historical_entries?: number; + + /** bond_denom defines the bondable coin denomination. */ + bond_denom?: string; + + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + min_commission_rate?: string; +} + +/** +* Pool is used for tracking bonded and not-bonded token supply of the bond +denomination. +*/ +export interface Stakingv1Beta1Pool { + not_bonded_tokens?: string; + bonded_tokens?: string; +} + +/** +* UnbondingDelegation stores all of a single delegator's unbonding bonds +for a single validator in an time-ordered list. +*/ +export interface Stakingv1Beta1UnbondingDelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + + /** + * entries are the unbonding delegation entries. + * + * unbonding delegation entries + */ + entries?: V1Beta1UnbondingDelegationEntry[]; +} + /** * Validator defines a validator, together with the total amount of the Validator's bond shares and their exchange rate to coins. Slashing results in @@ -181,8 +266,21 @@ export interface Stakingv1Beta1Validator { /** commission defines the commission parameters. */ commission?: V1Beta1Commission; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ min_self_delegation?: string; + + /** + * strictly positive if this validator's unbonding has been stopped by external modules + * @format int64 + */ + unbonding_on_hold_ref_count?: string; + + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbonding_ids?: string[]; } export interface TypesBlockID { @@ -192,10 +290,11 @@ export interface TypesBlockID { } /** - * Header defines the structure of a Tendermint block header. + * Header defines the structure of a block header. */ export interface TypesHeader { /** + * basic block info * Consensus captures the consensus rules for processing a block in the blockchain, * including all blockchain data structures and the rules of the application's * state transition machine. @@ -208,42 +307,65 @@ export interface TypesHeader { /** @format date-time */ time?: string; + + /** prev block info */ last_block_id?: TypesBlockID; /** + * hashes of block data * commit from validators from the last block * @format byte */ last_commit_hash?: string; - /** @format byte */ + /** + * transactions + * @format byte + */ data_hash?: string; /** + * hashes from the app output from the prev block * validators for the current block * @format byte */ validators_hash?: string; - /** @format byte */ + /** + * validators for the next block + * @format byte + */ next_validators_hash?: string; - /** @format byte */ + /** + * consensus params for current block + * @format byte + */ consensus_hash?: string; - /** @format byte */ + /** + * state after txs from the previous block + * @format byte + */ app_hash?: string; - /** @format byte */ + /** + * root hash of all results from the txs from the previous block + * @format byte + */ last_results_hash?: string; /** + * consensus info * evidence included in the block * @format byte */ evidence_hash?: string; - /** @format byte */ + /** + * original proposer of the block + * @format byte + */ proposer_address?: string; } @@ -310,22 +432,6 @@ export interface V1Beta1CommissionRates { max_change_rate?: string; } -/** -* Delegation represents the bond with tokens held by an account. It is -owned by one delegator, and is associated with the voting power of one -validator. -*/ -export interface V1Beta1Delegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** shares define the delegation shares received. */ - shares?: string; -} - /** * DelegationResponse is equivalent to Delegation except that it contains a balance in addition to shares which is more suitable for client responses. @@ -336,7 +442,7 @@ export interface V1Beta1DelegationResponse { * owned by one delegator, and is associated with the voting power of one * validator. */ - delegation?: V1Beta1Delegation; + delegation?: Stakingv1Beta1Delegation; /** * Coin defines a token with a denomination and an amount. @@ -367,18 +473,6 @@ export interface V1Beta1Description { details?: string; } -/** -* HistoricalInfo contains header and validator information for a given block. -It is stored as part of staking module's state, which persists the `n` most -recent HistoricalInfo -(`n` is set by the staking module's `historical_entries` parameter). -*/ -export interface V1Beta1HistoricalInfo { - /** Header defines the structure of a Tendermint block header. */ - header?: TypesHeader; - valset?: Stakingv1Beta1Validator[]; -} - /** * MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ @@ -387,6 +481,11 @@ export interface V1Beta1MsgBeginRedelegateResponse { completion_time?: string; } +/** + * Since: cosmos-sdk 0.46 + */ +export type V1Beta1MsgCancelUnbondingDelegationResponse = object; + /** * MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ @@ -410,6 +509,14 @@ export interface V1Beta1MsgUndelegateResponse { completion_time?: string; } +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * message SomeRequest { Foo some_parameter = 1; @@ -466,49 +573,20 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ - next_key?: string; - - /** @format uint64 */ - total?: string; -} - -/** - * Params defines the parameters for the staking module. - */ -export interface V1Beta1Params { - /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: string; - - /** - * max_validators is the maximum number of validators. - * @format int64 - */ - max_validators?: number; - /** - * max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - * @format int64 + * 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. + * @format byte */ - max_entries?: number; + next_key?: string; /** - * historical_entries is the number of historical entries to persist. - * @format int64 + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 */ - historical_entries?: number; - - /** bond_denom defines the bondable coin denomination. */ - bond_denom?: string; -} - -/** -* Pool is used for tracking bonded and not-bonded token supply of the bond -denomination. -*/ -export interface V1Beta1Pool { - not_bonded_tokens?: string; - bonded_tokens?: string; + total?: string; } /** @@ -536,7 +614,7 @@ export interface V1Beta1QueryDelegatorDelegationsResponse { Query/UnbondingDelegatorDelegations RPC method. */ export interface V1Beta1QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses?: V1Beta1UnbondingDelegation[]; + unbonding_responses?: Stakingv1Beta1UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -547,7 +625,7 @@ export interface V1Beta1QueryDelegatorUnbondingDelegationsResponse { Query/DelegatorValidator RPC method. */ export interface V1Beta1QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator?: Stakingv1Beta1Validator; } @@ -556,7 +634,7 @@ export interface V1Beta1QueryDelegatorValidatorResponse { Query/DelegatorValidators RPC method. */ export interface V1Beta1QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators?: Stakingv1Beta1Validator[]; /** pagination defines the pagination in the response. */ @@ -569,7 +647,7 @@ method. */ export interface V1Beta1QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist?: V1Beta1HistoricalInfo; + hist?: Stakingv1Beta1HistoricalInfo; } /** @@ -577,7 +655,7 @@ export interface V1Beta1QueryHistoricalInfoResponse { */ export interface V1Beta1QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: V1Beta1Params; + params?: Stakingv1Beta1Params; } /** @@ -585,7 +663,7 @@ export interface V1Beta1QueryParamsResponse { */ export interface V1Beta1QueryPoolResponse { /** pool defines the pool info. */ - pool?: V1Beta1Pool; + pool?: Stakingv1Beta1Pool; } /** @@ -605,7 +683,7 @@ RPC method. */ export interface V1Beta1QueryUnbondingDelegationResponse { /** unbond defines the unbonding information of a delegation. */ - unbond?: V1Beta1UnbondingDelegation; + unbond?: Stakingv1Beta1UnbondingDelegation; } export interface V1Beta1QueryValidatorDelegationsResponse { @@ -616,7 +694,7 @@ export interface V1Beta1QueryValidatorDelegationsResponse { } export interface V1Beta1QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator?: Stakingv1Beta1Validator; } @@ -625,7 +703,7 @@ export interface V1Beta1QueryValidatorResponse { Query/ValidatorUnbondingDelegations RPC method. */ export interface V1Beta1QueryValidatorUnbondingDelegationsResponse { - unbonding_responses?: V1Beta1UnbondingDelegation[]; + unbonding_responses?: Stakingv1Beta1UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -682,6 +760,18 @@ export interface V1Beta1RedelegationEntry { /** shares_dst is the amount of destination-validator shares created by redelegation. */ shares_dst?: string; + + /** + * Incrementing id that uniquely identifies this entry + * @format uint64 + */ + unbonding_id?: string; + + /** + * Strictly positive if this entry's unbonding has been stopped by external modules + * @format int64 + */ + unbonding_on_hold_ref_count?: string; } /** @@ -709,25 +799,6 @@ export interface V1Beta1RedelegationResponse { entries?: V1Beta1RedelegationEntryResponse[]; } -/** -* UnbondingDelegation stores all of a single delegator's unbonding bonds -for a single validator in an time-ordered list. -*/ -export interface V1Beta1UnbondingDelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** - * entries are the unbonding delegation entries. - * - * unbonding delegation entries - */ - entries?: V1Beta1UnbondingDelegationEntry[]; -} - /** * UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ @@ -749,6 +820,18 @@ export interface V1Beta1UnbondingDelegationEntry { /** balance defines the tokens to receive at completion. */ balance?: string; + + /** + * Incrementing id that uniquely identifies this entry + * @format uint64 + */ + unbonding_id?: string; + + /** + * Strictly positive if this entry's unbonding has been stopped by external modules + * @format int64 + */ + unbonding_on_hold_ref_count?: string; } /** @@ -764,10 +847,11 @@ export interface VersionConsensus { app?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -777,30 +861,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -808,149 +883,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -961,7 +973,7 @@ export class HttpClient { */ export class Api extends HttpClient { /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryDelegatorDelegations @@ -969,7 +981,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/cosmos/staking/v1beta1/delegations/${delegator_addr}`, + path: `/cosmos/staking/v1beta1/delegations/${delegatorAddr}`, method: "GET", query: query, format: "json", @@ -988,7 +1000,7 @@ export class Api extends HttpClient extends HttpClient extends HttpClient this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/redelegations`, + path: `/cosmos/staking/v1beta1/delegators/${delegatorAddr}/redelegations`, method: "GET", query: query, format: "json", @@ -1017,7 +1029,7 @@ export class Api extends HttpClient this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/unbonding_delegations`, + path: `/cosmos/staking/v1beta1/delegators/${delegatorAddr}/unbonding_delegations`, method: "GET", query: query, format: "json", @@ -1045,7 +1057,7 @@ delegator address. }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryDelegatorValidators @@ -1054,7 +1066,7 @@ address. * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators */ queryDelegatorValidators = ( - delegator_addr: string, + delegatorAddr: string, query?: { "pagination.key"?: string; "pagination.offset"?: string; @@ -1065,7 +1077,7 @@ address. params: RequestParams = {}, ) => this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/validators`, + path: `/cosmos/staking/v1beta1/delegators/${delegatorAddr}/validators`, method: "GET", query: query, format: "json", @@ -1081,9 +1093,9 @@ address. pair. * @request GET:/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} */ - queryDelegatorValidator = (delegator_addr: string, validator_addr: string, params: RequestParams = {}) => + queryDelegatorValidator = (delegatorAddr: string, validatorAddr: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/staking/v1beta1/delegators/${delegator_addr}/validators/${validator_addr}`, + path: `/cosmos/staking/v1beta1/delegators/${delegatorAddr}/validators/${validatorAddr}`, method: "GET", format: "json", ...params, @@ -1138,7 +1150,7 @@ pair. }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryValidators @@ -1172,16 +1184,16 @@ pair. * @summary Validator queries validator info for given validator address. * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr} */ - queryValidator = (validator_addr: string, params: RequestParams = {}) => + queryValidator = (validatorAddr: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}`, + path: `/cosmos/staking/v1beta1/validators/${validatorAddr}`, method: "GET", format: "json", ...params, }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryValidatorDelegations @@ -1189,7 +1201,7 @@ pair. * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations */ queryValidatorDelegations = ( - validator_addr: string, + validatorAddr: string, query?: { "pagination.key"?: string; "pagination.offset"?: string; @@ -1200,7 +1212,7 @@ pair. params: RequestParams = {}, ) => this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations`, + path: `/cosmos/staking/v1beta1/validators/${validatorAddr}/delegations`, method: "GET", query: query, format: "json", @@ -1215,9 +1227,9 @@ pair. * @summary Delegation queries delegate info for given validator delegator pair. * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} */ - queryDelegation = (validator_addr: string, delegator_addr: string, params: RequestParams = {}) => + queryDelegation = (validatorAddr: string, delegatorAddr: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations/${delegator_addr}`, + path: `/cosmos/staking/v1beta1/validators/${validatorAddr}/delegations/${delegatorAddr}`, method: "GET", format: "json", ...params, @@ -1232,16 +1244,16 @@ pair. pair. * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation */ - queryUnbondingDelegation = (validator_addr: string, delegator_addr: string, params: RequestParams = {}) => + queryUnbondingDelegation = (validatorAddr: string, delegatorAddr: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/delegations/${delegator_addr}/unbonding_delegation`, + path: `/cosmos/staking/v1beta1/validators/${validatorAddr}/delegations/${delegatorAddr}/unbonding_delegation`, method: "GET", format: "json", ...params, }); /** - * No description + * @description When called from another module, this query might consume a high amount of gas if the pagination field is incorrectly set. * * @tags Query * @name QueryValidatorUnbondingDelegations @@ -1249,7 +1261,7 @@ pair. * @request GET:/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations */ queryValidatorUnbondingDelegations = ( - validator_addr: string, + validatorAddr: string, query?: { "pagination.key"?: string; "pagination.offset"?: string; @@ -1260,7 +1272,7 @@ pair. params: RequestParams = {}, ) => this.request({ - path: `/cosmos/staking/v1beta1/validators/${validator_addr}/unbonding_delegations`, + path: `/cosmos/staking/v1beta1/validators/${validatorAddr}/unbonding_delegations`, method: "GET", query: query, format: "json", diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types.ts new file mode 100755 index 0000000000..0db0c8e952 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +import { StakeAuthorization } from "./types/cosmos/staking/v1beta1/authz" +import { StakeAuthorization_Validators } from "./types/cosmos/staking/v1beta1/authz" +import { LastValidatorPower } from "./types/cosmos/staking/v1beta1/genesis" +import { HistoricalInfo } from "./types/cosmos/staking/v1beta1/staking" +import { CommissionRates } from "./types/cosmos/staking/v1beta1/staking" +import { Commission } from "./types/cosmos/staking/v1beta1/staking" +import { Description } from "./types/cosmos/staking/v1beta1/staking" +import { Validator } from "./types/cosmos/staking/v1beta1/staking" +import { ValAddresses } from "./types/cosmos/staking/v1beta1/staking" +import { DVPair } from "./types/cosmos/staking/v1beta1/staking" +import { DVPairs } from "./types/cosmos/staking/v1beta1/staking" +import { DVVTriplet } from "./types/cosmos/staking/v1beta1/staking" +import { DVVTriplets } from "./types/cosmos/staking/v1beta1/staking" +import { Delegation } from "./types/cosmos/staking/v1beta1/staking" +import { UnbondingDelegation } from "./types/cosmos/staking/v1beta1/staking" +import { UnbondingDelegationEntry } from "./types/cosmos/staking/v1beta1/staking" +import { RedelegationEntry } from "./types/cosmos/staking/v1beta1/staking" +import { Redelegation } from "./types/cosmos/staking/v1beta1/staking" +import { Params } from "./types/cosmos/staking/v1beta1/staking" +import { DelegationResponse } from "./types/cosmos/staking/v1beta1/staking" +import { RedelegationEntryResponse } from "./types/cosmos/staking/v1beta1/staking" +import { RedelegationResponse } from "./types/cosmos/staking/v1beta1/staking" +import { Pool } from "./types/cosmos/staking/v1beta1/staking" +import { ValidatorUpdates } from "./types/cosmos/staking/v1beta1/staking" + + +export { + StakeAuthorization, + StakeAuthorization_Validators, + LastValidatorPower, + HistoricalInfo, + CommissionRates, + Commission, + Description, + Validator, + ValAddresses, + DVPair, + DVPairs, + DVVTriplet, + DVVTriplets, + Delegation, + UnbondingDelegation, + UnbondingDelegationEntry, + RedelegationEntry, + Redelegation, + Params, + DelegationResponse, + RedelegationEntryResponse, + RedelegationResponse, + Pool, + ValidatorUpdates, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/query/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/query/v1/query.ts new file mode 100644 index 0000000000..7539aee060 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/query/v1/query.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.query.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/authz.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/authz.ts index 993c8eef8f..72bf473dbe 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/authz.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/authz.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.staking.v1beta1"; @@ -53,8 +53,9 @@ export function authorizationTypeToJSON(object: AuthorizationType): string { return "AUTHORIZATION_TYPE_UNDELEGATE"; case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: return "AUTHORIZATION_TYPE_REDELEGATE"; + case AuthorizationType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -68,16 +69,22 @@ export interface StakeAuthorization { * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is * empty, there is no spend limit and any amount of coins can be delegated. */ - max_tokens: Coin | undefined; + maxTokens: + | Coin + | undefined; /** * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's * account. */ - allow_list: StakeAuthorization_Validators | undefined; + allowList: + | StakeAuthorization_Validators + | undefined; /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ - deny_list: StakeAuthorization_Validators | undefined; + denyList: + | StakeAuthorization_Validators + | undefined; /** authorization_type defines one of AuthorizationType. */ - authorization_type: AuthorizationType; + authorizationType: AuthorizationType; } /** Validators defines list of validator addresses. */ @@ -85,58 +92,45 @@ export interface StakeAuthorization_Validators { address: string[]; } -const baseStakeAuthorization: object = { authorization_type: 0 }; +function createBaseStakeAuthorization(): StakeAuthorization { + return { maxTokens: undefined, allowList: undefined, denyList: undefined, authorizationType: 0 }; +} export const StakeAuthorization = { - encode( - message: StakeAuthorization, - writer: Writer = Writer.create() - ): Writer { - if (message.max_tokens !== undefined) { - Coin.encode(message.max_tokens, writer.uint32(10).fork()).ldelim(); + encode(message: StakeAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxTokens !== undefined) { + Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); } - if (message.allow_list !== undefined) { - StakeAuthorization_Validators.encode( - message.allow_list, - writer.uint32(18).fork() - ).ldelim(); + if (message.allowList !== undefined) { + StakeAuthorization_Validators.encode(message.allowList, writer.uint32(18).fork()).ldelim(); } - if (message.deny_list !== undefined) { - StakeAuthorization_Validators.encode( - message.deny_list, - writer.uint32(26).fork() - ).ldelim(); + if (message.denyList !== undefined) { + StakeAuthorization_Validators.encode(message.denyList, writer.uint32(26).fork()).ldelim(); } - if (message.authorization_type !== 0) { - writer.uint32(32).int32(message.authorization_type); + if (message.authorizationType !== 0) { + writer.uint32(32).int32(message.authorizationType); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): StakeAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStakeAuthorization } as StakeAuthorization; + const message = createBaseStakeAuthorization(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_tokens = Coin.decode(reader, reader.uint32()); + message.maxTokens = Coin.decode(reader, reader.uint32()); break; case 2: - message.allow_list = StakeAuthorization_Validators.decode( - reader, - reader.uint32() - ); + message.allowList = StakeAuthorization_Validators.decode(reader, reader.uint32()); break; case 3: - message.deny_list = StakeAuthorization_Validators.decode( - reader, - reader.uint32() - ); + message.denyList = StakeAuthorization_Validators.decode(reader, reader.uint32()); break; case 4: - message.authorization_type = reader.int32() as any; + message.authorizationType = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -147,116 +141,58 @@ export const StakeAuthorization = { }, fromJSON(object: any): StakeAuthorization { - const message = { ...baseStakeAuthorization } as StakeAuthorization; - if (object.max_tokens !== undefined && object.max_tokens !== null) { - message.max_tokens = Coin.fromJSON(object.max_tokens); - } else { - message.max_tokens = undefined; - } - if (object.allow_list !== undefined && object.allow_list !== null) { - message.allow_list = StakeAuthorization_Validators.fromJSON( - object.allow_list - ); - } else { - message.allow_list = undefined; - } - if (object.deny_list !== undefined && object.deny_list !== null) { - message.deny_list = StakeAuthorization_Validators.fromJSON( - object.deny_list - ); - } else { - message.deny_list = undefined; - } - if ( - object.authorization_type !== undefined && - object.authorization_type !== null - ) { - message.authorization_type = authorizationTypeFromJSON( - object.authorization_type - ); - } else { - message.authorization_type = 0; - } - return message; + return { + maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, + allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, + denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0, + }; }, toJSON(message: StakeAuthorization): unknown { const obj: any = {}; - message.max_tokens !== undefined && - (obj.max_tokens = message.max_tokens - ? Coin.toJSON(message.max_tokens) - : undefined); - message.allow_list !== undefined && - (obj.allow_list = message.allow_list - ? StakeAuthorization_Validators.toJSON(message.allow_list) - : undefined); - message.deny_list !== undefined && - (obj.deny_list = message.deny_list - ? StakeAuthorization_Validators.toJSON(message.deny_list) - : undefined); - message.authorization_type !== undefined && - (obj.authorization_type = authorizationTypeToJSON( - message.authorization_type - )); + message.maxTokens !== undefined && (obj.maxTokens = message.maxTokens ? Coin.toJSON(message.maxTokens) : undefined); + message.allowList !== undefined + && (obj.allowList = message.allowList ? StakeAuthorization_Validators.toJSON(message.allowList) : undefined); + message.denyList !== undefined + && (obj.denyList = message.denyList ? StakeAuthorization_Validators.toJSON(message.denyList) : undefined); + message.authorizationType !== undefined + && (obj.authorizationType = authorizationTypeToJSON(message.authorizationType)); return obj; }, - fromPartial(object: DeepPartial): StakeAuthorization { - const message = { ...baseStakeAuthorization } as StakeAuthorization; - if (object.max_tokens !== undefined && object.max_tokens !== null) { - message.max_tokens = Coin.fromPartial(object.max_tokens); - } else { - message.max_tokens = undefined; - } - if (object.allow_list !== undefined && object.allow_list !== null) { - message.allow_list = StakeAuthorization_Validators.fromPartial( - object.allow_list - ); - } else { - message.allow_list = undefined; - } - if (object.deny_list !== undefined && object.deny_list !== null) { - message.deny_list = StakeAuthorization_Validators.fromPartial( - object.deny_list - ); - } else { - message.deny_list = undefined; - } - if ( - object.authorization_type !== undefined && - object.authorization_type !== null - ) { - message.authorization_type = object.authorization_type; - } else { - message.authorization_type = 0; - } + fromPartial, I>>(object: I): StakeAuthorization { + const message = createBaseStakeAuthorization(); + message.maxTokens = (object.maxTokens !== undefined && object.maxTokens !== null) + ? Coin.fromPartial(object.maxTokens) + : undefined; + message.allowList = (object.allowList !== undefined && object.allowList !== null) + ? StakeAuthorization_Validators.fromPartial(object.allowList) + : undefined; + message.denyList = (object.denyList !== undefined && object.denyList !== null) + ? StakeAuthorization_Validators.fromPartial(object.denyList) + : undefined; + message.authorizationType = object.authorizationType ?? 0; return message; }, }; -const baseStakeAuthorization_Validators: object = { address: "" }; +function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validators { + return { address: [] }; +} export const StakeAuthorization_Validators = { - encode( - message: StakeAuthorization_Validators, - writer: Writer = Writer.create() - ): Writer { + encode(message: StakeAuthorization_Validators, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.address) { writer.uint32(10).string(v!); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): StakeAuthorization_Validators { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization_Validators { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; + const message = createBaseStakeAuthorization_Validators(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -272,16 +208,7 @@ export const StakeAuthorization_Validators = { }, fromJSON(object: any): StakeAuthorization_Validators { - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; - if (object.address !== undefined && object.address !== null) { - for (const e of object.address) { - message.address.push(String(e)); - } - } - return message; + return { address: Array.isArray(object?.address) ? object.address.map((e: any) => String(e)) : [] }; }, toJSON(message: StakeAuthorization_Validators): unknown { @@ -294,29 +221,26 @@ export const StakeAuthorization_Validators = { return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): StakeAuthorization_Validators { - const message = { - ...baseStakeAuthorization_Validators, - } as StakeAuthorization_Validators; - message.address = []; - if (object.address !== undefined && object.address !== null) { - for (const e of object.address) { - message.address.push(e); - } - } + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map((e) => e) || []; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts index 89dc9e24fe..0db586c31e 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts @@ -1,37 +1,33 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Params, - Validator, - Delegation, - UnbondingDelegation, - Redelegation, -} from "../../../cosmos/staking/v1beta1/staking"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Delegation, Params, Redelegation, UnbondingDelegation, Validator } from "./staking"; export const protobufPackage = "cosmos.staking.v1beta1"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ - params: Params | undefined; + /** params defines all the parameters of related to deposit. */ + params: + | Params + | undefined; /** * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - last_total_power: Uint8Array; + lastTotalPower: Uint8Array; /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. */ - last_validator_powers: LastValidatorPower[]; + lastValidatorPowers: LastValidatorPower[]; /** delegations defines the validator set at genesis. */ validators: Validator[]; /** delegations defines the delegations active at genesis. */ delegations: Delegation[]; /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbonding_delegations: UnbondingDelegation[]; + unbondingDelegations: UnbondingDelegation[]; /** redelegations defines the redelegations active at genesis. */ redelegations: Redelegation[]; exported: boolean; @@ -45,17 +41,28 @@ export interface LastValidatorPower { power: number; } -const baseGenesisState: object = { exported: false }; +function createBaseGenesisState(): GenesisState { + return { + params: undefined, + lastTotalPower: new Uint8Array(), + lastValidatorPowers: [], + validators: [], + delegations: [], + unbondingDelegations: [], + redelegations: [], + exported: false, + }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - if (message.last_total_power.length !== 0) { - writer.uint32(18).bytes(message.last_total_power); + if (message.lastTotalPower.length !== 0) { + writer.uint32(18).bytes(message.lastTotalPower); } - for (const v of message.last_validator_powers) { + for (const v of message.lastValidatorPowers) { LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim(); } for (const v of message.validators) { @@ -64,7 +71,7 @@ export const GenesisState = { for (const v of message.delegations) { Delegation.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.unbonding_delegations) { + for (const v of message.unbondingDelegations) { UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim(); } for (const v of message.redelegations) { @@ -76,15 +83,10 @@ export const GenesisState = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -92,12 +94,10 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.last_total_power = reader.bytes(); + message.lastTotalPower = reader.bytes(); break; case 3: - message.last_validator_powers.push( - LastValidatorPower.decode(reader, reader.uint32()) - ); + message.lastValidatorPowers.push(LastValidatorPower.decode(reader, reader.uint32())); break; case 4: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -106,14 +106,10 @@ export const GenesisState = { message.delegations.push(Delegation.decode(reader, reader.uint32())); break; case 6: - message.unbonding_delegations.push( - UnbondingDelegation.decode(reader, reader.uint32()) - ); + message.unbondingDelegations.push(UnbondingDelegation.decode(reader, reader.uint32())); break; case 7: - message.redelegations.push( - Redelegation.decode(reader, reader.uint32()) - ); + message.redelegations.push(Redelegation.decode(reader, reader.uint32())); break; case 8: message.exported = reader.bool(); @@ -127,104 +123,53 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if ( - object.last_total_power !== undefined && - object.last_total_power !== null - ) { - message.last_total_power = bytesFromBase64(object.last_total_power); - } - if ( - object.last_validator_powers !== undefined && - object.last_validator_powers !== null - ) { - for (const e of object.last_validator_powers) { - message.last_validator_powers.push(LastValidatorPower.fromJSON(e)); - } - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.delegations !== undefined && object.delegations !== null) { - for (const e of object.delegations) { - message.delegations.push(Delegation.fromJSON(e)); - } - } - if ( - object.unbonding_delegations !== undefined && - object.unbonding_delegations !== null - ) { - for (const e of object.unbonding_delegations) { - message.unbonding_delegations.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.redelegations !== undefined && object.redelegations !== null) { - for (const e of object.redelegations) { - message.redelegations.push(Redelegation.fromJSON(e)); - } - } - if (object.exported !== undefined && object.exported !== null) { - message.exported = Boolean(object.exported); - } else { - message.exported = false; - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + lastTotalPower: isSet(object.lastTotalPower) ? bytesFromBase64(object.lastTotalPower) : new Uint8Array(), + lastValidatorPowers: Array.isArray(object?.lastValidatorPowers) + ? object.lastValidatorPowers.map((e: any) => LastValidatorPower.fromJSON(e)) + : [], + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + delegations: Array.isArray(object?.delegations) ? object.delegations.map((e: any) => Delegation.fromJSON(e)) : [], + unbondingDelegations: Array.isArray(object?.unbondingDelegations) + ? object.unbondingDelegations.map((e: any) => UnbondingDelegation.fromJSON(e)) + : [], + redelegations: Array.isArray(object?.redelegations) + ? object.redelegations.map((e: any) => Redelegation.fromJSON(e)) + : [], + exported: isSet(object.exported) ? Boolean(object.exported) : false, + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.last_total_power !== undefined && - (obj.last_total_power = base64FromBytes( - message.last_total_power !== undefined - ? message.last_total_power - : new Uint8Array() + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.lastTotalPower !== undefined + && (obj.lastTotalPower = base64FromBytes( + message.lastTotalPower !== undefined ? message.lastTotalPower : new Uint8Array(), )); - if (message.last_validator_powers) { - obj.last_validator_powers = message.last_validator_powers.map((e) => - e ? LastValidatorPower.toJSON(e) : undefined - ); + if (message.lastValidatorPowers) { + obj.lastValidatorPowers = message.lastValidatorPowers.map((e) => e ? LastValidatorPower.toJSON(e) : undefined); } else { - obj.last_validator_powers = []; + obj.lastValidatorPowers = []; } if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } if (message.delegations) { - obj.delegations = message.delegations.map((e) => - e ? Delegation.toJSON(e) : undefined - ); + obj.delegations = message.delegations.map((e) => e ? Delegation.toJSON(e) : undefined); } else { obj.delegations = []; } - if (message.unbonding_delegations) { - obj.unbonding_delegations = message.unbonding_delegations.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); + if (message.unbondingDelegations) { + obj.unbondingDelegations = message.unbondingDelegations.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); } else { - obj.unbonding_delegations = []; + obj.unbondingDelegations = []; } if (message.redelegations) { - obj.redelegations = message.redelegations.map((e) => - e ? Redelegation.toJSON(e) : undefined - ); + obj.redelegations = message.redelegations.map((e) => e ? Redelegation.toJSON(e) : undefined); } else { obj.redelegations = []; } @@ -232,73 +177,28 @@ export const GenesisState = { return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.last_validator_powers = []; - message.validators = []; - message.delegations = []; - message.unbonding_delegations = []; - message.redelegations = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if ( - object.last_total_power !== undefined && - object.last_total_power !== null - ) { - message.last_total_power = object.last_total_power; - } else { - message.last_total_power = new Uint8Array(); - } - if ( - object.last_validator_powers !== undefined && - object.last_validator_powers !== null - ) { - for (const e of object.last_validator_powers) { - message.last_validator_powers.push(LastValidatorPower.fromPartial(e)); - } - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.delegations !== undefined && object.delegations !== null) { - for (const e of object.delegations) { - message.delegations.push(Delegation.fromPartial(e)); - } - } - if ( - object.unbonding_delegations !== undefined && - object.unbonding_delegations !== null - ) { - for (const e of object.unbonding_delegations) { - message.unbonding_delegations.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.redelegations !== undefined && object.redelegations !== null) { - for (const e of object.redelegations) { - message.redelegations.push(Redelegation.fromPartial(e)); - } - } - if (object.exported !== undefined && object.exported !== null) { - message.exported = object.exported; - } else { - message.exported = false; - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.lastTotalPower = object.lastTotalPower ?? new Uint8Array(); + message.lastValidatorPowers = object.lastValidatorPowers?.map((e) => LastValidatorPower.fromPartial(e)) || []; + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.delegations = object.delegations?.map((e) => Delegation.fromPartial(e)) || []; + message.unbondingDelegations = object.unbondingDelegations?.map((e) => UnbondingDelegation.fromPartial(e)) || []; + message.redelegations = object.redelegations?.map((e) => Redelegation.fromPartial(e)) || []; + message.exported = object.exported ?? false; return message; }, }; -const baseLastValidatorPower: object = { address: "", power: 0 }; +function createBaseLastValidatorPower(): LastValidatorPower { + return { address: "", power: 0 }; +} export const LastValidatorPower = { - encode( - message: LastValidatorPower, - writer: Writer = Writer.create() - ): Writer { + encode(message: LastValidatorPower, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -308,10 +208,10 @@ export const LastValidatorPower = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): LastValidatorPower { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LastValidatorPower { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLastValidatorPower } as LastValidatorPower; + const message = createBaseLastValidatorPower(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -330,87 +230,82 @@ export const LastValidatorPower = { }, fromJSON(object: any): LastValidatorPower { - const message = { ...baseLastValidatorPower } as LastValidatorPower; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + power: isSet(object.power) ? Number(object.power) : 0, + }; }, toJSON(message: LastValidatorPower): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.power !== undefined && (obj.power = message.power); + message.power !== undefined && (obj.power = Math.round(message.power)); return obj; }, - fromPartial(object: DeepPartial): LastValidatorPower { - const message = { ...baseLastValidatorPower } as LastValidatorPower; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } + fromPartial, I>>(object: I): LastValidatorPower { + const message = createBaseLastValidatorPower(); + message.address = object.address ?? ""; + message.power = object.power ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -418,7 +313,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts index acd46ec191..faf5b71780 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts @@ -1,20 +1,17 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { - Validator, DelegationResponse, - UnbondingDelegation, - RedelegationResponse, HistoricalInfo, - Pool, Params, -} from "../../../cosmos/staking/v1beta1/staking"; + Pool, + RedelegationResponse, + UnbondingDelegation, + Validator, +} from "./staking"; export const protobufPackage = "cosmos.staking.v1beta1"; @@ -37,12 +34,12 @@ export interface QueryValidatorsResponse { /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequest { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator | undefined; } @@ -52,7 +49,7 @@ export interface QueryValidatorResponse { */ export interface QueryValidatorDelegationsRequest { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -62,7 +59,7 @@ export interface QueryValidatorDelegationsRequest { * Query/ValidatorDelegations RPC method */ export interface QueryValidatorDelegationsResponse { - delegation_responses: DelegationResponse[]; + delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -73,7 +70,7 @@ export interface QueryValidatorDelegationsResponse { */ export interface QueryValidatorUnbondingDelegationsRequest { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -83,7 +80,7 @@ export interface QueryValidatorUnbondingDelegationsRequest { * Query/ValidatorUnbondingDelegations RPC method. */ export interface QueryValidatorUnbondingDelegationsResponse { - unbonding_responses: UnbondingDelegation[]; + unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -91,15 +88,15 @@ export interface QueryValidatorUnbondingDelegationsResponse { /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponse { /** delegation_responses defines the delegation info of a delegation. */ - delegation_response: DelegationResponse | undefined; + delegationResponse: DelegationResponse | undefined; } /** @@ -108,9 +105,9 @@ export interface QueryDelegationResponse { */ export interface QueryUnbondingDelegationRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; } /** @@ -128,7 +125,7 @@ export interface QueryUnbondingDelegationResponse { */ export interface QueryDelegatorDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -139,7 +136,7 @@ export interface QueryDelegatorDelegationsRequest { */ export interface QueryDelegatorDelegationsResponse { /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses: DelegationResponse[]; + delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -150,7 +147,7 @@ export interface QueryDelegatorDelegationsResponse { */ export interface QueryDelegatorUnbondingDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -160,7 +157,7 @@ export interface QueryDelegatorUnbondingDelegationsRequest { * Query/UnbondingDelegatorDelegations RPC method. */ export interface QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses: UnbondingDelegation[]; + unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -171,11 +168,11 @@ export interface QueryDelegatorUnbondingDelegationsResponse { */ export interface QueryRedelegationsRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr: string; + srcValidatorAddr: string; /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr: string; + dstValidatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -185,7 +182,7 @@ export interface QueryRedelegationsRequest { * method. */ export interface QueryRedelegationsResponse { - redelegation_responses: RedelegationResponse[]; + redelegationResponses: RedelegationResponse[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -196,7 +193,7 @@ export interface QueryRedelegationsResponse { */ export interface QueryDelegatorValidatorsRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -206,7 +203,7 @@ export interface QueryDelegatorValidatorsRequest { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; @@ -218,9 +215,9 @@ export interface QueryDelegatorValidatorsResponse { */ export interface QueryDelegatorValidatorRequest { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegatorAddr: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validatorAddr: string; } /** @@ -228,7 +225,7 @@ export interface QueryDelegatorValidatorRequest { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator | undefined; } @@ -251,7 +248,8 @@ export interface QueryHistoricalInfoResponse { } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ -export interface QueryPoolRequest {} +export interface QueryPoolRequest { +} /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponse { @@ -260,7 +258,8 @@ export interface QueryPoolResponse { } /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -268,13 +267,12 @@ export interface QueryParamsResponse { params: Params | undefined; } -const baseQueryValidatorsRequest: object = { status: "" }; +function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { + return { status: "", pagination: undefined }; +} export const QueryValidatorsRequest = { - encode( - message: QueryValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.status !== "") { writer.uint32(10).string(message.status); } @@ -284,10 +282,10 @@ export const QueryValidatorsRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; + const message = createBaseQueryValidatorsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -306,74 +304,49 @@ export const QueryValidatorsRequest = { }, fromJSON(object: any): QueryValidatorsRequest { - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; - if (object.status !== undefined && object.status !== null) { - message.status = String(object.status); - } else { - message.status = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + status: isSet(object.status) ? String(object.status) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorsRequest): unknown { const obj: any = {}; message.status !== undefined && (obj.status = message.status); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryValidatorsRequest { - const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryValidatorsRequest { + const message = createBaseQueryValidatorsRequest(); + message.status = object.status ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorsResponse: object = {}; +function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { + return { validators: [], pagination: undefined }; +} export const QueryValidatorsResponse = { - encode( - message: QueryValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; + const message = createBaseQueryValidatorsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -392,82 +365,55 @@ export const QueryValidatorsResponse = { }, fromJSON(object: any): QueryValidatorsResponse { - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorsResponse): unknown { const obj: any = {}; if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryValidatorsResponse { - const message = { - ...baseQueryValidatorsResponse, - } as QueryValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryValidatorsResponse { + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorRequest: object = { validator_addr: "" }; +function createBaseQueryValidatorRequest(): QueryValidatorRequest { + return { validatorAddr: "" }; +} export const QueryValidatorRequest = { - encode( - message: QueryValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); + encode(message: QueryValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; + const message = createBaseQueryValidatorRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; default: reader.skipType(tag & 7); @@ -478,52 +424,38 @@ export const QueryValidatorRequest = { }, fromJSON(object: any): QueryValidatorRequest { - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; + return { validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" }; }, toJSON(message: QueryValidatorRequest): unknown { const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial( - object: DeepPartial - ): QueryValidatorRequest { - const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } + fromPartial, I>>(object: I): QueryValidatorRequest { + const message = createBaseQueryValidatorRequest(); + message.validatorAddr = object.validatorAddr ?? ""; return message; }, }; -const baseQueryValidatorResponse: object = {}; +function createBaseQueryValidatorResponse(): QueryValidatorResponse { + return { validator: undefined }; +} export const QueryValidatorResponse = { - encode( - message: QueryValidatorResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; + const message = createBaseQueryValidatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -539,46 +471,33 @@ export const QueryValidatorResponse = { }, fromJSON(object: any): QueryValidatorResponse { - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - return message; + return { validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined }; }, toJSON(message: QueryValidatorResponse): unknown { const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryValidatorResponse { - const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } + fromPartial, I>>(object: I): QueryValidatorResponse { + const message = createBaseQueryValidatorResponse(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; return message; }, }; -const baseQueryValidatorDelegationsRequest: object = { validator_addr: "" }; +function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { + return { validatorAddr: "", pagination: undefined }; +} export const QueryValidatorDelegationsRequest = { - encode( - message: QueryValidatorDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); + encode(message: QueryValidatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -586,20 +505,15 @@ export const QueryValidatorDelegationsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; + const message = createBaseQueryValidatorDelegationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -613,89 +527,56 @@ export const QueryValidatorDelegationsRequest = { }, fromJSON(object: any): QueryValidatorDelegationsRequest { - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorDelegationsRequest): unknown { const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorDelegationsRequest { - const message = { - ...baseQueryValidatorDelegationsRequest, - } as QueryValidatorDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryValidatorDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorDelegationsResponse: object = {}; +function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { + return { delegationResponses: [], pagination: undefined }; +} export const QueryValidatorDelegationsResponse = { - encode( - message: QueryValidatorDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.delegation_responses) { + encode(message: QueryValidatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; + const message = createBaseQueryValidatorDelegationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegation_responses.push( - DelegationResponse.decode(reader, reader.uint32()) - ); + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -709,77 +590,46 @@ export const QueryValidatorDelegationsResponse = { }, fromJSON(object: any): QueryValidatorDelegationsResponse { - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegationResponses: Array.isArray(object?.delegationResponses) + ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorDelegationsResponse): unknown { const obj: any = {}; - if (message.delegation_responses) { - obj.delegation_responses = message.delegation_responses.map((e) => - e ? DelegationResponse.toJSON(e) : undefined - ); + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map((e) => e ? DelegationResponse.toJSON(e) : undefined); } else { - obj.delegation_responses = []; + obj.delegationResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorDelegationsResponse { - const message = { - ...baseQueryValidatorDelegationsResponse, - } as QueryValidatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorUnbondingDelegationsRequest: object = { - validator_addr: "", -}; +function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { + return { validatorAddr: "", pagination: undefined }; +} export const QueryValidatorUnbondingDelegationsRequest = { - encode( - message: QueryValidatorUnbondingDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_addr !== "") { - writer.uint32(10).string(message.validator_addr); + encode(message: QueryValidatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -787,20 +637,15 @@ export const QueryValidatorUnbondingDelegationsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorUnbondingDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -814,89 +659,56 @@ export const QueryValidatorUnbondingDelegationsRequest = { }, fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest { - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown { const obj: any = {}; - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorUnbondingDelegationsRequest { - const message = { - ...baseQueryValidatorUnbondingDelegationsRequest, - } as QueryValidatorUnbondingDelegationsRequest; - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryValidatorUnbondingDelegationsResponse: object = {}; +function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { + return { unbondingResponses: [], pagination: undefined }; +} export const QueryValidatorUnbondingDelegationsResponse = { - encode( - message: QueryValidatorUnbondingDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.unbonding_responses) { + encode(message: QueryValidatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorUnbondingDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.unbonding_responses.push( - UnbondingDelegation.decode(reader, reader.uint32()) - ); + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -910,97 +722,65 @@ export const QueryValidatorUnbondingDelegationsResponse = { }, fromJSON(object: any): QueryValidatorUnbondingDelegationsResponse { - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + unbondingResponses: Array.isArray(object?.unbondingResponses) + ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown { const obj: any = {}; - if (message.unbonding_responses) { - obj.unbonding_responses = message.unbonding_responses.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); } else { - obj.unbonding_responses = []; + obj.unbondingResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryValidatorUnbondingDelegationsResponse { - const message = { - ...baseQueryValidatorUnbondingDelegationsResponse, - } as QueryValidatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegationRequest: object = { - delegator_addr: "", - validator_addr: "", -}; +function createBaseQueryDelegationRequest(): QueryDelegationRequest { + return { delegatorAddr: "", validatorAddr: "" }; +} export const QueryDelegationRequest = { - encode( - message: QueryDelegationRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDelegationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; + const message = createBaseQueryDelegationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; default: reader.skipType(tag & 7); @@ -1011,77 +791,48 @@ export const QueryDelegationRequest = { }, fromJSON(object: any): QueryDelegationRequest { - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + }; }, toJSON(message: QueryDelegationRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDelegationRequest { - const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } + fromPartial, I>>(object: I): QueryDelegationRequest { + const message = createBaseQueryDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; return message; }, }; -const baseQueryDelegationResponse: object = {}; +function createBaseQueryDelegationResponse(): QueryDelegationResponse { + return { delegationResponse: undefined }; +} export const QueryDelegationResponse = { - encode( - message: QueryDelegationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.delegation_response !== undefined) { - DelegationResponse.encode( - message.delegation_response, - writer.uint32(10).fork() - ).ldelim(); + encode(message: QueryDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegationResponse !== undefined) { + DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryDelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; + const message = createBaseQueryDelegationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegation_response = DelegationResponse.decode( - reader, - reader.uint32() - ); + message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1092,87 +843,57 @@ export const QueryDelegationResponse = { }, fromJSON(object: any): QueryDelegationResponse { - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; - if ( - object.delegation_response !== undefined && - object.delegation_response !== null - ) { - message.delegation_response = DelegationResponse.fromJSON( - object.delegation_response - ); - } else { - message.delegation_response = undefined; - } - return message; + return { + delegationResponse: isSet(object.delegationResponse) + ? DelegationResponse.fromJSON(object.delegationResponse) + : undefined, + }; }, toJSON(message: QueryDelegationResponse): unknown { const obj: any = {}; - message.delegation_response !== undefined && - (obj.delegation_response = message.delegation_response - ? DelegationResponse.toJSON(message.delegation_response) - : undefined); + message.delegationResponse !== undefined && (obj.delegationResponse = message.delegationResponse + ? DelegationResponse.toJSON(message.delegationResponse) + : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryDelegationResponse { - const message = { - ...baseQueryDelegationResponse, - } as QueryDelegationResponse; - if ( - object.delegation_response !== undefined && - object.delegation_response !== null - ) { - message.delegation_response = DelegationResponse.fromPartial( - object.delegation_response - ); - } else { - message.delegation_response = undefined; - } + fromPartial, I>>(object: I): QueryDelegationResponse { + const message = createBaseQueryDelegationResponse(); + message.delegationResponse = (object.delegationResponse !== undefined && object.delegationResponse !== null) + ? DelegationResponse.fromPartial(object.delegationResponse) + : undefined; return message; }, }; -const baseQueryUnbondingDelegationRequest: object = { - delegator_addr: "", - validator_addr: "", -}; +function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { + return { delegatorAddr: "", validatorAddr: "" }; +} export const QueryUnbondingDelegationRequest = { - encode( - message: QueryUnbondingDelegationRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryUnbondingDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnbondingDelegationRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; + const message = createBaseQueryUnbondingDelegationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; default: reader.skipType(tag & 7); @@ -1183,76 +904,45 @@ export const QueryUnbondingDelegationRequest = { }, fromJSON(object: any): QueryUnbondingDelegationRequest { - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + }; }, toJSON(message: QueryUnbondingDelegationRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryUnbondingDelegationRequest { - const message = { - ...baseQueryUnbondingDelegationRequest, - } as QueryUnbondingDelegationRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } + const message = createBaseQueryUnbondingDelegationRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; return message; }, }; -const baseQueryUnbondingDelegationResponse: object = {}; +function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { + return { unbond: undefined }; +} export const QueryUnbondingDelegationResponse = { - encode( - message: QueryUnbondingDelegationResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.unbond !== undefined) { - UnbondingDelegation.encode( - message.unbond, - writer.uint32(10).fork() - ).ldelim(); + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUnbondingDelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; + const message = createBaseQueryUnbondingDelegationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1268,50 +958,35 @@ export const QueryUnbondingDelegationResponse = { }, fromJSON(object: any): QueryUnbondingDelegationResponse { - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; - if (object.unbond !== undefined && object.unbond !== null) { - message.unbond = UnbondingDelegation.fromJSON(object.unbond); - } else { - message.unbond = undefined; - } - return message; + return { unbond: isSet(object.unbond) ? UnbondingDelegation.fromJSON(object.unbond) : undefined }; }, toJSON(message: QueryUnbondingDelegationResponse): unknown { const obj: any = {}; - message.unbond !== undefined && - (obj.unbond = message.unbond - ? UnbondingDelegation.toJSON(message.unbond) - : undefined); + message.unbond !== undefined + && (obj.unbond = message.unbond ? UnbondingDelegation.toJSON(message.unbond) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryUnbondingDelegationResponse { - const message = { - ...baseQueryUnbondingDelegationResponse, - } as QueryUnbondingDelegationResponse; - if (object.unbond !== undefined && object.unbond !== null) { - message.unbond = UnbondingDelegation.fromPartial(object.unbond); - } else { - message.unbond = undefined; - } + const message = createBaseQueryUnbondingDelegationResponse(); + message.unbond = (object.unbond !== undefined && object.unbond !== null) + ? UnbondingDelegation.fromPartial(object.unbond) + : undefined; return message; }, }; -const baseQueryDelegatorDelegationsRequest: object = { delegator_addr: "" }; +function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { + return { delegatorAddr: "", pagination: undefined }; +} export const QueryDelegatorDelegationsRequest = { - encode( - message: QueryDelegatorDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryDelegatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1319,20 +994,15 @@ export const QueryDelegatorDelegationsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; + const message = createBaseQueryDelegatorDelegationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1346,89 +1016,56 @@ export const QueryDelegatorDelegationsRequest = { }, fromJSON(object: any): QueryDelegatorDelegationsRequest { - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorDelegationsRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorDelegationsRequest { - const message = { - ...baseQueryDelegatorDelegationsRequest, - } as QueryDelegatorDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorDelegationsResponse: object = {}; +function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { + return { delegationResponses: [], pagination: undefined }; +} export const QueryDelegatorDelegationsResponse = { - encode( - message: QueryDelegatorDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.delegation_responses) { + encode(message: QueryDelegatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; + const message = createBaseQueryDelegatorDelegationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegation_responses.push( - DelegationResponse.decode(reader, reader.uint32()) - ); + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1442,77 +1079,46 @@ export const QueryDelegatorDelegationsResponse = { }, fromJSON(object: any): QueryDelegatorDelegationsResponse { - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegationResponses: Array.isArray(object?.delegationResponses) + ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorDelegationsResponse): unknown { const obj: any = {}; - if (message.delegation_responses) { - obj.delegation_responses = message.delegation_responses.map((e) => - e ? DelegationResponse.toJSON(e) : undefined - ); + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map((e) => e ? DelegationResponse.toJSON(e) : undefined); } else { - obj.delegation_responses = []; + obj.delegationResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorDelegationsResponse { - const message = { - ...baseQueryDelegatorDelegationsResponse, - } as QueryDelegatorDelegationsResponse; - message.delegation_responses = []; - if ( - object.delegation_responses !== undefined && - object.delegation_responses !== null - ) { - for (const e of object.delegation_responses) { - message.delegation_responses.push(DelegationResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorUnbondingDelegationsRequest: object = { - delegator_addr: "", -}; +function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { + return { delegatorAddr: "", pagination: undefined }; +} export const QueryDelegatorUnbondingDelegationsRequest = { - encode( - message: QueryDelegatorUnbondingDelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1520,20 +1126,15 @@ export const QueryDelegatorUnbondingDelegationsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorUnbondingDelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1547,89 +1148,56 @@ export const QueryDelegatorUnbondingDelegationsRequest = { }, fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest { - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorUnbondingDelegationsRequest { - const message = { - ...baseQueryDelegatorUnbondingDelegationsRequest, - } as QueryDelegatorUnbondingDelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorUnbondingDelegationsResponse: object = {}; +function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { + return { unbondingResponses: [], pagination: undefined }; +} export const QueryDelegatorUnbondingDelegationsResponse = { - encode( - message: QueryDelegatorUnbondingDelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.unbonding_responses) { + encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorUnbondingDelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.unbonding_responses.push( - UnbondingDelegation.decode(reader, reader.uint32()) - ); + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1643,85 +1211,52 @@ export const QueryDelegatorUnbondingDelegationsResponse = { }, fromJSON(object: any): QueryDelegatorUnbondingDelegationsResponse { - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + unbondingResponses: Array.isArray(object?.unbondingResponses) + ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown { const obj: any = {}; - if (message.unbonding_responses) { - obj.unbonding_responses = message.unbonding_responses.map((e) => - e ? UnbondingDelegation.toJSON(e) : undefined - ); + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map((e) => e ? UnbondingDelegation.toJSON(e) : undefined); } else { - obj.unbonding_responses = []; + obj.unbondingResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorUnbondingDelegationsResponse { - const message = { - ...baseQueryDelegatorUnbondingDelegationsResponse, - } as QueryDelegatorUnbondingDelegationsResponse; - message.unbonding_responses = []; - if ( - object.unbonding_responses !== undefined && - object.unbonding_responses !== null - ) { - for (const e of object.unbonding_responses) { - message.unbonding_responses.push(UnbondingDelegation.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbondingResponses?.map((e) => UnbondingDelegation.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryRedelegationsRequest: object = { - delegator_addr: "", - src_validator_addr: "", - dst_validator_addr: "", -}; +function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { + return { delegatorAddr: "", srcValidatorAddr: "", dstValidatorAddr: "", pagination: undefined }; +} export const QueryRedelegationsRequest = { - encode( - message: QueryRedelegationsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryRedelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } - if (message.src_validator_addr !== "") { - writer.uint32(18).string(message.src_validator_addr); + if (message.srcValidatorAddr !== "") { + writer.uint32(18).string(message.srcValidatorAddr); } - if (message.dst_validator_addr !== "") { - writer.uint32(26).string(message.dst_validator_addr); + if (message.dstValidatorAddr !== "") { + writer.uint32(26).string(message.dstValidatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); @@ -1729,26 +1264,21 @@ export const QueryRedelegationsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRedelegationsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; + const message = createBaseQueryRedelegationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: - message.src_validator_addr = reader.string(); + message.srcValidatorAddr = reader.string(); break; case 3: - message.dst_validator_addr = reader.string(); + message.dstValidatorAddr = reader.string(); break; case 4: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1762,125 +1292,60 @@ export const QueryRedelegationsRequest = { }, fromJSON(object: any): QueryRedelegationsRequest { - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if ( - object.src_validator_addr !== undefined && - object.src_validator_addr !== null - ) { - message.src_validator_addr = String(object.src_validator_addr); - } else { - message.src_validator_addr = ""; - } - if ( - object.dst_validator_addr !== undefined && - object.dst_validator_addr !== null - ) { - message.dst_validator_addr = String(object.dst_validator_addr); - } else { - message.dst_validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + srcValidatorAddr: isSet(object.srcValidatorAddr) ? String(object.srcValidatorAddr) : "", + dstValidatorAddr: isSet(object.dstValidatorAddr) ? String(object.dstValidatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryRedelegationsRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.src_validator_addr !== undefined && - (obj.src_validator_addr = message.src_validator_addr); - message.dst_validator_addr !== undefined && - (obj.dst_validator_addr = message.dst_validator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.srcValidatorAddr !== undefined && (obj.srcValidatorAddr = message.srcValidatorAddr); + message.dstValidatorAddr !== undefined && (obj.dstValidatorAddr = message.dstValidatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryRedelegationsRequest { - const message = { - ...baseQueryRedelegationsRequest, - } as QueryRedelegationsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if ( - object.src_validator_addr !== undefined && - object.src_validator_addr !== null - ) { - message.src_validator_addr = object.src_validator_addr; - } else { - message.src_validator_addr = ""; - } - if ( - object.dst_validator_addr !== undefined && - object.dst_validator_addr !== null - ) { - message.dst_validator_addr = object.dst_validator_addr; - } else { - message.dst_validator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.srcValidatorAddr = object.srcValidatorAddr ?? ""; + message.dstValidatorAddr = object.dstValidatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryRedelegationsResponse: object = {}; +function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { + return { redelegationResponses: [], pagination: undefined }; +} export const QueryRedelegationsResponse = { - encode( - message: QueryRedelegationsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.redelegation_responses) { + encode(message: QueryRedelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.redelegationResponses) { RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRedelegationsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; + const message = createBaseQueryRedelegationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.redelegation_responses.push( - RedelegationResponse.decode(reader, reader.uint32()) - ); + message.redelegationResponses.push(RedelegationResponse.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1894,77 +1359,46 @@ export const QueryRedelegationsResponse = { }, fromJSON(object: any): QueryRedelegationsResponse { - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; - if ( - object.redelegation_responses !== undefined && - object.redelegation_responses !== null - ) { - for (const e of object.redelegation_responses) { - message.redelegation_responses.push(RedelegationResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + redelegationResponses: Array.isArray(object?.redelegationResponses) + ? object.redelegationResponses.map((e: any) => RedelegationResponse.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryRedelegationsResponse): unknown { const obj: any = {}; - if (message.redelegation_responses) { - obj.redelegation_responses = message.redelegation_responses.map((e) => + if (message.redelegationResponses) { + obj.redelegationResponses = message.redelegationResponses.map((e) => e ? RedelegationResponse.toJSON(e) : undefined ); } else { - obj.redelegation_responses = []; + obj.redelegationResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryRedelegationsResponse { - const message = { - ...baseQueryRedelegationsResponse, - } as QueryRedelegationsResponse; - message.redelegation_responses = []; - if ( - object.redelegation_responses !== undefined && - object.redelegation_responses !== null - ) { - for (const e of object.redelegation_responses) { - message.redelegation_responses.push( - RedelegationResponse.fromPartial(e) - ); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegationResponses?.map((e) => RedelegationResponse.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorValidatorsRequest: object = { delegator_addr: "" }; +function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { + return { delegatorAddr: "", pagination: undefined }; +} export const QueryDelegatorValidatorsRequest = { - encode( - message: QueryDelegatorValidatorsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1972,20 +1406,15 @@ export const QueryDelegatorValidatorsRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; + const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1999,82 +1428,51 @@ export const QueryDelegatorValidatorsRequest = { }, fromJSON(object: any): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorValidatorsRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorsRequest { - const message = { - ...baseQueryDelegatorValidatorsRequest, - } as QueryDelegatorValidatorsRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorValidatorsRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorValidatorsResponse: object = {}; +function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { + return { validators: [], pagination: undefined }; +} export const QueryDelegatorValidatorsResponse = { - encode( - message: QueryDelegatorValidatorsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; + const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2093,96 +1491,63 @@ export const QueryDelegatorValidatorsResponse = { }, fromJSON(object: any): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryDelegatorValidatorsResponse): unknown { const obj: any = {}; if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorsResponse { - const message = { - ...baseQueryDelegatorValidatorsResponse, - } as QueryDelegatorValidatorsResponse; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryDelegatorValidatorRequest: object = { - delegator_addr: "", - validator_addr: "", -}; +function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { + return { delegatorAddr: "", validatorAddr: "" }; +} export const QueryDelegatorValidatorRequest = { - encode( - message: QueryDelegatorValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_addr !== "") { - writer.uint32(10).string(message.delegator_addr); + encode(message: QueryDelegatorValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); } - if (message.validator_addr !== "") { - writer.uint32(18).string(message.validator_addr); + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; + const message = createBaseQueryDelegatorValidatorRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_addr = reader.string(); + message.delegatorAddr = reader.string(); break; case 2: - message.validator_addr = reader.string(); + message.validatorAddr = reader.string(); break; default: reader.skipType(tag & 7); @@ -2193,73 +1558,45 @@ export const QueryDelegatorValidatorRequest = { }, fromJSON(object: any): QueryDelegatorValidatorRequest { - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = String(object.delegator_addr); - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = String(object.validator_addr); - } else { - message.validator_addr = ""; - } - return message; + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + }; }, toJSON(message: QueryDelegatorValidatorRequest): unknown { const obj: any = {}; - message.delegator_addr !== undefined && - (obj.delegator_addr = message.delegator_addr); - message.validator_addr !== undefined && - (obj.validator_addr = message.validator_addr); + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorRequest { - const message = { - ...baseQueryDelegatorValidatorRequest, - } as QueryDelegatorValidatorRequest; - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegator_addr = object.delegator_addr; - } else { - message.delegator_addr = ""; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validator_addr = object.validator_addr; - } else { - message.validator_addr = ""; - } + const message = createBaseQueryDelegatorValidatorRequest(); + message.delegatorAddr = object.delegatorAddr ?? ""; + message.validatorAddr = object.validatorAddr ?? ""; return message; }, }; -const baseQueryDelegatorValidatorResponse: object = {}; +function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { + return { validator: undefined }; +} export const QueryDelegatorValidatorResponse = { - encode( - message: QueryDelegatorValidatorResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDelegatorValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDelegatorValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; + const message = createBaseQueryDelegatorValidatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2275,63 +1612,43 @@ export const QueryDelegatorValidatorResponse = { }, fromJSON(object: any): QueryDelegatorValidatorResponse { - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - return message; + return { validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined }; }, toJSON(message: QueryDelegatorValidatorResponse): unknown { const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDelegatorValidatorResponse { - const message = { - ...baseQueryDelegatorValidatorResponse, - } as QueryDelegatorValidatorResponse; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } + const message = createBaseQueryDelegatorValidatorResponse(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; return message; }, }; -const baseQueryHistoricalInfoRequest: object = { height: 0 }; +function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { + return { height: 0 }; +} export const QueryHistoricalInfoRequest = { - encode( - message: QueryHistoricalInfoRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryHistoricalInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryHistoricalInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; + const message = createBaseQueryHistoricalInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2347,60 +1664,38 @@ export const QueryHistoricalInfoRequest = { }, fromJSON(object: any): QueryHistoricalInfoRequest { - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; + return { height: isSet(object.height) ? Number(object.height) : 0 }; }, toJSON(message: QueryHistoricalInfoRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial( - object: DeepPartial - ): QueryHistoricalInfoRequest { - const message = { - ...baseQueryHistoricalInfoRequest, - } as QueryHistoricalInfoRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } + fromPartial, I>>(object: I): QueryHistoricalInfoRequest { + const message = createBaseQueryHistoricalInfoRequest(); + message.height = object.height ?? 0; return message; }, }; -const baseQueryHistoricalInfoResponse: object = {}; +function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { + return { hist: undefined }; +} export const QueryHistoricalInfoResponse = { - encode( - message: QueryHistoricalInfoResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryHistoricalInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hist !== undefined) { HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryHistoricalInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; + const message = createBaseQueryHistoricalInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2416,52 +1711,37 @@ export const QueryHistoricalInfoResponse = { }, fromJSON(object: any): QueryHistoricalInfoResponse { - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; - if (object.hist !== undefined && object.hist !== null) { - message.hist = HistoricalInfo.fromJSON(object.hist); - } else { - message.hist = undefined; - } - return message; + return { hist: isSet(object.hist) ? HistoricalInfo.fromJSON(object.hist) : undefined }; }, toJSON(message: QueryHistoricalInfoResponse): unknown { const obj: any = {}; - message.hist !== undefined && - (obj.hist = message.hist - ? HistoricalInfo.toJSON(message.hist) - : undefined); + message.hist !== undefined && (obj.hist = message.hist ? HistoricalInfo.toJSON(message.hist) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryHistoricalInfoResponse { - const message = { - ...baseQueryHistoricalInfoResponse, - } as QueryHistoricalInfoResponse; - if (object.hist !== undefined && object.hist !== null) { - message.hist = HistoricalInfo.fromPartial(object.hist); - } else { - message.hist = undefined; - } + fromPartial, I>>(object: I): QueryHistoricalInfoResponse { + const message = createBaseQueryHistoricalInfoResponse(); + message.hist = (object.hist !== undefined && object.hist !== null) + ? HistoricalInfo.fromPartial(object.hist) + : undefined; return message; }, }; -const baseQueryPoolRequest: object = {}; +function createBaseQueryPoolRequest(): QueryPoolRequest { + return {}; +} export const QueryPoolRequest = { - encode(_: QueryPoolRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; + const message = createBaseQueryPoolRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2474,8 +1754,7 @@ export const QueryPoolRequest = { }, fromJSON(_: any): QueryPoolRequest { - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; - return message; + return {}; }, toJSON(_: QueryPoolRequest): unknown { @@ -2483,26 +1762,28 @@ export const QueryPoolRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryPoolRequest { - const message = { ...baseQueryPoolRequest } as QueryPoolRequest; + fromPartial, I>>(_: I): QueryPoolRequest { + const message = createBaseQueryPoolRequest(); return message; }, }; -const baseQueryPoolResponse: object = {}; +function createBaseQueryPoolResponse(): QueryPoolResponse { + return { pool: undefined }; +} export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: Writer = Writer.create()): Writer { + encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pool !== undefined) { Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; + const message = createBaseQueryPoolResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2518,44 +1799,35 @@ export const QueryPoolResponse = { }, fromJSON(object: any): QueryPoolResponse { - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; - if (object.pool !== undefined && object.pool !== null) { - message.pool = Pool.fromJSON(object.pool); - } else { - message.pool = undefined; - } - return message; + return { pool: isSet(object.pool) ? Pool.fromJSON(object.pool) : undefined }; }, toJSON(message: QueryPoolResponse): unknown { const obj: any = {}; - message.pool !== undefined && - (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); + message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryPoolResponse { - const message = { ...baseQueryPoolResponse } as QueryPoolResponse; - if (object.pool !== undefined && object.pool !== null) { - message.pool = Pool.fromPartial(object.pool); - } else { - message.pool = undefined; - } + fromPartial, I>>(object: I): QueryPoolResponse { + const message = createBaseQueryPoolResponse(); + message.pool = (object.pool !== undefined && object.pool !== null) ? Pool.fromPartial(object.pool) : undefined; return message; }, }; -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2568,8 +1840,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -2577,29 +1848,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2615,46 +1885,50 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; /** Query defines the gRPC querier service. */ export interface Query { - /** Validators queries all validators that match the given status. */ + /** + * Validators queries all validators that match the given status. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ Validators(request: QueryValidatorsRequest): Promise; /** Validator queries validator info for given validator address. */ Validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ - ValidatorDelegations( - request: QueryValidatorDelegationsRequest - ): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /** + * ValidatorDelegations queries delegate info for given validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + /** + * ValidatorUnbondingDelegations queries unbonding delegations of a validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ ValidatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest + request: QueryValidatorUnbondingDelegationsRequest, ): Promise; /** Delegation queries delegate info for given validator delegator pair. */ Delegation(request: QueryDelegationRequest): Promise; @@ -2662,42 +1936,46 @@ export interface Query { * UnbondingDelegation queries unbonding info for given validator delegator * pair. */ - UnbondingDelegation( - request: QueryUnbondingDelegationRequest - ): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ - DelegatorDelegations( - request: QueryDelegatorDelegationsRequest - ): Promise; + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + /** + * DelegatorDelegations queries all delegations of a given delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ DelegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest + request: QueryDelegatorUnbondingDelegationsRequest, ): Promise; - /** Redelegations queries redelegations of given address. */ - Redelegations( - request: QueryRedelegationsRequest - ): Promise; + /** + * Redelegations queries redelegations of given address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + Redelegations(request: QueryRedelegationsRequest): Promise; /** * DelegatorValidators queries all validators info for given delegator * address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise; + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; /** * DelegatorValidator queries validator info for given delegator validator * pair. */ - DelegatorValidator( - request: QueryDelegatorValidatorRequest - ): Promise; + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise; /** HistoricalInfo queries the historical info for given height. */ - HistoricalInfo( - request: QueryHistoricalInfoRequest - ): Promise; + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise; /** Pool queries the pool info. */ Pool(request: QueryPoolRequest): Promise; /** Parameters queries the staking parameters. */ @@ -2708,227 +1986,144 @@ export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Validators = this.Validators.bind(this); + this.Validator = this.Validator.bind(this); + this.ValidatorDelegations = this.ValidatorDelegations.bind(this); + this.ValidatorUnbondingDelegations = this.ValidatorUnbondingDelegations.bind(this); + this.Delegation = this.Delegation.bind(this); + this.UnbondingDelegation = this.UnbondingDelegation.bind(this); + this.DelegatorDelegations = this.DelegatorDelegations.bind(this); + this.DelegatorUnbondingDelegations = this.DelegatorUnbondingDelegations.bind(this); + this.Redelegations = this.Redelegations.bind(this); + this.DelegatorValidators = this.DelegatorValidators.bind(this); + this.DelegatorValidator = this.DelegatorValidator.bind(this); + this.HistoricalInfo = this.HistoricalInfo.bind(this); + this.Pool = this.Pool.bind(this); + this.Params = this.Params.bind(this); } - Validators( - request: QueryValidatorsRequest - ): Promise { + Validators(request: QueryValidatorsRequest): Promise { const data = QueryValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Validators", - data - ); - return promise.then((data) => - QueryValidatorsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); + return promise.then((data) => QueryValidatorsResponse.decode(new _m0.Reader(data))); } Validator(request: QueryValidatorRequest): Promise { const data = QueryValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Validator", - data - ); - return promise.then((data) => - QueryValidatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); + return promise.then((data) => QueryValidatorResponse.decode(new _m0.Reader(data))); } - ValidatorDelegations( - request: QueryValidatorDelegationsRequest - ): Promise { + ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise { const data = QueryValidatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "ValidatorDelegations", - data - ); - return promise.then((data) => - QueryValidatorDelegationsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); + return promise.then((data) => QueryValidatorDelegationsResponse.decode(new _m0.Reader(data))); } ValidatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest + request: QueryValidatorUnbondingDelegationsRequest, ): Promise { - const data = QueryValidatorUnbondingDelegationsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "ValidatorUnbondingDelegations", - data - ); - return promise.then((data) => - QueryValidatorUnbondingDelegationsResponse.decode(new Reader(data)) - ); + const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); + return promise.then((data) => QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); } - Delegation( - request: QueryDelegationRequest - ): Promise { + Delegation(request: QueryDelegationRequest): Promise { const data = QueryDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Delegation", - data - ); - return promise.then((data) => - QueryDelegationResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); + return promise.then((data) => QueryDelegationResponse.decode(new _m0.Reader(data))); } - UnbondingDelegation( - request: QueryUnbondingDelegationRequest - ): Promise { + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { const data = QueryUnbondingDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "UnbondingDelegation", - data - ); - return promise.then((data) => - QueryUnbondingDelegationResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); + return promise.then((data) => QueryUnbondingDelegationResponse.decode(new _m0.Reader(data))); } - DelegatorDelegations( - request: QueryDelegatorDelegationsRequest - ): Promise { + DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise { const data = QueryDelegatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorDelegations", - data - ); - return promise.then((data) => - QueryDelegatorDelegationsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); + return promise.then((data) => QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data))); } DelegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest + request: QueryDelegatorUnbondingDelegationsRequest, ): Promise { - const data = QueryDelegatorUnbondingDelegationsRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorUnbondingDelegations", - data - ); - return promise.then((data) => - QueryDelegatorUnbondingDelegationsResponse.decode(new Reader(data)) - ); + const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); + return promise.then((data) => QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); } - Redelegations( - request: QueryRedelegationsRequest - ): Promise { + Redelegations(request: QueryRedelegationsRequest): Promise { const data = QueryRedelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Redelegations", - data - ); - return promise.then((data) => - QueryRedelegationsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); + return promise.then((data) => QueryRedelegationsResponse.decode(new _m0.Reader(data))); } - DelegatorValidators( - request: QueryDelegatorValidatorsRequest - ): Promise { + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorValidators", - data - ); - return promise.then((data) => - QueryDelegatorValidatorsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); } - DelegatorValidator( - request: QueryDelegatorValidatorRequest - ): Promise { + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise { const data = QueryDelegatorValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "DelegatorValidator", - data - ); - return promise.then((data) => - QueryDelegatorValidatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); + return promise.then((data) => QueryDelegatorValidatorResponse.decode(new _m0.Reader(data))); } - HistoricalInfo( - request: QueryHistoricalInfoRequest - ): Promise { + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise { const data = QueryHistoricalInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "HistoricalInfo", - data - ); - return promise.then((data) => - QueryHistoricalInfoResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); + return promise.then((data) => QueryHistoricalInfoResponse.decode(new _m0.Reader(data))); } Pool(request: QueryPoolRequest): Promise { const data = QueryPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Pool", - data - ); - return promise.then((data) => QueryPoolResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); + return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -2936,7 +2131,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts index 2010a67c0d..9c02f16745 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts @@ -1,12 +1,13 @@ //@ts-nocheck /* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Header } from "../../../tendermint/types/types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; import { Duration } from "../../../google/protobuf/duration"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { ValidatorUpdate } from "../../../tendermint/abci/types"; +import { Header } from "../../../tendermint/types/types"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.staking.v1beta1"; @@ -54,8 +55,52 @@ export function bondStatusToJSON(object: BondStatus): string { return "BOND_STATUS_UNBONDING"; case BondStatus.BOND_STATUS_BONDED: return "BOND_STATUS_BONDED"; + case BondStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Infraction indicates the infraction a validator commited. */ +export enum Infraction { + /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */ + INFRACTION_UNSPECIFIED = 0, + /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ + INFRACTION_DOUBLE_SIGN = 1, + /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ + INFRACTION_DOWNTIME = 2, + UNRECOGNIZED = -1, +} + +export function infractionFromJSON(object: any): Infraction { + switch (object) { + case 0: + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; + case 1: + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; + case 2: + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return Infraction.UNRECOGNIZED; + } +} + +export function infractionToJSON(object: Infraction): string { + switch (object) { + case Infraction.INFRACTION_UNSPECIFIED: + return "INFRACTION_UNSPECIFIED"; + case Infraction.INFRACTION_DOUBLE_SIGN: + return "INFRACTION_DOUBLE_SIGN"; + case Infraction.INFRACTION_DOWNTIME: + return "INFRACTION_DOWNTIME"; + case Infraction.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -78,17 +123,19 @@ export interface CommissionRates { /** rate is the commission rate charged to delegators, as a fraction. */ rate: string; /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate: string; + maxRate: string; /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate: string; + maxChangeRate: string; } /** Commission defines commission parameters for a given validator. */ export interface Commission { /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates: CommissionRates | undefined; + commissionRates: + | CommissionRates + | undefined; /** update_time is the last time the commission rate was changed. */ - update_time: Date | undefined; + updateTime: Date | undefined; } /** Description defines a validator description. */ @@ -100,7 +147,7 @@ export interface Description { /** website defines an optional website link. */ website: string; /** security_contact defines an optional email for security contact. */ - security_contact: string; + securityContact: string; /** details define other optional details. */ details: string; } @@ -117,9 +164,11 @@ export interface Description { */ export interface Validator { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address: string; + operatorAddress: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensus_pubkey: Any | undefined; + consensusPubkey: + | Any + | undefined; /** jailed defined whether the validator has been jailed from bonded status or not. */ jailed: boolean; /** status is the validator status (bonded/unbonding/unbonded). */ @@ -127,17 +176,31 @@ export interface Validator { /** tokens define the delegated tokens (incl. self-delegation). */ tokens: string; /** delegator_shares defines total shares issued to a validator's delegators. */ - delegator_shares: string; + delegatorShares: string; /** description defines the description terms for the validator. */ - description: Description | undefined; + description: + | Description + | undefined; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height: number; + unbondingHeight: number; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time: Date | undefined; + unbondingTime: + | Date + | undefined; /** commission defines the commission parameters. */ - commission: Commission | undefined; - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation: string; + commission: + | Commission + | undefined; + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ + minSelfDelegation: string; + /** strictly positive if this validator's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: number; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbondingIds: number[]; } /** ValAddresses defines a repeated set of validator addresses. */ @@ -151,8 +214,8 @@ export interface ValAddresses { * be used to construct the key to getting an UnbondingDelegation from state. */ export interface DVPair { - delegator_address: string; - validator_address: string; + delegatorAddress: string; + validatorAddress: string; } /** DVPairs defines an array of DVPair objects. */ @@ -167,9 +230,9 @@ export interface DVPairs { * Redelegation from state. */ export interface DVVTriplet { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; } /** DVVTriplets defines an array of DVVTriplet objects. */ @@ -184,9 +247,9 @@ export interface DVVTriplets { */ export interface Delegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegatorAddress: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validatorAddress: string; /** shares define the delegation shares received. */ shares: string; } @@ -197,9 +260,9 @@ export interface Delegation { */ export interface UnbondingDelegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegatorAddress: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validatorAddress: string; /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntry[]; } @@ -207,25 +270,37 @@ export interface UnbondingDelegation { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntry { /** creation_height is the height which the unbonding took place. */ - creation_height: number; + creationHeight: number; /** completion_time is the unix time for unbonding completion. */ - completion_time: Date | undefined; + completionTime: + | Date + | undefined; /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance: string; + initialBalance: string; /** balance defines the tokens to receive at completion. */ balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: number; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: number; } /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { /** creation_height defines the height which the redelegation took place. */ - creation_height: number; + creationHeight: number; /** completion_time defines the unix time for redelegation completion. */ - completion_time: Date | undefined; + completionTime: + | Date + | undefined; /** initial_balance defines the initial balance when redelegation started. */ - initial_balance: string; + initialBalance: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst: string; + sharesDst: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: number; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: number; } /** @@ -234,27 +309,31 @@ export interface RedelegationEntry { */ export interface Redelegation { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegatorAddress: string; /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address: string; + validatorSrcAddress: string; /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address: string; + validatorDstAddress: string; /** entries are the redelegation entries. */ entries: RedelegationEntry[]; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface Params { /** unbonding_time is the time duration of unbonding. */ - unbonding_time: Duration | undefined; + unbondingTime: + | Duration + | undefined; /** max_validators is the maximum number of validators. */ - max_validators: number; + maxValidators: number; /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries: number; + maxEntries: number; /** historical_entries is the number of historical entries to persist. */ - historical_entries: number; + historicalEntries: number; /** bond_denom defines the bondable coin denomination. */ - bond_denom: string; + bondDenom: string; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + minCommissionRate: string; } /** @@ -272,7 +351,7 @@ export interface DelegationResponse { * responses. */ export interface RedelegationEntryResponse { - redelegation_entry: RedelegationEntry | undefined; + redelegationEntry: RedelegationEntry | undefined; balance: string; } @@ -291,14 +370,24 @@ export interface RedelegationResponse { * denomination. */ export interface Pool { - not_bonded_tokens: string; - bonded_tokens: string; + notBondedTokens: string; + bondedTokens: string; +} + +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdates { + updates: ValidatorUpdate[]; } -const baseHistoricalInfo: object = {}; +function createBaseHistoricalInfo(): HistoricalInfo { + return { header: undefined, valset: [] }; +} export const HistoricalInfo = { - encode(message: HistoricalInfo, writer: Writer = Writer.create()): Writer { + encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -308,11 +397,10 @@ export const HistoricalInfo = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): HistoricalInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; + const message = createBaseHistoricalInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -331,76 +419,55 @@ export const HistoricalInfo = { }, fromJSON(object: any): HistoricalInfo { - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.valset !== undefined && object.valset !== null) { - for (const e of object.valset) { - message.valset.push(Validator.fromJSON(e)); - } - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + valset: Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromJSON(e)) : [], + }; }, toJSON(message: HistoricalInfo): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); if (message.valset) { - obj.valset = message.valset.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.valset = message.valset.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.valset = []; } return obj; }, - fromPartial(object: DeepPartial): HistoricalInfo { - const message = { ...baseHistoricalInfo } as HistoricalInfo; - message.valset = []; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.valset !== undefined && object.valset !== null) { - for (const e of object.valset) { - message.valset.push(Validator.fromPartial(e)); - } - } + fromPartial, I>>(object: I): HistoricalInfo { + const message = createBaseHistoricalInfo(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.valset = object.valset?.map((e) => Validator.fromPartial(e)) || []; return message; }, }; -const baseCommissionRates: object = { - rate: "", - max_rate: "", - max_change_rate: "", -}; +function createBaseCommissionRates(): CommissionRates { + return { rate: "", maxRate: "", maxChangeRate: "" }; +} export const CommissionRates = { - encode(message: CommissionRates, writer: Writer = Writer.create()): Writer { + encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.rate !== "") { writer.uint32(10).string(message.rate); } - if (message.max_rate !== "") { - writer.uint32(18).string(message.max_rate); + if (message.maxRate !== "") { + writer.uint32(18).string(message.maxRate); } - if (message.max_change_rate !== "") { - writer.uint32(26).string(message.max_change_rate); + if (message.maxChangeRate !== "") { + writer.uint32(26).string(message.maxChangeRate); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): CommissionRates { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommissionRates } as CommissionRates; + const message = createBaseCommissionRates(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -408,10 +475,10 @@ export const CommissionRates = { message.rate = reader.string(); break; case 2: - message.max_rate = reader.string(); + message.maxRate = reader.string(); break; case 3: - message.max_change_rate = reader.string(); + message.maxChangeRate = reader.string(); break; default: reader.skipType(tag & 7); @@ -422,97 +489,57 @@ export const CommissionRates = { }, fromJSON(object: any): CommissionRates { - const message = { ...baseCommissionRates } as CommissionRates; - if (object.rate !== undefined && object.rate !== null) { - message.rate = String(object.rate); - } else { - message.rate = ""; - } - if (object.max_rate !== undefined && object.max_rate !== null) { - message.max_rate = String(object.max_rate); - } else { - message.max_rate = ""; - } - if ( - object.max_change_rate !== undefined && - object.max_change_rate !== null - ) { - message.max_change_rate = String(object.max_change_rate); - } else { - message.max_change_rate = ""; - } - return message; + return { + rate: isSet(object.rate) ? String(object.rate) : "", + maxRate: isSet(object.maxRate) ? String(object.maxRate) : "", + maxChangeRate: isSet(object.maxChangeRate) ? String(object.maxChangeRate) : "", + }; }, toJSON(message: CommissionRates): unknown { const obj: any = {}; message.rate !== undefined && (obj.rate = message.rate); - message.max_rate !== undefined && (obj.max_rate = message.max_rate); - message.max_change_rate !== undefined && - (obj.max_change_rate = message.max_change_rate); + message.maxRate !== undefined && (obj.maxRate = message.maxRate); + message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate); return obj; }, - fromPartial(object: DeepPartial): CommissionRates { - const message = { ...baseCommissionRates } as CommissionRates; - if (object.rate !== undefined && object.rate !== null) { - message.rate = object.rate; - } else { - message.rate = ""; - } - if (object.max_rate !== undefined && object.max_rate !== null) { - message.max_rate = object.max_rate; - } else { - message.max_rate = ""; - } - if ( - object.max_change_rate !== undefined && - object.max_change_rate !== null - ) { - message.max_change_rate = object.max_change_rate; - } else { - message.max_change_rate = ""; - } + fromPartial, I>>(object: I): CommissionRates { + const message = createBaseCommissionRates(); + message.rate = object.rate ?? ""; + message.maxRate = object.maxRate ?? ""; + message.maxChangeRate = object.maxChangeRate ?? ""; return message; }, }; -const baseCommission: object = {}; +function createBaseCommission(): Commission { + return { commissionRates: undefined, updateTime: undefined }; +} export const Commission = { - encode(message: Commission, writer: Writer = Writer.create()): Writer { - if (message.commission_rates !== undefined) { - CommissionRates.encode( - message.commission_rates, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.update_time !== undefined) { - Timestamp.encode( - toTimestamp(message.update_time), - writer.uint32(18).fork() - ).ldelim(); + encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Commission { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Commission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommission } as Commission; + const message = createBaseCommission(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.commission_rates = CommissionRates.decode( - reader, - reader.uint32() - ); + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); break; case 2: - message.update_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -523,70 +550,36 @@ export const Commission = { }, fromJSON(object: any): Commission { - const message = { ...baseCommission } as Commission; - if ( - object.commission_rates !== undefined && - object.commission_rates !== null - ) { - message.commission_rates = CommissionRates.fromJSON( - object.commission_rates - ); - } else { - message.commission_rates = undefined; - } - if (object.update_time !== undefined && object.update_time !== null) { - message.update_time = fromJsonTimestamp(object.update_time); - } else { - message.update_time = undefined; - } - return message; + return { + commissionRates: isSet(object.commissionRates) ? CommissionRates.fromJSON(object.commissionRates) : undefined, + updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined, + }; }, toJSON(message: Commission): unknown { const obj: any = {}; - message.commission_rates !== undefined && - (obj.commission_rates = message.commission_rates - ? CommissionRates.toJSON(message.commission_rates) - : undefined); - message.update_time !== undefined && - (obj.update_time = - message.update_time !== undefined - ? message.update_time.toISOString() - : null); + message.commissionRates !== undefined + && (obj.commissionRates = message.commissionRates ? CommissionRates.toJSON(message.commissionRates) : undefined); + message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString()); return obj; }, - fromPartial(object: DeepPartial): Commission { - const message = { ...baseCommission } as Commission; - if ( - object.commission_rates !== undefined && - object.commission_rates !== null - ) { - message.commission_rates = CommissionRates.fromPartial( - object.commission_rates - ); - } else { - message.commission_rates = undefined; - } - if (object.update_time !== undefined && object.update_time !== null) { - message.update_time = object.update_time; - } else { - message.update_time = undefined; - } + fromPartial, I>>(object: I): Commission { + const message = createBaseCommission(); + message.commissionRates = (object.commissionRates !== undefined && object.commissionRates !== null) + ? CommissionRates.fromPartial(object.commissionRates) + : undefined; + message.updateTime = object.updateTime ?? undefined; return message; }, }; -const baseDescription: object = { - moniker: "", - identity: "", - website: "", - security_contact: "", - details: "", -}; +function createBaseDescription(): Description { + return { moniker: "", identity: "", website: "", securityContact: "", details: "" }; +} export const Description = { - encode(message: Description, writer: Writer = Writer.create()): Writer { + encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.moniker !== "") { writer.uint32(10).string(message.moniker); } @@ -596,8 +589,8 @@ export const Description = { if (message.website !== "") { writer.uint32(26).string(message.website); } - if (message.security_contact !== "") { - writer.uint32(34).string(message.security_contact); + if (message.securityContact !== "") { + writer.uint32(34).string(message.securityContact); } if (message.details !== "") { writer.uint32(42).string(message.details); @@ -605,10 +598,10 @@ export const Description = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Description { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Description { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescription } as Description; + const message = createBaseDescription(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -622,7 +615,7 @@ export const Description = { message.website = reader.string(); break; case 4: - message.security_contact = reader.string(); + message.securityContact = reader.string(); break; case 5: message.details = reader.string(); @@ -636,36 +629,13 @@ export const Description = { }, fromJSON(object: any): Description { - const message = { ...baseDescription } as Description; - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = String(object.moniker); - } else { - message.moniker = ""; - } - if (object.identity !== undefined && object.identity !== null) { - message.identity = String(object.identity); - } else { - message.identity = ""; - } - if (object.website !== undefined && object.website !== null) { - message.website = String(object.website); - } else { - message.website = ""; - } - if ( - object.security_contact !== undefined && - object.security_contact !== null - ) { - message.security_contact = String(object.security_contact); - } else { - message.security_contact = ""; - } - if (object.details !== undefined && object.details !== null) { - message.details = String(object.details); - } else { - message.details = ""; - } - return message; + return { + moniker: isSet(object.moniker) ? String(object.moniker) : "", + identity: isSet(object.identity) ? String(object.identity) : "", + website: isSet(object.website) ? String(object.website) : "", + securityContact: isSet(object.securityContact) ? String(object.securityContact) : "", + details: isSet(object.details) ? String(object.details) : "", + }; }, toJSON(message: Description): unknown { @@ -673,63 +643,47 @@ export const Description = { message.moniker !== undefined && (obj.moniker = message.moniker); message.identity !== undefined && (obj.identity = message.identity); message.website !== undefined && (obj.website = message.website); - message.security_contact !== undefined && - (obj.security_contact = message.security_contact); + message.securityContact !== undefined && (obj.securityContact = message.securityContact); message.details !== undefined && (obj.details = message.details); return obj; }, - fromPartial(object: DeepPartial): Description { - const message = { ...baseDescription } as Description; - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } else { - message.moniker = ""; - } - if (object.identity !== undefined && object.identity !== null) { - message.identity = object.identity; - } else { - message.identity = ""; - } - if (object.website !== undefined && object.website !== null) { - message.website = object.website; - } else { - message.website = ""; - } - if ( - object.security_contact !== undefined && - object.security_contact !== null - ) { - message.security_contact = object.security_contact; - } else { - message.security_contact = ""; - } - if (object.details !== undefined && object.details !== null) { - message.details = object.details; - } else { - message.details = ""; - } + fromPartial, I>>(object: I): Description { + const message = createBaseDescription(); + message.moniker = object.moniker ?? ""; + message.identity = object.identity ?? ""; + message.website = object.website ?? ""; + message.securityContact = object.securityContact ?? ""; + message.details = object.details ?? ""; return message; }, }; -const baseValidator: object = { - operator_address: "", - jailed: false, - status: 0, - tokens: "", - delegator_shares: "", - unbonding_height: 0, - min_self_delegation: "", -}; +function createBaseValidator(): Validator { + return { + operatorAddress: "", + consensusPubkey: undefined, + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + description: undefined, + unbondingHeight: 0, + unbondingTime: undefined, + commission: undefined, + minSelfDelegation: "", + unbondingOnHoldRefCount: 0, + unbondingIds: [], + }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { - if (message.operator_address !== "") { - writer.uint32(10).string(message.operator_address); + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); } - if (message.consensus_pubkey !== undefined) { - Any.encode(message.consensus_pubkey, writer.uint32(18).fork()).ldelim(); + if (message.consensusPubkey !== undefined) { + Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim(); } if (message.jailed === true) { writer.uint32(24).bool(message.jailed); @@ -740,45 +694,47 @@ export const Validator = { if (message.tokens !== "") { writer.uint32(42).string(message.tokens); } - if (message.delegator_shares !== "") { - writer.uint32(50).string(message.delegator_shares); + if (message.delegatorShares !== "") { + writer.uint32(50).string(message.delegatorShares); } if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(58).fork() - ).ldelim(); + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); } - if (message.unbonding_height !== 0) { - writer.uint32(64).int64(message.unbonding_height); + if (message.unbondingHeight !== 0) { + writer.uint32(64).int64(message.unbondingHeight); } - if (message.unbonding_time !== undefined) { - Timestamp.encode( - toTimestamp(message.unbonding_time), - writer.uint32(74).fork() - ).ldelim(); + if (message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); } if (message.commission !== undefined) { Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); } - if (message.min_self_delegation !== "") { - writer.uint32(90).string(message.min_self_delegation); + if (message.minSelfDelegation !== "") { + writer.uint32(90).string(message.minSelfDelegation); } + if (message.unbondingOnHoldRefCount !== 0) { + writer.uint32(96).int64(message.unbondingOnHoldRefCount); + } + writer.uint32(106).fork(); + for (const v of message.unbondingIds) { + writer.uint64(v); + } + writer.ldelim(); return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.operator_address = reader.string(); + message.operatorAddress = reader.string(); break; case 2: - message.consensus_pubkey = Any.decode(reader, reader.uint32()); + message.consensusPubkey = Any.decode(reader, reader.uint32()); break; case 3: message.jailed = reader.bool(); @@ -790,24 +746,35 @@ export const Validator = { message.tokens = reader.string(); break; case 6: - message.delegator_shares = reader.string(); + message.delegatorShares = reader.string(); break; case 7: message.description = Description.decode(reader, reader.uint32()); break; case 8: - message.unbonding_height = longToNumber(reader.int64() as Long); + message.unbondingHeight = longToNumber(reader.int64() as Long); break; case 9: - message.unbonding_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 10: message.commission = Commission.decode(reader, reader.uint32()); break; case 11: - message.min_self_delegation = reader.string(); + message.minSelfDelegation = reader.string(); + break; + case 12: + message.unbondingOnHoldRefCount = longToNumber(reader.int64() as Long); + break; + case 13: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.unbondingIds.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.unbondingIds.push(longToNumber(reader.uint64() as Long)); + } break; default: reader.skipType(tag & 7); @@ -818,205 +785,90 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if ( - object.operator_address !== undefined && - object.operator_address !== null - ) { - message.operator_address = String(object.operator_address); - } else { - message.operator_address = ""; - } - if ( - object.consensus_pubkey !== undefined && - object.consensus_pubkey !== null - ) { - message.consensus_pubkey = Any.fromJSON(object.consensus_pubkey); - } else { - message.consensus_pubkey = undefined; - } - if (object.jailed !== undefined && object.jailed !== null) { - message.jailed = Boolean(object.jailed); - } else { - message.jailed = false; - } - if (object.status !== undefined && object.status !== null) { - message.status = bondStatusFromJSON(object.status); - } else { - message.status = 0; - } - if (object.tokens !== undefined && object.tokens !== null) { - message.tokens = String(object.tokens); - } else { - message.tokens = ""; - } - if ( - object.delegator_shares !== undefined && - object.delegator_shares !== null - ) { - message.delegator_shares = String(object.delegator_shares); - } else { - message.delegator_shares = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if ( - object.unbonding_height !== undefined && - object.unbonding_height !== null - ) { - message.unbonding_height = Number(object.unbonding_height); - } else { - message.unbonding_height = 0; - } - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = fromJsonTimestamp(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = Commission.fromJSON(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - return message; + return { + operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", + consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, + jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + tokens: isSet(object.tokens) ? String(object.tokens) : "", + delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", + description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, + unbondingHeight: isSet(object.unbondingHeight) ? Number(object.unbondingHeight) : 0, + unbondingTime: isSet(object.unbondingTime) ? fromJsonTimestamp(object.unbondingTime) : undefined, + commission: isSet(object.commission) ? Commission.fromJSON(object.commission) : undefined, + minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? Number(object.unbondingOnHoldRefCount) : 0, + unbondingIds: Array.isArray(object?.unbondingIds) ? object.unbondingIds.map((e: any) => Number(e)) : [], + }; }, toJSON(message: Validator): unknown { const obj: any = {}; - message.operator_address !== undefined && - (obj.operator_address = message.operator_address); - message.consensus_pubkey !== undefined && - (obj.consensus_pubkey = message.consensus_pubkey - ? Any.toJSON(message.consensus_pubkey) - : undefined); + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + message.consensusPubkey !== undefined + && (obj.consensusPubkey = message.consensusPubkey ? Any.toJSON(message.consensusPubkey) : undefined); message.jailed !== undefined && (obj.jailed = message.jailed); - message.status !== undefined && - (obj.status = bondStatusToJSON(message.status)); + message.status !== undefined && (obj.status = bondStatusToJSON(message.status)); message.tokens !== undefined && (obj.tokens = message.tokens); - message.delegator_shares !== undefined && - (obj.delegator_shares = message.delegator_shares); - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.unbonding_height !== undefined && - (obj.unbonding_height = message.unbonding_height); - message.unbonding_time !== undefined && - (obj.unbonding_time = - message.unbonding_time !== undefined - ? message.unbonding_time.toISOString() - : null); - message.commission !== undefined && - (obj.commission = message.commission - ? Commission.toJSON(message.commission) - : undefined); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); + message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares); + message.description !== undefined + && (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.unbondingHeight !== undefined && (obj.unbondingHeight = Math.round(message.unbondingHeight)); + message.unbondingTime !== undefined && (obj.unbondingTime = message.unbondingTime.toISOString()); + message.commission !== undefined + && (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + message.unbondingOnHoldRefCount !== undefined + && (obj.unbondingOnHoldRefCount = Math.round(message.unbondingOnHoldRefCount)); + if (message.unbondingIds) { + obj.unbondingIds = message.unbondingIds.map((e) => Math.round(e)); + } else { + obj.unbondingIds = []; + } return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if ( - object.operator_address !== undefined && - object.operator_address !== null - ) { - message.operator_address = object.operator_address; - } else { - message.operator_address = ""; - } - if ( - object.consensus_pubkey !== undefined && - object.consensus_pubkey !== null - ) { - message.consensus_pubkey = Any.fromPartial(object.consensus_pubkey); - } else { - message.consensus_pubkey = undefined; - } - if (object.jailed !== undefined && object.jailed !== null) { - message.jailed = object.jailed; - } else { - message.jailed = false; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } else { - message.status = 0; - } - if (object.tokens !== undefined && object.tokens !== null) { - message.tokens = object.tokens; - } else { - message.tokens = ""; - } - if ( - object.delegator_shares !== undefined && - object.delegator_shares !== null - ) { - message.delegator_shares = object.delegator_shares; - } else { - message.delegator_shares = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if ( - object.unbonding_height !== undefined && - object.unbonding_height !== null - ) { - message.unbonding_height = object.unbonding_height; - } else { - message.unbonding_height = 0; - } - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = object.unbonding_time; - } else { - message.unbonding_time = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = Commission.fromPartial(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + message.consensusPubkey = (object.consensusPubkey !== undefined && object.consensusPubkey !== null) + ? Any.fromPartial(object.consensusPubkey) + : undefined; + message.jailed = object.jailed ?? false; + message.status = object.status ?? 0; + message.tokens = object.tokens ?? ""; + message.delegatorShares = object.delegatorShares ?? ""; + message.description = (object.description !== undefined && object.description !== null) + ? Description.fromPartial(object.description) + : undefined; + message.unbondingHeight = object.unbondingHeight ?? 0; + message.unbondingTime = object.unbondingTime ?? undefined; + message.commission = (object.commission !== undefined && object.commission !== null) + ? Commission.fromPartial(object.commission) + : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount ?? 0; + message.unbondingIds = object.unbondingIds?.map((e) => e) || []; return message; }, }; -const baseValAddresses: object = { addresses: "" }; +function createBaseValAddresses(): ValAddresses { + return { addresses: [] }; +} export const ValAddresses = { - encode(message: ValAddresses, writer: Writer = Writer.create()): Writer { + encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.addresses) { writer.uint32(10).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValAddresses { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; + const message = createBaseValAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1032,14 +884,7 @@ export const ValAddresses = { }, fromJSON(object: any): ValAddresses { - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(String(e)); - } - } - return message; + return { addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] }; }, toJSON(message: ValAddresses): unknown { @@ -1052,43 +897,40 @@ export const ValAddresses = { return obj; }, - fromPartial(object: DeepPartial): ValAddresses { - const message = { ...baseValAddresses } as ValAddresses; - message.addresses = []; - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(e); - } - } + fromPartial, I>>(object: I): ValAddresses { + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map((e) => e) || []; return message; }, }; -const baseDVPair: object = { delegator_address: "", validator_address: "" }; +function createBaseDVPair(): DVPair { + return { delegatorAddress: "", validatorAddress: "" }; +} export const DVPair = { - encode(message: DVPair, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DVPair { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DVPair { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVPair } as DVPair; + const message = createBaseDVPair(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1099,72 +941,43 @@ export const DVPair = { }, fromJSON(object: any): DVPair { - const message = { ...baseDVPair } as DVPair; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + }; }, toJSON(message: DVPair): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial(object: DeepPartial): DVPair { - const message = { ...baseDVPair } as DVPair; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } + fromPartial, I>>(object: I): DVPair { + const message = createBaseDVPair(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; return message; }, }; -const baseDVPairs: object = {}; +function createBaseDVPairs(): DVPairs { + return { pairs: [] }; +} export const DVPairs = { - encode(message: DVPairs, writer: Writer = Writer.create()): Writer { + encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.pairs) { DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DVPairs { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; + const message = createBaseDVPairs(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1180,73 +993,59 @@ export const DVPairs = { }, fromJSON(object: any): DVPairs { - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; - if (object.pairs !== undefined && object.pairs !== null) { - for (const e of object.pairs) { - message.pairs.push(DVPair.fromJSON(e)); - } - } - return message; + return { pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromJSON(e)) : [] }; }, toJSON(message: DVPairs): unknown { const obj: any = {}; if (message.pairs) { - obj.pairs = message.pairs.map((e) => (e ? DVPair.toJSON(e) : undefined)); + obj.pairs = message.pairs.map((e) => e ? DVPair.toJSON(e) : undefined); } else { obj.pairs = []; } return obj; }, - fromPartial(object: DeepPartial): DVPairs { - const message = { ...baseDVPairs } as DVPairs; - message.pairs = []; - if (object.pairs !== undefined && object.pairs !== null) { - for (const e of object.pairs) { - message.pairs.push(DVPair.fromPartial(e)); - } - } + fromPartial, I>>(object: I): DVPairs { + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || []; return message; }, }; -const baseDVVTriplet: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; +function createBaseDVVTriplet(): DVVTriplet { + return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; +} export const DVVTriplet = { - encode(message: DVVTriplet, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DVVTriplet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVVTriplet } as DVVTriplet; + const message = createBaseDVVTriplet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_src_address = reader.string(); + message.validatorSrcAddress = reader.string(); break; case 3: - message.validator_dst_address = reader.string(); + message.validatorDstAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -1257,90 +1056,46 @@ export const DVVTriplet = { }, fromJSON(object: any): DVVTriplet { - const message = { ...baseDVVTriplet } as DVVTriplet; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", + validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", + }; }, toJSON(message: DVVTriplet): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); return obj; }, - fromPartial(object: DeepPartial): DVVTriplet { - const message = { ...baseDVVTriplet } as DVVTriplet; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } + fromPartial, I>>(object: I): DVVTriplet { + const message = createBaseDVVTriplet(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; return message; }, }; -const baseDVVTriplets: object = {}; +function createBaseDVVTriplets(): DVVTriplets { + return { triplets: [] }; +} export const DVVTriplets = { - encode(message: DVVTriplets, writer: Writer = Writer.create()): Writer { + encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.triplets) { DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DVVTriplets { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; + const message = createBaseDVVTriplets(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1356,53 +1111,37 @@ export const DVVTriplets = { }, fromJSON(object: any): DVVTriplets { - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; - if (object.triplets !== undefined && object.triplets !== null) { - for (const e of object.triplets) { - message.triplets.push(DVVTriplet.fromJSON(e)); - } - } - return message; + return { triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromJSON(e)) : [] }; }, toJSON(message: DVVTriplets): unknown { const obj: any = {}; if (message.triplets) { - obj.triplets = message.triplets.map((e) => - e ? DVVTriplet.toJSON(e) : undefined - ); + obj.triplets = message.triplets.map((e) => e ? DVVTriplet.toJSON(e) : undefined); } else { obj.triplets = []; } return obj; }, - fromPartial(object: DeepPartial): DVVTriplets { - const message = { ...baseDVVTriplets } as DVVTriplets; - message.triplets = []; - if (object.triplets !== undefined && object.triplets !== null) { - for (const e of object.triplets) { - message.triplets.push(DVVTriplet.fromPartial(e)); - } - } + fromPartial, I>>(object: I): DVVTriplets { + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || []; return message; }, }; -const baseDelegation: object = { - delegator_address: "", - validator_address: "", - shares: "", -}; +function createBaseDelegation(): Delegation { + return { delegatorAddress: "", validatorAddress: "", shares: "" }; +} export const Delegation = { - encode(message: Delegation, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } if (message.shares !== "") { writer.uint32(26).string(message.shares); @@ -1410,18 +1149,18 @@ export const Delegation = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Delegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Delegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegation } as Delegation; + const message = createBaseDelegation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: message.shares = reader.string(); @@ -1435,83 +1174,41 @@ export const Delegation = { }, fromJSON(object: any): Delegation { - const message = { ...baseDelegation } as Delegation; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.shares !== undefined && object.shares !== null) { - message.shares = String(object.shares); - } else { - message.shares = ""; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + shares: isSet(object.shares) ? String(object.shares) : "", + }; }, toJSON(message: Delegation): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.shares !== undefined && (obj.shares = message.shares); return obj; }, - fromPartial(object: DeepPartial): Delegation { - const message = { ...baseDelegation } as Delegation; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.shares !== undefined && object.shares !== null) { - message.shares = object.shares; - } else { - message.shares = ""; - } + fromPartial, I>>(object: I): Delegation { + const message = createBaseDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.shares = object.shares ?? ""; return message; }, }; -const baseUnbondingDelegation: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseUnbondingDelegation(): UnbondingDelegation { + return { delegatorAddress: "", validatorAddress: "", entries: [] }; +} export const UnbondingDelegation = { - encode( - message: UnbondingDelegation, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } for (const v of message.entries) { UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); @@ -1519,24 +1216,21 @@ export const UnbondingDelegation = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): UnbondingDelegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; + const message = createBaseUnbondingDelegation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: - message.entries.push( - UnbondingDelegationEntry.decode(reader, reader.uint32()) - ); + message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1547,131 +1241,95 @@ export const UnbondingDelegation = { }, fromJSON(object: any): UnbondingDelegation { - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(UnbondingDelegationEntry.fromJSON(e)); - } - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => UnbondingDelegationEntry.fromJSON(e)) + : [], + }; }, toJSON(message: UnbondingDelegation): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); if (message.entries) { - obj.entries = message.entries.map((e) => - e ? UnbondingDelegationEntry.toJSON(e) : undefined - ); + obj.entries = message.entries.map((e) => e ? UnbondingDelegationEntry.toJSON(e) : undefined); } else { obj.entries = []; } return obj; }, - fromPartial(object: DeepPartial): UnbondingDelegation { - const message = { ...baseUnbondingDelegation } as UnbondingDelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(UnbondingDelegationEntry.fromPartial(e)); - } - } + fromPartial, I>>(object: I): UnbondingDelegation { + const message = createBaseUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.entries = object.entries?.map((e) => UnbondingDelegationEntry.fromPartial(e)) || []; return message; }, }; -const baseUnbondingDelegationEntry: object = { - creation_height: 0, - initial_balance: "", - balance: "", -}; +function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { + return { + creationHeight: 0, + completionTime: undefined, + initialBalance: "", + balance: "", + unbondingId: 0, + unbondingOnHoldRefCount: 0, + }; +} export const UnbondingDelegationEntry = { - encode( - message: UnbondingDelegationEntry, - writer: Writer = Writer.create() - ): Writer { - if (message.creation_height !== 0) { - writer.uint32(8).int64(message.creation_height); - } - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(18).fork() - ).ldelim(); - } - if (message.initial_balance !== "") { - writer.uint32(26).string(message.initial_balance); + encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.creationHeight !== 0) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); } if (message.balance !== "") { writer.uint32(34).string(message.balance); } + if (message.unbondingId !== 0) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== 0) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UnbondingDelegationEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; + const message = createBaseUnbondingDelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creation_height = longToNumber(reader.int64() as Long); + message.creationHeight = longToNumber(reader.int64() as Long); break; case 2: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 3: - message.initial_balance = reader.string(); + message.initialBalance = reader.string(); break; case 4: message.balance = reader.string(); break; + case 5: + message.unbondingId = longToNumber(reader.uint64() as Long); + break; + case 6: + message.unbondingOnHoldRefCount = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -1681,141 +1339,98 @@ export const UnbondingDelegationEntry = { }, fromJSON(object: any): UnbondingDelegationEntry { - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = Number(object.creation_height); - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = String(object.initial_balance); - } else { - message.initial_balance = ""; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = String(object.balance); - } else { - message.balance = ""; - } - return message; + return { + creationHeight: isSet(object.creationHeight) ? Number(object.creationHeight) : 0, + completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, + initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", + balance: isSet(object.balance) ? String(object.balance) : "", + unbondingId: isSet(object.unbondingId) ? Number(object.unbondingId) : 0, + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? Number(object.unbondingOnHoldRefCount) : 0, + }; }, toJSON(message: UnbondingDelegationEntry): unknown { const obj: any = {}; - message.creation_height !== undefined && - (obj.creation_height = message.creation_height); - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - message.initial_balance !== undefined && - (obj.initial_balance = message.initial_balance); + message.creationHeight !== undefined && (obj.creationHeight = Math.round(message.creationHeight)); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); message.balance !== undefined && (obj.balance = message.balance); + message.unbondingId !== undefined && (obj.unbondingId = Math.round(message.unbondingId)); + message.unbondingOnHoldRefCount !== undefined + && (obj.unbondingOnHoldRefCount = Math.round(message.unbondingOnHoldRefCount)); return obj; }, - fromPartial( - object: DeepPartial - ): UnbondingDelegationEntry { - const message = { - ...baseUnbondingDelegationEntry, - } as UnbondingDelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = object.creation_height; - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = object.initial_balance; - } else { - message.initial_balance = ""; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } else { - message.balance = ""; - } + fromPartial, I>>(object: I): UnbondingDelegationEntry { + const message = createBaseUnbondingDelegationEntry(); + message.creationHeight = object.creationHeight ?? 0; + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.balance = object.balance ?? ""; + message.unbondingId = object.unbondingId ?? 0; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount ?? 0; return message; }, }; -const baseRedelegationEntry: object = { - creation_height: 0, - initial_balance: "", - shares_dst: "", -}; +function createBaseRedelegationEntry(): RedelegationEntry { + return { + creationHeight: 0, + completionTime: undefined, + initialBalance: "", + sharesDst: "", + unbondingId: 0, + unbondingOnHoldRefCount: 0, + }; +} export const RedelegationEntry = { - encode(message: RedelegationEntry, writer: Writer = Writer.create()): Writer { - if (message.creation_height !== 0) { - writer.uint32(8).int64(message.creation_height); + encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.creationHeight !== 0) { + writer.uint32(8).int64(message.creationHeight); } - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(18).fork() - ).ldelim(); + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); } - if (message.initial_balance !== "") { - writer.uint32(26).string(message.initial_balance); + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); } - if (message.shares_dst !== "") { - writer.uint32(34).string(message.shares_dst); + if (message.sharesDst !== "") { + writer.uint32(34).string(message.sharesDst); + } + if (message.unbondingId !== 0) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== 0) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RedelegationEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegationEntry } as RedelegationEntry; + const message = createBaseRedelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creation_height = longToNumber(reader.int64() as Long); + message.creationHeight = longToNumber(reader.int64() as Long); break; case 2: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 3: - message.initial_balance = reader.string(); + message.initialBalance = reader.string(); break; case 4: - message.shares_dst = reader.string(); + message.sharesDst = reader.string(); + break; + case 5: + message.unbondingId = longToNumber(reader.uint64() as Long); + break; + case 6: + message.unbondingOnHoldRefCount = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -1826,105 +1441,54 @@ export const RedelegationEntry = { }, fromJSON(object: any): RedelegationEntry { - const message = { ...baseRedelegationEntry } as RedelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = Number(object.creation_height); - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = String(object.initial_balance); - } else { - message.initial_balance = ""; - } - if (object.shares_dst !== undefined && object.shares_dst !== null) { - message.shares_dst = String(object.shares_dst); - } else { - message.shares_dst = ""; - } - return message; + return { + creationHeight: isSet(object.creationHeight) ? Number(object.creationHeight) : 0, + completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined, + initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", + sharesDst: isSet(object.sharesDst) ? String(object.sharesDst) : "", + unbondingId: isSet(object.unbondingId) ? Number(object.unbondingId) : 0, + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? Number(object.unbondingOnHoldRefCount) : 0, + }; }, toJSON(message: RedelegationEntry): unknown { const obj: any = {}; - message.creation_height !== undefined && - (obj.creation_height = message.creation_height); - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); - message.initial_balance !== undefined && - (obj.initial_balance = message.initial_balance); - message.shares_dst !== undefined && (obj.shares_dst = message.shares_dst); + message.creationHeight !== undefined && (obj.creationHeight = Math.round(message.creationHeight)); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); + message.unbondingId !== undefined && (obj.unbondingId = Math.round(message.unbondingId)); + message.unbondingOnHoldRefCount !== undefined + && (obj.unbondingOnHoldRefCount = Math.round(message.unbondingOnHoldRefCount)); return obj; }, - fromPartial(object: DeepPartial): RedelegationEntry { - const message = { ...baseRedelegationEntry } as RedelegationEntry; - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creation_height = object.creation_height; - } else { - message.creation_height = 0; - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initial_balance = object.initial_balance; - } else { - message.initial_balance = ""; - } - if (object.shares_dst !== undefined && object.shares_dst !== null) { - message.shares_dst = object.shares_dst; - } else { - message.shares_dst = ""; - } + fromPartial, I>>(object: I): RedelegationEntry { + const message = createBaseRedelegationEntry(); + message.creationHeight = object.creationHeight ?? 0; + message.completionTime = object.completionTime ?? undefined; + message.initialBalance = object.initialBalance ?? ""; + message.sharesDst = object.sharesDst ?? ""; + message.unbondingId = object.unbondingId ?? 0; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount ?? 0; return message; }, }; -const baseRedelegation: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; +function createBaseRedelegation(): Redelegation { + return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", entries: [] }; +} export const Redelegation = { - encode(message: Redelegation, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); } for (const v of message.entries) { RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); @@ -1932,27 +1496,24 @@ export const Redelegation = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Redelegation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; + const message = createBaseRedelegation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_src_address = reader.string(); + message.validatorSrcAddress = reader.string(); break; case 3: - message.validator_dst_address = reader.string(); + message.validatorDstAddress = reader.string(); break; case 4: - message.entries.push( - RedelegationEntry.decode(reader, reader.uint32()) - ); + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1963,145 +1524,95 @@ export const Redelegation = { }, fromJSON(object: any): Redelegation { - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntry.fromJSON(e)); - } - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", + validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntry.fromJSON(e)) : [], + }; }, toJSON(message: Redelegation): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); if (message.entries) { - obj.entries = message.entries.map((e) => - e ? RedelegationEntry.toJSON(e) : undefined - ); + obj.entries = message.entries.map((e) => e ? RedelegationEntry.toJSON(e) : undefined); } else { obj.entries = []; } return obj; }, - fromPartial(object: DeepPartial): Redelegation { - const message = { ...baseRedelegation } as Redelegation; - message.entries = []; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntry.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Redelegation { + const message = createBaseRedelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.entries = object.entries?.map((e) => RedelegationEntry.fromPartial(e)) || []; return message; }, }; -const baseParams: object = { - max_validators: 0, - max_entries: 0, - historical_entries: 0, - bond_denom: "", -}; +function createBaseParams(): Params { + return { + unbondingTime: undefined, + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + minCommissionRate: "", + }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.unbonding_time !== undefined) { - Duration.encode( - message.unbonding_time, - writer.uint32(10).fork() - ).ldelim(); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators); } - if (message.max_validators !== 0) { - writer.uint32(16).uint32(message.max_validators); + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries); } - if (message.max_entries !== 0) { - writer.uint32(24).uint32(message.max_entries); + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries); } - if (message.historical_entries !== 0) { - writer.uint32(32).uint32(message.historical_entries); + if (message.bondDenom !== "") { + writer.uint32(42).string(message.bondDenom); } - if (message.bond_denom !== "") { - writer.uint32(42).string(message.bond_denom); + if (message.minCommissionRate !== "") { + writer.uint32(50).string(message.minCommissionRate); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.unbonding_time = Duration.decode(reader, reader.uint32()); + message.unbondingTime = Duration.decode(reader, reader.uint32()); break; case 2: - message.max_validators = reader.uint32(); + message.maxValidators = reader.uint32(); break; case 3: - message.max_entries = reader.uint32(); + message.maxEntries = reader.uint32(); break; case 4: - message.historical_entries = reader.uint32(); + message.historicalEntries = reader.uint32(); break; case 5: - message.bond_denom = reader.string(); + message.bondDenom = reader.string(); + break; + case 6: + message.minCommissionRate = reader.string(); break; default: reader.skipType(tag & 7); @@ -2112,95 +1623,48 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = Duration.fromJSON(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.max_validators !== undefined && object.max_validators !== null) { - message.max_validators = Number(object.max_validators); - } else { - message.max_validators = 0; - } - if (object.max_entries !== undefined && object.max_entries !== null) { - message.max_entries = Number(object.max_entries); - } else { - message.max_entries = 0; - } - if ( - object.historical_entries !== undefined && - object.historical_entries !== null - ) { - message.historical_entries = Number(object.historical_entries); - } else { - message.historical_entries = 0; - } - if (object.bond_denom !== undefined && object.bond_denom !== null) { - message.bond_denom = String(object.bond_denom); - } else { - message.bond_denom = ""; - } - return message; + return { + unbondingTime: isSet(object.unbondingTime) ? Duration.fromJSON(object.unbondingTime) : undefined, + maxValidators: isSet(object.maxValidators) ? Number(object.maxValidators) : 0, + maxEntries: isSet(object.maxEntries) ? Number(object.maxEntries) : 0, + historicalEntries: isSet(object.historicalEntries) ? Number(object.historicalEntries) : 0, + bondDenom: isSet(object.bondDenom) ? String(object.bondDenom) : "", + minCommissionRate: isSet(object.minCommissionRate) ? String(object.minCommissionRate) : "", + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.unbonding_time !== undefined && - (obj.unbonding_time = message.unbonding_time - ? Duration.toJSON(message.unbonding_time) - : undefined); - message.max_validators !== undefined && - (obj.max_validators = message.max_validators); - message.max_entries !== undefined && - (obj.max_entries = message.max_entries); - message.historical_entries !== undefined && - (obj.historical_entries = message.historical_entries); - message.bond_denom !== undefined && (obj.bond_denom = message.bond_denom); + message.unbondingTime !== undefined + && (obj.unbondingTime = message.unbondingTime ? Duration.toJSON(message.unbondingTime) : undefined); + message.maxValidators !== undefined && (obj.maxValidators = Math.round(message.maxValidators)); + message.maxEntries !== undefined && (obj.maxEntries = Math.round(message.maxEntries)); + message.historicalEntries !== undefined && (obj.historicalEntries = Math.round(message.historicalEntries)); + message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom); + message.minCommissionRate !== undefined && (obj.minCommissionRate = message.minCommissionRate); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbonding_time = Duration.fromPartial(object.unbonding_time); - } else { - message.unbonding_time = undefined; - } - if (object.max_validators !== undefined && object.max_validators !== null) { - message.max_validators = object.max_validators; - } else { - message.max_validators = 0; - } - if (object.max_entries !== undefined && object.max_entries !== null) { - message.max_entries = object.max_entries; - } else { - message.max_entries = 0; - } - if ( - object.historical_entries !== undefined && - object.historical_entries !== null - ) { - message.historical_entries = object.historical_entries; - } else { - message.historical_entries = 0; - } - if (object.bond_denom !== undefined && object.bond_denom !== null) { - message.bond_denom = object.bond_denom; - } else { - message.bond_denom = ""; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.unbondingTime = (object.unbondingTime !== undefined && object.unbondingTime !== null) + ? Duration.fromPartial(object.unbondingTime) + : undefined; + message.maxValidators = object.maxValidators ?? 0; + message.maxEntries = object.maxEntries ?? 0; + message.historicalEntries = object.historicalEntries ?? 0; + message.bondDenom = object.bondDenom ?? ""; + message.minCommissionRate = object.minCommissionRate ?? ""; return message; }, }; -const baseDelegationResponse: object = {}; +function createBaseDelegationResponse(): DelegationResponse { + return { delegation: undefined, balance: undefined }; +} export const DelegationResponse = { - encode( - message: DelegationResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegation !== undefined) { Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); } @@ -2210,10 +1674,10 @@ export const DelegationResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelegationResponse } as DelegationResponse; + const message = createBaseDelegationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2232,61 +1696,40 @@ export const DelegationResponse = { }, fromJSON(object: any): DelegationResponse { - const message = { ...baseDelegationResponse } as DelegationResponse; - if (object.delegation !== undefined && object.delegation !== null) { - message.delegation = Delegation.fromJSON(object.delegation); - } else { - message.delegation = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromJSON(object.balance); - } else { - message.balance = undefined; - } - return message; + return { + delegation: isSet(object.delegation) ? Delegation.fromJSON(object.delegation) : undefined, + balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, + }; }, toJSON(message: DelegationResponse): unknown { const obj: any = {}; - message.delegation !== undefined && - (obj.delegation = message.delegation - ? Delegation.toJSON(message.delegation) - : undefined); - message.balance !== undefined && - (obj.balance = message.balance - ? Coin.toJSON(message.balance) - : undefined); + message.delegation !== undefined + && (obj.delegation = message.delegation ? Delegation.toJSON(message.delegation) : undefined); + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial(object: DeepPartial): DelegationResponse { - const message = { ...baseDelegationResponse } as DelegationResponse; - if (object.delegation !== undefined && object.delegation !== null) { - message.delegation = Delegation.fromPartial(object.delegation); - } else { - message.delegation = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromPartial(object.balance); - } else { - message.balance = undefined; - } + fromPartial, I>>(object: I): DelegationResponse { + const message = createBaseDelegationResponse(); + message.delegation = (object.delegation !== undefined && object.delegation !== null) + ? Delegation.fromPartial(object.delegation) + : undefined; + message.balance = (object.balance !== undefined && object.balance !== null) + ? Coin.fromPartial(object.balance) + : undefined; return message; }, }; -const baseRedelegationEntryResponse: object = { balance: "" }; +function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { + return { redelegationEntry: undefined, balance: "" }; +} export const RedelegationEntryResponse = { - encode( - message: RedelegationEntryResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.redelegation_entry !== undefined) { - RedelegationEntry.encode( - message.redelegation_entry, - writer.uint32(10).fork() - ).ldelim(); + encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); } if (message.balance !== "") { writer.uint32(34).string(message.balance); @@ -2294,23 +1737,15 @@ export const RedelegationEntryResponse = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): RedelegationEntryResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; + const message = createBaseRedelegationEntryResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.redelegation_entry = RedelegationEntry.decode( - reader, - reader.uint32() - ); + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); break; case 4: message.balance = reader.string(); @@ -2324,74 +1759,41 @@ export const RedelegationEntryResponse = { }, fromJSON(object: any): RedelegationEntryResponse { - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; - if ( - object.redelegation_entry !== undefined && - object.redelegation_entry !== null - ) { - message.redelegation_entry = RedelegationEntry.fromJSON( - object.redelegation_entry - ); - } else { - message.redelegation_entry = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = String(object.balance); - } else { - message.balance = ""; - } - return message; + return { + redelegationEntry: isSet(object.redelegationEntry) + ? RedelegationEntry.fromJSON(object.redelegationEntry) + : undefined, + balance: isSet(object.balance) ? String(object.balance) : "", + }; }, toJSON(message: RedelegationEntryResponse): unknown { const obj: any = {}; - message.redelegation_entry !== undefined && - (obj.redelegation_entry = message.redelegation_entry - ? RedelegationEntry.toJSON(message.redelegation_entry) - : undefined); + message.redelegationEntry !== undefined && (obj.redelegationEntry = message.redelegationEntry + ? RedelegationEntry.toJSON(message.redelegationEntry) + : undefined); message.balance !== undefined && (obj.balance = message.balance); return obj; }, - fromPartial( - object: DeepPartial - ): RedelegationEntryResponse { - const message = { - ...baseRedelegationEntryResponse, - } as RedelegationEntryResponse; - if ( - object.redelegation_entry !== undefined && - object.redelegation_entry !== null - ) { - message.redelegation_entry = RedelegationEntry.fromPartial( - object.redelegation_entry - ); - } else { - message.redelegation_entry = undefined; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } else { - message.balance = ""; - } + fromPartial, I>>(object: I): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse(); + message.redelegationEntry = (object.redelegationEntry !== undefined && object.redelegationEntry !== null) + ? RedelegationEntry.fromPartial(object.redelegationEntry) + : undefined; + message.balance = object.balance ?? ""; return message; }, }; -const baseRedelegationResponse: object = {}; +function createBaseRedelegationResponse(): RedelegationResponse { + return { redelegation: undefined, entries: [] }; +} export const RedelegationResponse = { - encode( - message: RedelegationResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.redelegation !== undefined) { - Redelegation.encode( - message.redelegation, - writer.uint32(10).fork() - ).ldelim(); + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); } for (const v of message.entries) { RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -2399,11 +1801,10 @@ export const RedelegationResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): RedelegationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; + const message = createBaseRedelegationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2411,9 +1812,7 @@ export const RedelegationResponse = { message.redelegation = Redelegation.decode(reader, reader.uint32()); break; case 2: - message.entries.push( - RedelegationEntryResponse.decode(reader, reader.uint32()) - ); + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2424,79 +1823,63 @@ export const RedelegationResponse = { }, fromJSON(object: any): RedelegationResponse { - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; - if (object.redelegation !== undefined && object.redelegation !== null) { - message.redelegation = Redelegation.fromJSON(object.redelegation); - } else { - message.redelegation = undefined; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntryResponse.fromJSON(e)); - } - } - return message; + return { + redelegation: isSet(object.redelegation) ? Redelegation.fromJSON(object.redelegation) : undefined, + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => RedelegationEntryResponse.fromJSON(e)) + : [], + }; }, toJSON(message: RedelegationResponse): unknown { const obj: any = {}; - message.redelegation !== undefined && - (obj.redelegation = message.redelegation - ? Redelegation.toJSON(message.redelegation) - : undefined); + message.redelegation !== undefined + && (obj.redelegation = message.redelegation ? Redelegation.toJSON(message.redelegation) : undefined); if (message.entries) { - obj.entries = message.entries.map((e) => - e ? RedelegationEntryResponse.toJSON(e) : undefined - ); + obj.entries = message.entries.map((e) => e ? RedelegationEntryResponse.toJSON(e) : undefined); } else { obj.entries = []; } return obj; }, - fromPartial(object: DeepPartial): RedelegationResponse { - const message = { ...baseRedelegationResponse } as RedelegationResponse; - message.entries = []; - if (object.redelegation !== undefined && object.redelegation !== null) { - message.redelegation = Redelegation.fromPartial(object.redelegation); - } else { - message.redelegation = undefined; - } - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(RedelegationEntryResponse.fromPartial(e)); - } - } + fromPartial, I>>(object: I): RedelegationResponse { + const message = createBaseRedelegationResponse(); + message.redelegation = (object.redelegation !== undefined && object.redelegation !== null) + ? Redelegation.fromPartial(object.redelegation) + : undefined; + message.entries = object.entries?.map((e) => RedelegationEntryResponse.fromPartial(e)) || []; return message; }, }; -const basePool: object = { not_bonded_tokens: "", bonded_tokens: "" }; +function createBasePool(): Pool { + return { notBondedTokens: "", bondedTokens: "" }; +} export const Pool = { - encode(message: Pool, writer: Writer = Writer.create()): Writer { - if (message.not_bonded_tokens !== "") { - writer.uint32(10).string(message.not_bonded_tokens); + encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.notBondedTokens !== "") { + writer.uint32(10).string(message.notBondedTokens); } - if (message.bonded_tokens !== "") { - writer.uint32(18).string(message.bonded_tokens); + if (message.bondedTokens !== "") { + writer.uint32(18).string(message.bondedTokens); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Pool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePool } as Pool; + const message = createBasePool(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.not_bonded_tokens = reader.string(); + message.notBondedTokens = reader.string(); break; case 2: - message.bonded_tokens = reader.string(); + message.bondedTokens = reader.string(); break; default: reader.skipType(tag & 7); @@ -2507,72 +1890,110 @@ export const Pool = { }, fromJSON(object: any): Pool { - const message = { ...basePool } as Pool; - if ( - object.not_bonded_tokens !== undefined && - object.not_bonded_tokens !== null - ) { - message.not_bonded_tokens = String(object.not_bonded_tokens); - } else { - message.not_bonded_tokens = ""; - } - if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { - message.bonded_tokens = String(object.bonded_tokens); - } else { - message.bonded_tokens = ""; - } - return message; + return { + notBondedTokens: isSet(object.notBondedTokens) ? String(object.notBondedTokens) : "", + bondedTokens: isSet(object.bondedTokens) ? String(object.bondedTokens) : "", + }; }, toJSON(message: Pool): unknown { const obj: any = {}; - message.not_bonded_tokens !== undefined && - (obj.not_bonded_tokens = message.not_bonded_tokens); - message.bonded_tokens !== undefined && - (obj.bonded_tokens = message.bonded_tokens); + message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens); + message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens); return obj; }, - fromPartial(object: DeepPartial): Pool { - const message = { ...basePool } as Pool; - if ( - object.not_bonded_tokens !== undefined && - object.not_bonded_tokens !== null - ) { - message.not_bonded_tokens = object.not_bonded_tokens; - } else { - message.not_bonded_tokens = ""; + fromPartial, I>>(object: I): Pool { + const message = createBasePool(); + message.notBondedTokens = object.notBondedTokens ?? ""; + message.bondedTokens = object.bondedTokens ?? ""; + return message; + }, +}; + +function createBaseValidatorUpdates(): ValidatorUpdates { + return { updates: [] }; +} + +export const ValidatorUpdates = { + encode(message: ValidatorUpdates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.updates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { - message.bonded_tokens = object.bonded_tokens; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorUpdates { + return { + updates: Array.isArray(object?.updates) ? object.updates.map((e: any) => ValidatorUpdate.fromJSON(e)) : [], + }; + }, + + toJSON(message: ValidatorUpdates): unknown { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); } else { - message.bonded_tokens = ""; + obj.updates = []; } + return obj; + }, + + fromPartial, I>>(object: I): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -2602,7 +2023,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts index f01b60cd29..8397c4d356 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts @@ -1,13 +1,11 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { - Description, - CommissionRates, -} from "../../../cosmos/staking/v1beta1/staking"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin } from "../../base/v1beta1/coin"; +import { CommissionRates, Description, Params } from "./staking"; export const protobufPackage = "cosmos.staking.v1beta1"; @@ -15,60 +13,63 @@ export const protobufPackage = "cosmos.staking.v1beta1"; export interface MsgCreateValidator { description: Description | undefined; commission: CommissionRates | undefined; - min_self_delegation: string; - delegator_address: string; - validator_address: string; + minSelfDelegation: string; + delegatorAddress: string; + validatorAddress: string; pubkey: Any | undefined; value: Coin | undefined; } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ -export interface MsgCreateValidatorResponse {} +export interface MsgCreateValidatorResponse { +} /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidator { description: Description | undefined; - validator_address: string; + validatorAddress: string; /** * We pass a reference to the new commission rate and min self delegation as * it's not mandatory to update. If not updated, the deserialized rate will be * zero with no way to distinguish if an update was intended. * REF: #2373 */ - commission_rate: string; - min_self_delegation: string; + commissionRate: string; + minSelfDelegation: string; } /** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ -export interface MsgEditValidatorResponse {} +export interface MsgEditValidatorResponse { +} /** * MsgDelegate defines a SDK message for performing a delegation of coins * from a delegator to a validator. */ export interface MsgDelegate { - delegator_address: string; - validator_address: string; + delegatorAddress: string; + validatorAddress: string; amount: Coin | undefined; } /** MsgDelegateResponse defines the Msg/Delegate response type. */ -export interface MsgDelegateResponse {} +export interface MsgDelegateResponse { +} /** * MsgBeginRedelegate defines a SDK message for performing a redelegation * of coins from a delegator and source validator to a destination validator. */ export interface MsgBeginRedelegate { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; amount: Coin | undefined; } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponse { - completion_time: Date | undefined; + completionTime: Date | undefined; } /** @@ -76,47 +77,93 @@ export interface MsgBeginRedelegateResponse { * delegate and a validator. */ export interface MsgUndelegate { - delegator_address: string; - validator_address: string; + delegatorAddress: string; + validatorAddress: string; amount: Coin | undefined; } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponse { - completion_time: Date | undefined; + completionTime: Date | undefined; } -const baseMsgCreateValidator: object = { - min_self_delegation: "", - delegator_address: "", - validator_address: "", -}; +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: + | Coin + | undefined; + /** creation_height is the height which the unbonding took place. */ + creationHeight: number; +} + +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponse { +} + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgCreateValidator(): MsgCreateValidator { + return { + description: undefined, + commission: undefined, + minSelfDelegation: "", + delegatorAddress: "", + validatorAddress: "", + pubkey: undefined, + value: undefined, + }; +} export const MsgCreateValidator = { - encode( - message: MsgCreateValidator, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(10).fork() - ).ldelim(); + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } if (message.commission !== undefined) { - CommissionRates.encode( - message.commission, - writer.uint32(18).fork() - ).ldelim(); + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); } - if (message.min_self_delegation !== "") { - writer.uint32(26).string(message.min_self_delegation); + if (message.minSelfDelegation !== "") { + writer.uint32(26).string(message.minSelfDelegation); } - if (message.delegator_address !== "") { - writer.uint32(34).string(message.delegator_address); + if (message.delegatorAddress !== "") { + writer.uint32(34).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(42).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(42).string(message.validatorAddress); } if (message.pubkey !== undefined) { Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim(); @@ -127,10 +174,10 @@ export const MsgCreateValidator = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgCreateValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + const message = createBaseMsgCreateValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -141,13 +188,13 @@ export const MsgCreateValidator = { message.commission = CommissionRates.decode(reader, reader.uint32()); break; case 3: - message.min_self_delegation = reader.string(); + message.minSelfDelegation = reader.string(); break; case 4: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 5: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 6: message.pubkey = Any.decode(reader, reader.uint32()); @@ -164,146 +211,63 @@ export const MsgCreateValidator = { }, fromJSON(object: any): MsgCreateValidator { - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = CommissionRates.fromJSON(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.pubkey !== undefined && object.pubkey !== null) { - message.pubkey = Any.fromJSON(object.pubkey); - } else { - message.pubkey = undefined; - } - if (object.value !== undefined && object.value !== null) { - message.value = Coin.fromJSON(object.value); - } else { - message.value = undefined; - } - return message; + return { + description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, + commission: isSet(object.commission) ? CommissionRates.fromJSON(object.commission) : undefined, + minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + pubkey: isSet(object.pubkey) ? Any.fromJSON(object.pubkey) : undefined, + value: isSet(object.value) ? Coin.fromJSON(object.value) : undefined, + }; }, toJSON(message: MsgCreateValidator): unknown { const obj: any = {}; - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.commission !== undefined && - (obj.commission = message.commission - ? CommissionRates.toJSON(message.commission) - : undefined); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.pubkey !== undefined && - (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); - message.value !== undefined && - (obj.value = message.value ? Coin.toJSON(message.value) : undefined); + message.description !== undefined + && (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.commission !== undefined + && (obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); + message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgCreateValidator { - const message = { ...baseMsgCreateValidator } as MsgCreateValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = CommissionRates.fromPartial(object.commission); - } else { - message.commission = undefined; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.pubkey !== undefined && object.pubkey !== null) { - message.pubkey = Any.fromPartial(object.pubkey); - } else { - message.pubkey = undefined; - } - if (object.value !== undefined && object.value !== null) { - message.value = Coin.fromPartial(object.value); - } else { - message.value = undefined; - } + fromPartial, I>>(object: I): MsgCreateValidator { + const message = createBaseMsgCreateValidator(); + message.description = (object.description !== undefined && object.description !== null) + ? Description.fromPartial(object.description) + : undefined; + message.commission = (object.commission !== undefined && object.commission !== null) + ? CommissionRates.fromPartial(object.commission) + : undefined; + message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.pubkey = (object.pubkey !== undefined && object.pubkey !== null) + ? Any.fromPartial(object.pubkey) + : undefined; + message.value = (object.value !== undefined && object.value !== null) ? Coin.fromPartial(object.value) : undefined; return message; }, }; -const baseMsgCreateValidatorResponse: object = {}; +function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { + return {}; +} export const MsgCreateValidatorResponse = { - encode( - _: MsgCreateValidatorResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgCreateValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgCreateValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; + const message = createBaseMsgCreateValidatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -316,10 +280,7 @@ export const MsgCreateValidatorResponse = { }, fromJSON(_: any): MsgCreateValidatorResponse { - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; - return message; + return {}; }, toJSON(_: MsgCreateValidatorResponse): unknown { @@ -327,46 +288,37 @@ export const MsgCreateValidatorResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgCreateValidatorResponse { - const message = { - ...baseMsgCreateValidatorResponse, - } as MsgCreateValidatorResponse; + fromPartial, I>>(_: I): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse(); return message; }, }; -const baseMsgEditValidator: object = { - validator_address: "", - commission_rate: "", - min_self_delegation: "", -}; +function createBaseMsgEditValidator(): MsgEditValidator { + return { description: undefined, validatorAddress: "", commissionRate: "", minSelfDelegation: "" }; +} export const MsgEditValidator = { - encode(message: MsgEditValidator, writer: Writer = Writer.create()): Writer { + encode(message: MsgEditValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.description !== undefined) { - Description.encode( - message.description, - writer.uint32(10).fork() - ).ldelim(); + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } - if (message.commission_rate !== "") { - writer.uint32(26).string(message.commission_rate); + if (message.commissionRate !== "") { + writer.uint32(26).string(message.commissionRate); } - if (message.min_self_delegation !== "") { - writer.uint32(34).string(message.min_self_delegation); + if (message.minSelfDelegation !== "") { + writer.uint32(34).string(message.minSelfDelegation); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgEditValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgEditValidator } as MsgEditValidator; + const message = createBaseMsgEditValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -374,13 +326,13 @@ export const MsgEditValidator = { message.description = Description.decode(reader, reader.uint32()); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: - message.commission_rate = reader.string(); + message.commissionRate = reader.string(); break; case 4: - message.min_self_delegation = reader.string(); + message.minSelfDelegation = reader.string(); break; default: reader.skipType(tag & 7); @@ -391,108 +343,49 @@ export const MsgEditValidator = { }, fromJSON(object: any): MsgEditValidator { - const message = { ...baseMsgEditValidator } as MsgEditValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromJSON(object.description); - } else { - message.description = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.commission_rate !== undefined && - object.commission_rate !== null - ) { - message.commission_rate = String(object.commission_rate); - } else { - message.commission_rate = ""; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = String(object.min_self_delegation); - } else { - message.min_self_delegation = ""; - } - return message; + return { + description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + commissionRate: isSet(object.commissionRate) ? String(object.commissionRate) : "", + minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", + }; }, toJSON(message: MsgEditValidator): unknown { const obj: any = {}; - message.description !== undefined && - (obj.description = message.description - ? Description.toJSON(message.description) - : undefined); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.commission_rate !== undefined && - (obj.commission_rate = message.commission_rate); - message.min_self_delegation !== undefined && - (obj.min_self_delegation = message.min_self_delegation); + message.description !== undefined + && (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); return obj; }, - fromPartial(object: DeepPartial): MsgEditValidator { - const message = { ...baseMsgEditValidator } as MsgEditValidator; - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromPartial(object.description); - } else { - message.description = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.commission_rate !== undefined && - object.commission_rate !== null - ) { - message.commission_rate = object.commission_rate; - } else { - message.commission_rate = ""; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.min_self_delegation = object.min_self_delegation; - } else { - message.min_self_delegation = ""; - } + fromPartial, I>>(object: I): MsgEditValidator { + const message = createBaseMsgEditValidator(); + message.description = (object.description !== undefined && object.description !== null) + ? Description.fromPartial(object.description) + : undefined; + message.validatorAddress = object.validatorAddress ?? ""; + message.commissionRate = object.commissionRate ?? ""; + message.minSelfDelegation = object.minSelfDelegation ?? ""; return message; }, }; -const baseMsgEditValidatorResponse: object = {}; +function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { + return {}; +} export const MsgEditValidatorResponse = { - encode( - _: MsgEditValidatorResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgEditValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgEditValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; + const message = createBaseMsgEditValidatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -505,10 +398,7 @@ export const MsgEditValidatorResponse = { }, fromJSON(_: any): MsgEditValidatorResponse { - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; - return message; + return {}; }, toJSON(_: MsgEditValidatorResponse): unknown { @@ -516,28 +406,23 @@ export const MsgEditValidatorResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgEditValidatorResponse { - const message = { - ...baseMsgEditValidatorResponse, - } as MsgEditValidatorResponse; + fromPartial, I>>(_: I): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse(); return message; }, }; -const baseMsgDelegate: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseMsgDelegate(): MsgDelegate { + return { delegatorAddress: "", validatorAddress: "", amount: undefined }; +} export const MsgDelegate = { - encode(message: MsgDelegate, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); @@ -545,18 +430,18 @@ export const MsgDelegate = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgDelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDelegate } as MsgDelegate; + const message = createBaseMsgDelegate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: message.amount = Coin.decode(reader, reader.uint32()); @@ -570,80 +455,45 @@ export const MsgDelegate = { }, fromJSON(object: any): MsgDelegate { - const message = { ...baseMsgDelegate } as MsgDelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + }; }, toJSON(message: MsgDelegate): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgDelegate { - const message = { ...baseMsgDelegate } as MsgDelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } + fromPartial, I>>(object: I): MsgDelegate { + const message = createBaseMsgDelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; return message; }, }; -const baseMsgDelegateResponse: object = {}; +function createBaseMsgDelegateResponse(): MsgDelegateResponse { + return {}; +} export const MsgDelegateResponse = { - encode(_: MsgDelegateResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgDelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgDelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; + const message = createBaseMsgDelegateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -656,8 +506,7 @@ export const MsgDelegateResponse = { }, fromJSON(_: any): MsgDelegateResponse { - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; - return message; + return {}; }, toJSON(_: MsgDelegateResponse): unknown { @@ -665,31 +514,26 @@ export const MsgDelegateResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgDelegateResponse { - const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; + fromPartial, I>>(_: I): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse(); return message; }, }; -const baseMsgBeginRedelegate: object = { - delegator_address: "", - validator_src_address: "", - validator_dst_address: "", -}; +function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { + return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", amount: undefined }; +} export const MsgBeginRedelegate = { - encode( - message: MsgBeginRedelegate, - writer: Writer = Writer.create() - ): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_src_address !== "") { - writer.uint32(18).string(message.validator_src_address); + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); } - if (message.validator_dst_address !== "") { - writer.uint32(26).string(message.validator_dst_address); + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); } if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); @@ -697,21 +541,21 @@ export const MsgBeginRedelegate = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + const message = createBaseMsgBeginRedelegate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_src_address = reader.string(); + message.validatorSrcAddress = reader.string(); break; case 3: - message.validator_dst_address = reader.string(); + message.validatorDstAddress = reader.string(); break; case 4: message.amount = Coin.decode(reader, reader.uint32()); @@ -725,119 +569,56 @@ export const MsgBeginRedelegate = { }, fromJSON(object: any): MsgBeginRedelegate { - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = String(object.validator_src_address); - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = String(object.validator_dst_address); - } else { - message.validator_dst_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - return message; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorSrcAddress: isSet(object.validatorSrcAddress) ? String(object.validatorSrcAddress) : "", + validatorDstAddress: isSet(object.validatorDstAddress) ? String(object.validatorDstAddress) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + }; }, toJSON(message: MsgBeginRedelegate): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_src_address !== undefined && - (obj.validator_src_address = message.validator_src_address); - message.validator_dst_address !== undefined && - (obj.validator_dst_address = message.validator_dst_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgBeginRedelegate { - const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validator_src_address = object.validator_src_address; - } else { - message.validator_src_address = ""; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validator_dst_address = object.validator_dst_address; - } else { - message.validator_dst_address = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } + fromPartial, I>>(object: I): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorSrcAddress = object.validatorSrcAddress ?? ""; + message.validatorDstAddress = object.validatorDstAddress ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; return message; }, }; -const baseMsgBeginRedelegateResponse: object = {}; +function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { + return { completionTime: undefined }; +} export const MsgBeginRedelegateResponse = { - encode( - message: MsgBeginRedelegateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(10).fork() - ).ldelim(); + encode(message: MsgBeginRedelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgBeginRedelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; + const message = createBaseMsgBeginRedelegateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -848,60 +629,33 @@ export const MsgBeginRedelegateResponse = { }, fromJSON(object: any): MsgBeginRedelegateResponse { - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; - } - return message; + return { completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined }; }, toJSON(message: MsgBeginRedelegateResponse): unknown { const obj: any = {}; - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); return obj; }, - fromPartial( - object: DeepPartial - ): MsgBeginRedelegateResponse { - const message = { - ...baseMsgBeginRedelegateResponse, - } as MsgBeginRedelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } + fromPartial, I>>(object: I): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse(); + message.completionTime = object.completionTime ?? undefined; return message; }, }; -const baseMsgUndelegate: object = { - delegator_address: "", - validator_address: "", -}; +function createBaseMsgUndelegate(): MsgUndelegate { + return { delegatorAddress: "", validatorAddress: "", amount: undefined }; +} export const MsgUndelegate = { - encode(message: MsgUndelegate, writer: Writer = Writer.create()): Writer { - if (message.delegator_address !== "") { - writer.uint32(10).string(message.delegator_address); + encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); } - if (message.validator_address !== "") { - writer.uint32(18).string(message.validator_address); + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); @@ -909,18 +663,18 @@ export const MsgUndelegate = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUndelegate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUndelegate } as MsgUndelegate; + const message = createBaseMsgUndelegate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.delegator_address = reader.string(); + message.delegatorAddress = reader.string(); break; case 2: - message.validator_address = reader.string(); + message.validatorAddress = reader.string(); break; case 3: message.amount = Coin.decode(reader, reader.uint32()); @@ -934,96 +688,225 @@ export const MsgUndelegate = { }, fromJSON(object: any): MsgUndelegate { - const message = { ...baseMsgUndelegate } as MsgUndelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = String(object.delegator_address); - } else { - message.delegator_address = ""; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + }; + }, + + toJSON(message: MsgUndelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUndelegate { + const message = createBaseMsgUndelegate(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + return message; + }, +}; + +function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { + return { completionTime: undefined }; +} + +export const MsgUndelegateResponse = { + encode(message: MsgUndelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: MsgUndelegate): unknown { + fromJSON(object: any): MsgUndelegateResponse { + return { completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined }; + }, + + toJSON(message: MsgUndelegateResponse): unknown { const obj: any = {}; - message.delegator_address !== undefined && - (obj.delegator_address = message.delegator_address); - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); return obj; }, - fromPartial(object: DeepPartial): MsgUndelegate { - const message = { ...baseMsgUndelegate } as MsgUndelegate; - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegator_address = object.delegator_address; - } else { - message.delegator_address = ""; + fromPartial, I>>(object: I): MsgUndelegateResponse { + const message = createBaseMsgUndelegateResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, +}; + +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { delegatorAddress: "", validatorAddress: "", amount: undefined, creationHeight: 0 }; +} + +export const MsgCancelUnbondingDelegation = { + encode(message: MsgCancelUnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; + if (message.creationHeight !== 0) { + writer.uint32(32).int64(message.creationHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.creationHeight = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): MsgCancelUnbondingDelegation { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + creationHeight: isSet(object.creationHeight) ? Number(object.creationHeight) : 0, + }; + }, + + toJSON(message: MsgCancelUnbondingDelegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.creationHeight !== undefined && (obj.creationHeight = Math.round(message.creationHeight)); + return obj; + }, + + fromPartial, I>>(object: I): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + message.creationHeight = object.creationHeight ?? 0; + return message; + }, }; -const baseMsgUndelegateResponse: object = {}; +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} -export const MsgUndelegateResponse = { - encode( - message: MsgUndelegateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.completion_time !== undefined) { - Timestamp.encode( - toTimestamp(message.completion_time), - writer.uint32(10).fork() - ).ldelim(); +export const MsgCancelUnbondingDelegationResponse = { + encode(_: MsgCancelUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCancelUnbondingDelegationResponse { + return {}; + }, + + toJSON(_: MsgCancelUnbondingDelegationResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUndelegateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + const message = createBaseMsgUpdateParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.completion_time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1033,41 +916,65 @@ export const MsgUndelegateResponse = { return message; }, - fromJSON(object: any): MsgUndelegateResponse { - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = fromJsonTimestamp(object.completion_time); - } else { - message.completion_time = undefined; + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: MsgUndelegateResponse): unknown { + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { const obj: any = {}; - message.completion_time !== undefined && - (obj.completion_time = - message.completion_time !== undefined - ? message.completion_time.toISOString() - : null); return obj; }, - fromPartial( - object: DeepPartial - ): MsgUndelegateResponse { - const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completion_time = object.completion_time; - } else { - message.completion_time = undefined; - } + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, }; @@ -1075,9 +982,7 @@ export const MsgUndelegateResponse = { /** Msg defines the staking Msg service. */ export interface Msg { /** CreateValidator defines a method for creating a new validator. */ - CreateValidator( - request: MsgCreateValidator - ): Promise; + CreateValidator(request: MsgCreateValidator): Promise; /** EditValidator defines a method for editing an existing validator. */ EditValidator(request: MsgEditValidator): Promise; /** @@ -1089,103 +994,116 @@ export interface Msg { * BeginRedelegate defines a method for performing a redelegation * of coins from a delegator and source validator to a destination validator. */ - BeginRedelegate( - request: MsgBeginRedelegate - ): Promise; + BeginRedelegate(request: MsgBeginRedelegate): Promise; /** * Undelegate defines a method for performing an undelegation from a * delegate and a validator. */ Undelegate(request: MsgUndelegate): Promise; + /** + * CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + * and delegate back to previous validator. + * + * Since: cosmos-sdk 0.46 + */ + CancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise; + /** + * UpdateParams defines an operation for updating the x/staking module + * parameters. + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.CreateValidator = this.CreateValidator.bind(this); + this.EditValidator = this.EditValidator.bind(this); + this.Delegate = this.Delegate.bind(this); + this.BeginRedelegate = this.BeginRedelegate.bind(this); + this.Undelegate = this.Undelegate.bind(this); + this.CancelUnbondingDelegation = this.CancelUnbondingDelegation.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); } - CreateValidator( - request: MsgCreateValidator - ): Promise { + CreateValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "CreateValidator", - data - ); - return promise.then((data) => - MsgCreateValidatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); + return promise.then((data) => MsgCreateValidatorResponse.decode(new _m0.Reader(data))); } EditValidator(request: MsgEditValidator): Promise { const data = MsgEditValidator.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "EditValidator", - data - ); - return promise.then((data) => - MsgEditValidatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); + return promise.then((data) => MsgEditValidatorResponse.decode(new _m0.Reader(data))); } Delegate(request: MsgDelegate): Promise { const data = MsgDelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "Delegate", - data - ); - return promise.then((data) => MsgDelegateResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); + return promise.then((data) => MsgDelegateResponse.decode(new _m0.Reader(data))); } - BeginRedelegate( - request: MsgBeginRedelegate - ): Promise { + BeginRedelegate(request: MsgBeginRedelegate): Promise { const data = MsgBeginRedelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "BeginRedelegate", - data - ); - return promise.then((data) => - MsgBeginRedelegateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); + return promise.then((data) => MsgBeginRedelegateResponse.decode(new _m0.Reader(data))); } Undelegate(request: MsgUndelegate): Promise { const data = MsgUndelegate.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.staking.v1beta1.Msg", - "Undelegate", - data - ); - return promise.then((data) => - MsgUndelegateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); + return promise.then((data) => MsgUndelegateResponse.decode(new _m0.Reader(data))); + } + + CancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise { + const data = MsgCancelUnbondingDelegation.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); + return promise.then((data) => MsgCancelUnbondingDelegationResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -1207,3 +1125,19 @@ function fromJsonTimestamp(o: any): Date { return fromTimestamp(Timestamp.fromJSON(o)); } } + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/duration.ts index 0cb51f5a90..01ce7b0bf9 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/duration.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/duration.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -83,10 +83,12 @@ export interface Duration { nanos: number; } -const baseDuration: object = { seconds: 0, nanos: 0 }; +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -96,10 +98,10 @@ export const Duration = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDuration } as Duration; + const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,64 +120,57 @@ export const Duration = { }, fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -183,7 +178,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/abci/types.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/abci/types.ts new file mode 100644 index 0000000000..efc195a846 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/abci/types.ts @@ -0,0 +1,4526 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { PublicKey } from "../crypto/keys"; +import { ProofOps } from "../crypto/proof"; +import { ConsensusParams } from "../types/params"; +import { Header } from "../types/types"; + +export const protobufPackage = "tendermint.abci"; + +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} + +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} + +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + case CheckTxType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum MisbehaviorType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} + +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { + switch (object) { + case 0: + case "UNKNOWN": + return MisbehaviorType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return MisbehaviorType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return MisbehaviorType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return MisbehaviorType.UNRECOGNIZED; + } +} + +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { + switch (object) { + case MisbehaviorType.UNKNOWN: + return "UNKNOWN"; + case MisbehaviorType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case MisbehaviorType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + case MisbehaviorType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface Request { + echo: RequestEcho | undefined; + flush: RequestFlush | undefined; + info: RequestInfo | undefined; + initChain: RequestInitChain | undefined; + query: RequestQuery | undefined; + beginBlock: RequestBeginBlock | undefined; + checkTx: RequestCheckTx | undefined; + deliverTx: RequestDeliverTx | undefined; + endBlock: RequestEndBlock | undefined; + commit: RequestCommit | undefined; + listSnapshots: RequestListSnapshots | undefined; + offerSnapshot: RequestOfferSnapshot | undefined; + loadSnapshotChunk: RequestLoadSnapshotChunk | undefined; + applySnapshotChunk: RequestApplySnapshotChunk | undefined; + prepareProposal: RequestPrepareProposal | undefined; + processProposal: RequestProcessProposal | undefined; +} + +export interface RequestEcho { + message: string; +} + +export interface RequestFlush { +} + +export interface RequestInfo { + version: string; + blockVersion: number; + p2pVersion: number; + abciVersion: string; +} + +export interface RequestInitChain { + time: Date | undefined; + chainId: string; + consensusParams: ConsensusParams | undefined; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: number; +} + +export interface RequestQuery { + data: Uint8Array; + path: string; + height: number; + prove: boolean; +} + +export interface RequestBeginBlock { + hash: Uint8Array; + header: Header | undefined; + lastCommitInfo: CommitInfo | undefined; + byzantineValidators: Misbehavior[]; +} + +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} + +export interface RequestDeliverTx { + tx: Uint8Array; +} + +export interface RequestEndBlock { + height: number; +} + +export interface RequestCommit { +} + +/** lists available snapshots */ +export interface RequestListSnapshots { +} + +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot: + | Snapshot + | undefined; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} + +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: number; + format: number; + chunk: number; +} + +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} + +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: number; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo | undefined; + misbehavior: Misbehavior[]; + height: number; + time: Date | undefined; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} + +export interface RequestProcessProposal { + txs: Uint8Array[]; + proposedLastCommit: CommitInfo | undefined; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: number; + time: Date | undefined; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} + +export interface Response { + exception: ResponseException | undefined; + echo: ResponseEcho | undefined; + flush: ResponseFlush | undefined; + info: ResponseInfo | undefined; + initChain: ResponseInitChain | undefined; + query: ResponseQuery | undefined; + beginBlock: ResponseBeginBlock | undefined; + checkTx: ResponseCheckTx | undefined; + deliverTx: ResponseDeliverTx | undefined; + endBlock: ResponseEndBlock | undefined; + commit: ResponseCommit | undefined; + listSnapshots: ResponseListSnapshots | undefined; + offerSnapshot: ResponseOfferSnapshot | undefined; + loadSnapshotChunk: ResponseLoadSnapshotChunk | undefined; + applySnapshotChunk: ResponseApplySnapshotChunk | undefined; + prepareProposal: ResponsePrepareProposal | undefined; + processProposal: ResponseProcessProposal | undefined; +} + +/** nondeterministic */ +export interface ResponseException { + error: string; +} + +export interface ResponseEcho { + message: string; +} + +export interface ResponseFlush { +} + +export interface ResponseInfo { + data: string; + version: string; + appVersion: number; + lastBlockHeight: number; + lastBlockAppHash: Uint8Array; +} + +export interface ResponseInitChain { + consensusParams: ConsensusParams | undefined; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} + +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: number; + key: Uint8Array; + value: Uint8Array; + proofOps: ProofOps | undefined; + height: number; + codespace: string; +} + +export interface ResponseBeginBlock { + events: Event[]; +} + +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: number; + gasUsed: number; + events: Event[]; + codespace: string; + sender: string; + priority: number; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempoolError: string; +} + +export interface ResponseDeliverTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: number; + gasUsed: number; + /** nondeterministic */ + events: Event[]; + codespace: string; +} + +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates: ConsensusParams | undefined; + events: Event[]; +} + +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: number; +} + +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} + +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} + +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} + +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} + +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + case ResponseOfferSnapshot_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} + +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} + +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} + +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} + +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} + +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} + +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} + +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } +} + +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface CommitInfo { + round: number; + votes: VoteInfo[]; +} + +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} + +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string; + attributes: EventAttribute[]; +} + +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: string; + value: string; + /** nondeterministic */ + index: boolean; +} + +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: number; + index: number; + tx: Uint8Array; + result: ResponseDeliverTx | undefined; +} + +/** Validator */ +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: number; +} + +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey: PublicKey | undefined; + power: number; +} + +/** VoteInfo */ +export interface VoteInfo { + validator: Validator | undefined; + signedLastBlock: boolean; +} + +export interface ExtendedVoteInfo { + validator: Validator | undefined; + signedLastBlock: boolean; + /** Reserved for future use */ + voteExtension: Uint8Array; +} + +export interface Misbehavior { + type: MisbehaviorType; + /** The offending validator */ + validator: + | Validator + | undefined; + /** The height when the offense occurred */ + height: number; + /** The corresponding time where the offense occurred */ + time: + | Date + | undefined; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: number; +} + +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: number; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} + +function createBaseRequest(): Request { + return { + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + }; +} + +export const Request = { + encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); + } + if (message.initChain !== undefined) { + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); + } + if (message.query !== undefined) { + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Request { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Request { + return { + echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined, + flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined, + info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined, + initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined, + query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined, + beginBlock: isSet(object.beginBlock) ? RequestBeginBlock.fromJSON(object.beginBlock) : undefined, + checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined, + deliverTx: isSet(object.deliverTx) ? RequestDeliverTx.fromJSON(object.deliverTx) : undefined, + endBlock: isSet(object.endBlock) ? RequestEndBlock.fromJSON(object.endBlock) : undefined, + commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined, + listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined, + offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) + ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) + : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) + ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk) + : undefined, + prepareProposal: isSet(object.prepareProposal) + ? RequestPrepareProposal.fromJSON(object.prepareProposal) + : undefined, + processProposal: isSet(object.processProposal) + ? RequestProcessProposal.fromJSON(object.processProposal) + : undefined, + }; + }, + + toJSON(message: Request): unknown { + const obj: any = {}; + message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); + message.initChain !== undefined + && (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined + && (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined + && (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined + && (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined + && (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined + && (obj.listSnapshots = message.listSnapshots ? RequestListSnapshots.toJSON(message.listSnapshots) : undefined); + message.offerSnapshot !== undefined + && (obj.offerSnapshot = message.offerSnapshot ? RequestOfferSnapshot.toJSON(message.offerSnapshot) : undefined); + message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk + ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal + ? RequestPrepareProposal.toJSON(message.prepareProposal) + : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal + ? RequestProcessProposal.toJSON(message.processProposal) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Request { + const message = createBaseRequest(); + message.echo = (object.echo !== undefined && object.echo !== null) + ? RequestEcho.fromPartial(object.echo) + : undefined; + message.flush = (object.flush !== undefined && object.flush !== null) + ? RequestFlush.fromPartial(object.flush) + : undefined; + message.info = (object.info !== undefined && object.info !== null) + ? RequestInfo.fromPartial(object.info) + : undefined; + message.initChain = (object.initChain !== undefined && object.initChain !== null) + ? RequestInitChain.fromPartial(object.initChain) + : undefined; + message.query = (object.query !== undefined && object.query !== null) + ? RequestQuery.fromPartial(object.query) + : undefined; + message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) + ? RequestBeginBlock.fromPartial(object.beginBlock) + : undefined; + message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) + ? RequestCheckTx.fromPartial(object.checkTx) + : undefined; + message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) + ? RequestDeliverTx.fromPartial(object.deliverTx) + : undefined; + message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) + ? RequestEndBlock.fromPartial(object.endBlock) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? RequestCommit.fromPartial(object.commit) + : undefined; + message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) + ? RequestListSnapshots.fromPartial(object.listSnapshots) + : undefined; + message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) + ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined; + message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) + ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined; + message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) + ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined; + message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null) + ? RequestPrepareProposal.fromPartial(object.prepareProposal) + : undefined; + message.processProposal = (object.processProposal !== undefined && object.processProposal !== null) + ? RequestProcessProposal.fromPartial(object.processProposal) + : undefined; + return message; + }, +}; + +function createBaseRequestEcho(): RequestEcho { + return { message: "" }; +} + +export const RequestEcho = { + encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestEcho { + return { message: isSet(object.message) ? String(object.message) : "" }; + }, + + toJSON(message: RequestEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial, I>>(object: I): RequestEcho { + const message = createBaseRequestEcho(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseRequestFlush(): RequestFlush { + return {}; +} + +export const RequestFlush = { + encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestFlush { + return {}; + }, + + toJSON(_: RequestFlush): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): RequestFlush { + const message = createBaseRequestFlush(); + return message; + }, +}; + +function createBaseRequestInfo(): RequestInfo { + return { version: "", blockVersion: 0, p2pVersion: 0, abciVersion: "" }; +} + +export const RequestInfo = { + encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.blockVersion !== 0) { + writer.uint32(16).uint64(message.blockVersion); + } + if (message.p2pVersion !== 0) { + writer.uint32(24).uint64(message.p2pVersion); + } + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = longToNumber(reader.uint64() as Long); + break; + case 3: + message.p2pVersion = longToNumber(reader.uint64() as Long); + break; + case 4: + message.abciVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestInfo { + return { + version: isSet(object.version) ? String(object.version) : "", + blockVersion: isSet(object.blockVersion) ? Number(object.blockVersion) : 0, + p2pVersion: isSet(object.p2pVersion) ? Number(object.p2pVersion) : 0, + abciVersion: isSet(object.abciVersion) ? String(object.abciVersion) : "", + }; + }, + + toJSON(message: RequestInfo): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.blockVersion !== undefined && (obj.blockVersion = Math.round(message.blockVersion)); + message.p2pVersion !== undefined && (obj.p2pVersion = Math.round(message.p2pVersion)); + message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion); + return obj; + }, + + fromPartial, I>>(object: I): RequestInfo { + const message = createBaseRequestInfo(); + message.version = object.version ?? ""; + message.blockVersion = object.blockVersion ?? 0; + message.p2pVersion = object.p2pVersion ?? 0; + message.abciVersion = object.abciVersion ?? ""; + return message; + }, +}; + +function createBaseRequestInitChain(): RequestInitChain { + return { + time: undefined, + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: 0, + }; +} + +export const RequestInitChain = { + encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (message.initialHeight !== 0) { + writer.uint32(48).int64(message.initialHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestInitChain { + return { + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(), + initialHeight: isSet(object.initialHeight) ? Number(object.initialHeight) : 0, + }; + }, + + toJSON(message: RequestInitChain): unknown { + const obj: any = {}; + message.time !== undefined && (obj.time = message.time.toISOString()); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.consensusParams !== undefined + && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.appStateBytes !== undefined + && (obj.appStateBytes = base64FromBytes( + message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), + )); + message.initialHeight !== undefined && (obj.initialHeight = Math.round(message.initialHeight)); + return obj; + }, + + fromPartial, I>>(object: I): RequestInitChain { + const message = createBaseRequestInitChain(); + message.time = object.time ?? undefined; + message.chainId = object.chainId ?? ""; + message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined; + message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.appStateBytes = object.appStateBytes ?? new Uint8Array(); + message.initialHeight = object.initialHeight ?? 0; + return message; + }, +}; + +function createBaseRequestQuery(): RequestQuery { + return { data: new Uint8Array(), path: "", height: 0, prove: false }; +} + +export const RequestQuery = { + encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestQuery(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestQuery { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + path: isSet(object.path) ? String(object.path) : "", + height: isSet(object.height) ? Number(object.height) : 0, + prove: isSet(object.prove) ? Boolean(object.prove) : false, + }; + }, + + toJSON(message: RequestQuery): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.path !== undefined && (obj.path = message.path); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.prove !== undefined && (obj.prove = message.prove); + return obj; + }, + + fromPartial, I>>(object: I): RequestQuery { + const message = createBaseRequestQuery(); + message.data = object.data ?? new Uint8Array(); + message.path = object.path ?? ""; + message.height = object.height ?? 0; + message.prove = object.prove ?? false; + return message; + }, +}; + +function createBaseRequestBeginBlock(): RequestBeginBlock { + return { hash: new Uint8Array(), header: undefined, lastCommitInfo: undefined, byzantineValidators: [] }; +} + +export const RequestBeginBlock = { + encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.lastCommitInfo !== undefined) { + CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.byzantineValidators) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestBeginBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestBeginBlock { + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + lastCommitInfo: isSet(object.lastCommitInfo) ? CommitInfo.fromJSON(object.lastCommitInfo) : undefined, + byzantineValidators: Array.isArray(object?.byzantineValidators) + ? object.byzantineValidators.map((e: any) => Misbehavior.fromJSON(e)) + : [], + }; + }, + + toJSON(message: RequestBeginBlock): unknown { + const obj: any = {}; + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.lastCommitInfo !== undefined + && (obj.lastCommitInfo = message.lastCommitInfo ? CommitInfo.toJSON(message.lastCommitInfo) : undefined); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.byzantineValidators = []; + } + return obj; + }, + + fromPartial, I>>(object: I): RequestBeginBlock { + const message = createBaseRequestBeginBlock(); + message.hash = object.hash ?? new Uint8Array(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.lastCommitInfo = (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) + ? CommitInfo.fromPartial(object.lastCommitInfo) + : undefined; + message.byzantineValidators = object.byzantineValidators?.map((e) => Misbehavior.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseRequestCheckTx(): RequestCheckTx { + return { tx: new Uint8Array(), type: 0 }; +} + +export const RequestCheckTx = { + encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCheckTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestCheckTx { + return { + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0, + }; + }, + + toJSON(message: RequestCheckTx): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>(object: I): RequestCheckTx { + const message = createBaseRequestCheckTx(); + message.tx = object.tx ?? new Uint8Array(); + message.type = object.type ?? 0; + return message; + }, +}; + +function createBaseRequestDeliverTx(): RequestDeliverTx { + return { tx: new Uint8Array() }; +} + +export const RequestDeliverTx = { + encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestDeliverTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestDeliverTx { + return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array() }; + }, + + toJSON(message: RequestDeliverTx): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): RequestDeliverTx { + const message = createBaseRequestDeliverTx(); + message.tx = object.tx ?? new Uint8Array(); + return message; + }, +}; + +function createBaseRequestEndBlock(): RequestEndBlock { + return { height: 0 }; +} + +export const RequestEndBlock = { + encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== 0) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEndBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestEndBlock { + return { height: isSet(object.height) ? Number(object.height) : 0 }; + }, + + toJSON(message: RequestEndBlock): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = Math.round(message.height)); + return obj; + }, + + fromPartial, I>>(object: I): RequestEndBlock { + const message = createBaseRequestEndBlock(); + message.height = object.height ?? 0; + return message; + }, +}; + +function createBaseRequestCommit(): RequestCommit { + return {}; +} + +export const RequestCommit = { + encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestCommit { + return {}; + }, + + toJSON(_: RequestCommit): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): RequestCommit { + const message = createBaseRequestCommit(); + return message; + }, +}; + +function createBaseRequestListSnapshots(): RequestListSnapshots { + return {}; +} + +export const RequestListSnapshots = { + encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestListSnapshots { + return {}; + }, + + toJSON(_: RequestListSnapshots): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); + return message; + }, +}; + +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { snapshot: undefined, appHash: new Uint8Array() }; +} + +export const RequestOfferSnapshot = { + encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestOfferSnapshot { + return { + snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined, + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + }; + }, + + toJSON(message: RequestOfferSnapshot): unknown { + const obj: any = {}; + message.snapshot !== undefined && (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined); + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + message.snapshot = (object.snapshot !== undefined && object.snapshot !== null) + ? Snapshot.fromPartial(object.snapshot) + : undefined; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, +}; + +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { height: 0, format: 0, chunk: 0 }; +} + +export const RequestLoadSnapshotChunk = { + encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== 0) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunk !== 0) { + writer.uint32(24).uint32(message.chunk); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = longToNumber(reader.uint64() as Long); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestLoadSnapshotChunk { + return { + height: isSet(object.height) ? Number(object.height) : 0, + format: isSet(object.format) ? Number(object.format) : 0, + chunk: isSet(object.chunk) ? Number(object.chunk) : 0, + }; + }, + + toJSON(message: RequestLoadSnapshotChunk): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = Math.round(message.height)); + message.format !== undefined && (obj.format = Math.round(message.format)); + message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); + return obj; + }, + + fromPartial, I>>(object: I): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + message.height = object.height ?? 0; + message.format = object.format ?? 0; + message.chunk = object.chunk ?? 0; + return message; + }, +}; + +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { index: 0, chunk: new Uint8Array(), sender: "" }; +} + +export const RequestApplySnapshotChunk = { + encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestApplySnapshotChunk { + return { + index: isSet(object.index) ? Number(object.index) : 0, + chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(), + sender: isSet(object.sender) ? String(object.sender) : "", + }; + }, + + toJSON(message: RequestApplySnapshotChunk): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = Math.round(message.index)); + message.chunk !== undefined + && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, + + fromPartial, I>>(object: I): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + message.index = object.index ?? 0; + message.chunk = object.chunk ?? new Uint8Array(); + message.sender = object.sender ?? ""; + return message; + }, +}; + +function createBaseRequestPrepareProposal(): RequestPrepareProposal { + return { + maxTxBytes: 0, + txs: [], + localLastCommit: undefined, + misbehavior: [], + height: 0, + time: undefined, + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} + +export const RequestPrepareProposal = { + encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxTxBytes !== 0) { + writer.uint32(8).int64(message.maxTxBytes); + } + for (const v of message.txs) { + writer.uint32(18).bytes(v!); + } + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 5: + message.height = longToNumber(reader.int64() as Long); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestPrepareProposal { + return { + maxTxBytes: isSet(object.maxTxBytes) ? Number(object.maxTxBytes) : 0, + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + localLastCommit: isSet(object.localLastCommit) ? ExtendedCommitInfo.fromJSON(object.localLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) + ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) + : [], + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; + }, + + toJSON(message: RequestPrepareProposal): unknown { + const obj: any = {}; + message.maxTxBytes !== undefined && (obj.maxTxBytes = Math.round(message.maxTxBytes)); + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.localLastCommit !== undefined + && (obj.localLastCommit = message.localLastCommit + ? ExtendedCommitInfo.toJSON(message.localLastCommit) + : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes ?? 0; + message.txs = object.txs?.map((e) => e) || []; + message.localLastCommit = (object.localLastCommit !== undefined && object.localLastCommit !== null) + ? ExtendedCommitInfo.fromPartial(object.localLastCommit) + : undefined; + message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, +}; + +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: undefined, + misbehavior: [], + hash: new Uint8Array(), + height: 0, + time: undefined, + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} + +export const RequestProcessProposal = { + encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== 0) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = longToNumber(reader.int64() as Long); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestProcessProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + proposedLastCommit: isSet(object.proposedLastCommit) ? CommitInfo.fromJSON(object.proposedLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) + ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) + : [], + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; + }, + + toJSON(message: RequestProcessProposal): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.proposedLastCommit !== undefined && (obj.proposedLastCommit = message.proposedLastCommit + ? CommitInfo.toJSON(message.proposedLastCommit) + : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map((e) => e) || []; + message.proposedLastCommit = (object.proposedLastCommit !== undefined && object.proposedLastCommit !== null) + ? CommitInfo.fromPartial(object.proposedLastCommit) + : undefined; + message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, +}; + +function createBaseResponse(): Response { + return { + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + }; +} + +export const Response = { + encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); + } + if (message.echo !== undefined) { + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); + } + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + if (message.prepareProposal !== undefined) { + ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Response { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = ResponseInfo.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Response { + return { + exception: isSet(object.exception) ? ResponseException.fromJSON(object.exception) : undefined, + echo: isSet(object.echo) ? ResponseEcho.fromJSON(object.echo) : undefined, + flush: isSet(object.flush) ? ResponseFlush.fromJSON(object.flush) : undefined, + info: isSet(object.info) ? ResponseInfo.fromJSON(object.info) : undefined, + initChain: isSet(object.initChain) ? ResponseInitChain.fromJSON(object.initChain) : undefined, + query: isSet(object.query) ? ResponseQuery.fromJSON(object.query) : undefined, + beginBlock: isSet(object.beginBlock) ? ResponseBeginBlock.fromJSON(object.beginBlock) : undefined, + checkTx: isSet(object.checkTx) ? ResponseCheckTx.fromJSON(object.checkTx) : undefined, + deliverTx: isSet(object.deliverTx) ? ResponseDeliverTx.fromJSON(object.deliverTx) : undefined, + endBlock: isSet(object.endBlock) ? ResponseEndBlock.fromJSON(object.endBlock) : undefined, + commit: isSet(object.commit) ? ResponseCommit.fromJSON(object.commit) : undefined, + listSnapshots: isSet(object.listSnapshots) ? ResponseListSnapshots.fromJSON(object.listSnapshots) : undefined, + offerSnapshot: isSet(object.offerSnapshot) ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) + ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) + : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) + ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk) + : undefined, + prepareProposal: isSet(object.prepareProposal) + ? ResponsePrepareProposal.fromJSON(object.prepareProposal) + : undefined, + processProposal: isSet(object.processProposal) + ? ResponseProcessProposal.fromJSON(object.processProposal) + : undefined, + }; + }, + + toJSON(message: Response): unknown { + const obj: any = {}; + message.exception !== undefined + && (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined); + message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); + message.initChain !== undefined + && (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined + && (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined + && (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined + && (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined + && (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined + && (obj.listSnapshots = message.listSnapshots ? ResponseListSnapshots.toJSON(message.listSnapshots) : undefined); + message.offerSnapshot !== undefined + && (obj.offerSnapshot = message.offerSnapshot ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) : undefined); + message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk + ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal + ? ResponsePrepareProposal.toJSON(message.prepareProposal) + : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal + ? ResponseProcessProposal.toJSON(message.processProposal) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Response { + const message = createBaseResponse(); + message.exception = (object.exception !== undefined && object.exception !== null) + ? ResponseException.fromPartial(object.exception) + : undefined; + message.echo = (object.echo !== undefined && object.echo !== null) + ? ResponseEcho.fromPartial(object.echo) + : undefined; + message.flush = (object.flush !== undefined && object.flush !== null) + ? ResponseFlush.fromPartial(object.flush) + : undefined; + message.info = (object.info !== undefined && object.info !== null) + ? ResponseInfo.fromPartial(object.info) + : undefined; + message.initChain = (object.initChain !== undefined && object.initChain !== null) + ? ResponseInitChain.fromPartial(object.initChain) + : undefined; + message.query = (object.query !== undefined && object.query !== null) + ? ResponseQuery.fromPartial(object.query) + : undefined; + message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) + ? ResponseBeginBlock.fromPartial(object.beginBlock) + : undefined; + message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) + ? ResponseCheckTx.fromPartial(object.checkTx) + : undefined; + message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) + ? ResponseDeliverTx.fromPartial(object.deliverTx) + : undefined; + message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) + ? ResponseEndBlock.fromPartial(object.endBlock) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? ResponseCommit.fromPartial(object.commit) + : undefined; + message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) + ? ResponseListSnapshots.fromPartial(object.listSnapshots) + : undefined; + message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) + ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined; + message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) + ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined; + message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) + ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined; + message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null) + ? ResponsePrepareProposal.fromPartial(object.prepareProposal) + : undefined; + message.processProposal = (object.processProposal !== undefined && object.processProposal !== null) + ? ResponseProcessProposal.fromPartial(object.processProposal) + : undefined; + return message; + }, +}; + +function createBaseResponseException(): ResponseException { + return { error: "" }; +} + +export const ResponseException = { + encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.error !== "") { + writer.uint32(10).string(message.error); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseException(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseException { + return { error: isSet(object.error) ? String(object.error) : "" }; + }, + + toJSON(message: ResponseException): unknown { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error); + return obj; + }, + + fromPartial, I>>(object: I): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; + return message; + }, +}; + +function createBaseResponseEcho(): ResponseEcho { + return { message: "" }; +} + +export const ResponseEcho = { + encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseEcho { + return { message: isSet(object.message) ? String(object.message) : "" }; + }, + + toJSON(message: ResponseEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial, I>>(object: I): ResponseEcho { + const message = createBaseResponseEcho(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseResponseFlush(): ResponseFlush { + return {}; +} + +export const ResponseFlush = { + encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ResponseFlush { + return {}; + }, + + toJSON(_: ResponseFlush): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): ResponseFlush { + const message = createBaseResponseFlush(); + return message; + }, +}; + +function createBaseResponseInfo(): ResponseInfo { + return { data: "", version: "", appVersion: 0, lastBlockHeight: 0, lastBlockAppHash: new Uint8Array() }; +} + +export const ResponseInfo = { + encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.appVersion !== 0) { + writer.uint32(24).uint64(message.appVersion); + } + if (message.lastBlockHeight !== 0) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = longToNumber(reader.uint64() as Long); + break; + case 4: + message.lastBlockHeight = longToNumber(reader.int64() as Long); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseInfo { + return { + data: isSet(object.data) ? String(object.data) : "", + version: isSet(object.version) ? String(object.version) : "", + appVersion: isSet(object.appVersion) ? Number(object.appVersion) : 0, + lastBlockHeight: isSet(object.lastBlockHeight) ? Number(object.lastBlockHeight) : 0, + lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array(), + }; + }, + + toJSON(message: ResponseInfo): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = message.data); + message.version !== undefined && (obj.version = message.version); + message.appVersion !== undefined && (obj.appVersion = Math.round(message.appVersion)); + message.lastBlockHeight !== undefined && (obj.lastBlockHeight = Math.round(message.lastBlockHeight)); + message.lastBlockAppHash !== undefined + && (obj.lastBlockAppHash = base64FromBytes( + message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): ResponseInfo { + const message = createBaseResponseInfo(); + message.data = object.data ?? ""; + message.version = object.version ?? ""; + message.appVersion = object.appVersion ?? 0; + message.lastBlockHeight = object.lastBlockHeight ?? 0; + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); + return message; + }, +}; + +function createBaseResponseInitChain(): ResponseInitChain { + return { consensusParams: undefined, validators: [], appHash: new Uint8Array() }; +} + +export const ResponseInitChain = { + encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseInitChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseInitChain { + return { + consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + }; + }, + + toJSON(message: ResponseInitChain): unknown { + const obj: any = {}; + message.consensusParams !== undefined + && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): ResponseInitChain { + const message = createBaseResponseInitChain(); + message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined; + message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, +}; + +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: "", + info: "", + index: 0, + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: 0, + codespace: "", + }; +} + +export const ResponseQuery = { + encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.index !== 0) { + writer.uint32(40).int64(message.index); + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(72).int64(message.height); + } + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseQuery(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = longToNumber(reader.int64() as Long); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = longToNumber(reader.int64() as Long); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseQuery { + return { + code: isSet(object.code) ? Number(object.code) : 0, + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + index: isSet(object.index) ? Number(object.index) : 0, + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + codespace: isSet(object.codespace) ? String(object.codespace) : "", + }; + }, + + toJSON(message: ResponseQuery): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial, I>>(object: I): ResponseQuery { + const message = createBaseResponseQuery(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.index = object.index ?? 0; + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = (object.proofOps !== undefined && object.proofOps !== null) + ? ProofOps.fromPartial(object.proofOps) + : undefined; + message.height = object.height ?? 0; + message.codespace = object.codespace ?? ""; + return message; + }, +}; + +function createBaseResponseBeginBlock(): ResponseBeginBlock { + return { events: [] }; +} + +export const ResponseBeginBlock = { + encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.events) { + Event.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseBeginBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseBeginBlock { + return { events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] }; + }, + + toJSON(message: ResponseBeginBlock): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponseBeginBlock { + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: 0, + gasUsed: 0, + events: [], + codespace: "", + sender: "", + priority: 0, + mempoolError: "", + }; +} + +export const ResponseCheckTx = { + encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.gasWanted !== 0) { + writer.uint32(40).int64(message.gasWanted); + } + if (message.gasUsed !== 0) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.priority !== 0) { + writer.uint32(80).int64(message.priority); + } + if (message.mempoolError !== "") { + writer.uint32(90).string(message.mempoolError); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCheckTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = longToNumber(reader.int64() as Long); + break; + case 6: + message.gasUsed = longToNumber(reader.int64() as Long); + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.priority = longToNumber(reader.int64() as Long); + break; + case 11: + message.mempoolError = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseCheckTx { + return { + code: isSet(object.code) ? Number(object.code) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0, + gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + codespace: isSet(object.codespace) ? String(object.codespace) : "", + sender: isSet(object.sender) ? String(object.sender) : "", + priority: isSet(object.priority) ? Number(object.priority) : 0, + mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "", + }; + }, + + toJSON(message: ResponseCheckTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed)); + if (message.events) { + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + message.sender !== undefined && (obj.sender = message.sender); + message.priority !== undefined && (obj.priority = Math.round(message.priority)); + message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); + return obj; + }, + + fromPartial, I>>(object: I): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + message.sender = object.sender ?? ""; + message.priority = object.priority ?? 0; + message.mempoolError = object.mempoolError ?? ""; + return message; + }, +}; + +function createBaseResponseDeliverTx(): ResponseDeliverTx { + return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: 0, gasUsed: 0, events: [], codespace: "" }; +} + +export const ResponseDeliverTx = { + encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.gasWanted !== 0) { + writer.uint32(40).int64(message.gasWanted); + } + if (message.gasUsed !== 0) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseDeliverTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = longToNumber(reader.int64() as Long); + break; + case 6: + message.gasUsed = longToNumber(reader.int64() as Long); + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseDeliverTx { + return { + code: isSet(object.code) ? Number(object.code) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0, + gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + codespace: isSet(object.codespace) ? String(object.codespace) : "", + }; + }, + + toJSON(message: ResponseDeliverTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed)); + if (message.events) { + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial, I>>(object: I): ResponseDeliverTx { + const message = createBaseResponseDeliverTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + return message; + }, +}; + +function createBaseResponseEndBlock(): ResponseEndBlock { + return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] }; +} + +export const ResponseEndBlock = { + encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseEndBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseEndBlock { + return { + validatorUpdates: Array.isArray(object?.validatorUpdates) + ? object.validatorUpdates.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + consensusParamUpdates: isSet(object.consensusParamUpdates) + ? ConsensusParams.fromJSON(object.consensusParamUpdates) + : undefined, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + }; + }, + + toJSON(message: ResponseEndBlock): unknown { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validatorUpdates = message.validatorUpdates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validatorUpdates = []; + } + message.consensusParamUpdates !== undefined && (obj.consensusParamUpdates = message.consensusParamUpdates + ? ConsensusParams.toJSON(message.consensusParamUpdates) + : undefined); + if (message.events) { + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponseEndBlock { + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.consensusParamUpdates = + (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) + ? ConsensusParams.fromPartial(object.consensusParamUpdates) + : undefined; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseResponseCommit(): ResponseCommit { + return { data: new Uint8Array(), retainHeight: 0 }; +} + +export const ResponseCommit = { + encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.retainHeight !== 0) { + writer.uint32(24).int64(message.retainHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseCommit { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + retainHeight: isSet(object.retainHeight) ? Number(object.retainHeight) : 0, + }; + }, + + toJSON(message: ResponseCommit): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.retainHeight !== undefined && (obj.retainHeight = Math.round(message.retainHeight)); + return obj; + }, + + fromPartial, I>>(object: I): ResponseCommit { + const message = createBaseResponseCommit(); + message.data = object.data ?? new Uint8Array(); + message.retainHeight = object.retainHeight ?? 0; + return message; + }, +}; + +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { snapshots: [] }; +} + +export const ResponseListSnapshots = { + encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseListSnapshots(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseListSnapshots { + return { + snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [], + }; + }, + + toJSON(message: ResponseListSnapshots): unknown { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map((e) => e ? Snapshot.toJSON(e) : undefined); + } else { + obj.snapshots = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { result: 0 }; +} + +export const ResponseOfferSnapshot = { + encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseOfferSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseOfferSnapshot { + return { result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 }; + }, + + toJSON(message: ResponseOfferSnapshot): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); + return obj; + }, + + fromPartial, I>>(object: I): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + message.result = object.result ?? 0; + return message; + }, +}; + +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { chunk: new Uint8Array() }; +} + +export const ResponseLoadSnapshotChunk = { + encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.chunk.length !== 0) { + writer.uint32(10).bytes(message.chunk); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseLoadSnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseLoadSnapshotChunk { + return { chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() }; + }, + + toJSON(message: ResponseLoadSnapshotChunk): unknown { + const obj: any = {}; + message.chunk !== undefined + && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + message.chunk = object.chunk ?? new Uint8Array(); + return message; + }, +}; + +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { result: 0, refetchChunks: [], rejectSenders: [] }; +} + +export const ResponseApplySnapshotChunk = { + encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseApplySnapshotChunk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseApplySnapshotChunk { + return { + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], + rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ResponseApplySnapshotChunk): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); + if (message.refetchChunks) { + obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e)); + } else { + obj.refetchChunks = []; + } + if (message.rejectSenders) { + obj.rejectSenders = message.rejectSenders.map((e) => e); + } else { + obj.rejectSenders = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + message.result = object.result ?? 0; + message.refetchChunks = object.refetchChunks?.map((e) => e) || []; + message.rejectSenders = object.rejectSenders?.map((e) => e) || []; + return message; + }, +}; + +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { + return { txs: [] }; +} + +export const ResponsePrepareProposal = { + encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponsePrepareProposal { + return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; + }, + + toJSON(message: ResponsePrepareProposal): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map((e) => e) || []; + return message; + }, +}; + +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { status: 0 }; +} + +export const ResponseProcessProposal = { + encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseProcessProposal { + return { status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : 0 }; + }, + + toJSON(message: ResponseProcessProposal): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = responseProcessProposal_ProposalStatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; + return message; + }, +}; + +function createBaseCommitInfo(): CommitInfo { + return { round: 0, votes: [] }; +} + +export const CommitInfo = { + encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitInfo { + return { + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [], + }; + }, + + toJSON(message: CommitInfo): unknown { + const obj: any = {}; + message.round !== undefined && (obj.round = Math.round(message.round)); + if (message.votes) { + obj.votes = message.votes.map((e) => e ? VoteInfo.toJSON(e) : undefined); + } else { + obj.votes = []; + } + return obj; + }, + + fromPartial, I>>(object: I): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { + return { round: 0, votes: [] }; +} + +export const ExtendedCommitInfo = { + encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtendedCommitInfo { + return { + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromJSON(e)) : [], + }; + }, + + toJSON(message: ExtendedCommitInfo): unknown { + const obj: any = {}; + message.round !== undefined && (obj.round = Math.round(message.round)); + if (message.votes) { + obj.votes = message.votes.map((e) => e ? ExtendedVoteInfo.toJSON(e) : undefined); + } else { + obj.votes = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map((e) => ExtendedVoteInfo.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEvent(): Event { + return { type: "", attributes: [] }; +} + +export const Event = { + encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Event { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Event { + return { + type: isSet(object.type) ? String(object.type) : "", + attributes: Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => EventAttribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Event): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map((e) => e ? EventAttribute.toJSON(e) : undefined); + } else { + obj.attributes = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Event { + const message = createBaseEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEventAttribute(): EventAttribute { + return { key: "", value: "", index: false }; +} + +export const EventAttribute = { + encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.index === true) { + writer.uint32(24).bool(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventAttribute { + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + index: isSet(object.index) ? Boolean(object.index) : false, + }; + }, + + toJSON(message: EventAttribute): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial, I>>(object: I): EventAttribute { + const message = createBaseEventAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + message.index = object.index ?? false; + return message; + }, +}; + +function createBaseTxResult(): TxResult { + return { height: 0, index: 0, tx: new Uint8Array(), result: undefined }; +} + +export const TxResult = { + encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== 0) { + writer.uint32(8).int64(message.height); + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index); + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx); + } + if (message.result !== undefined) { + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = longToNumber(reader.int64() as Long); + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxResult { + return { + height: isSet(object.height) ? Number(object.height) : 0, + index: isSet(object.index) ? Number(object.index) : 0, + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined, + }; + }, + + toJSON(message: TxResult): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = Math.round(message.height)); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.result !== undefined + && (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): TxResult { + const message = createBaseTxResult(); + message.height = object.height ?? 0; + message.index = object.index ?? 0; + message.tx = object.tx ?? new Uint8Array(); + message.result = (object.result !== undefined && object.result !== null) + ? ResponseDeliverTx.fromPartial(object.result) + : undefined; + return message; + }, +}; + +function createBaseValidator(): Validator { + return { address: new Uint8Array(), power: 0 }; +} + +export const Validator = { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.power !== 0) { + writer.uint32(24).int64(message.power); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Validator { + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + power: isSet(object.power) ? Number(object.power) : 0, + }; + }, + + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined + && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.power !== undefined && (obj.power = Math.round(message.power)); + return obj; + }, + + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power ?? 0; + return message; + }, +}; + +function createBaseValidatorUpdate(): ValidatorUpdate { + return { pubKey: undefined, power: 0 }; +} + +export const ValidatorUpdate = { + encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.power !== 0) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorUpdate { + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + power: isSet(object.power) ? Number(object.power) : 0, + }; + }, + + toJSON(message: ValidatorUpdate): unknown { + const obj: any = {}; + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.power !== undefined && (obj.power = Math.round(message.power)); + return obj; + }, + + fromPartial, I>>(object: I): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.power = object.power ?? 0; + return message; + }, +}; + +function createBaseVoteInfo(): VoteInfo { + return { validator: undefined, signedLastBlock: false }; +} + +export const VoteInfo = { + encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VoteInfo { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, + }; + }, + + toJSON(message: VoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + return obj; + }, + + fromPartial, I>>(object: I): VoteInfo { + const message = createBaseVoteInfo(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + return message; + }, +}; + +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { validator: undefined, signedLastBlock: false, voteExtension: new Uint8Array() }; +} + +export const ExtendedVoteInfo = { + encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtendedVoteInfo { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, + voteExtension: isSet(object.voteExtension) ? bytesFromBase64(object.voteExtension) : new Uint8Array(), + }; + }, + + toJSON(message: ExtendedVoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + message.voteExtension !== undefined + && (obj.voteExtension = base64FromBytes( + message.voteExtension !== undefined ? message.voteExtension : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMisbehavior(): Misbehavior { + return { type: 0, validator: undefined, height: 0, time: undefined, totalVotingPower: 0 }; +} + +export const Misbehavior = { + encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.totalVotingPower !== 0) { + writer.uint32(40).int64(message.totalVotingPower); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehavior(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Misbehavior { + return { + type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : 0, + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + }; + }, + + toJSON(message: Misbehavior): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type)); + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); + return obj; + }, + + fromPartial, I>>(object: I): Misbehavior { + const message = createBaseMisbehavior(); + message.type = object.type ?? 0; + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; + return message; + }, +}; + +function createBaseSnapshot(): Snapshot { + return { height: 0, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() }; +} + +export const Snapshot = { + encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== 0) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.metadata.length !== 0) { + writer.uint32(42).bytes(message.metadata); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = longToNumber(reader.uint64() as Long); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Snapshot { + return { + height: isSet(object.height) ? Number(object.height) : 0, + format: isSet(object.format) ? Number(object.format) : 0, + chunks: isSet(object.chunks) ? Number(object.chunks) : 0, + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(), + }; + }, + + toJSON(message: Snapshot): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = Math.round(message.height)); + message.format !== undefined && (obj.format = Math.round(message.format)); + message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.metadata !== undefined + && (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Snapshot { + const message = createBaseSnapshot(); + message.height = object.height ?? 0; + message.format = object.format ?? 0; + message.chunks = object.chunks ?? 0; + message.hash = object.hash ?? new Uint8Array(); + message.metadata = object.metadata ?? new Uint8Array(); + return message; + }, +}; + +export interface ABCIApplication { + Echo(request: RequestEcho): Promise; + Flush(request: RequestFlush): Promise; + Info(request: RequestInfo): Promise; + DeliverTx(request: RequestDeliverTx): Promise; + CheckTx(request: RequestCheckTx): Promise; + Query(request: RequestQuery): Promise; + Commit(request: RequestCommit): Promise; + InitChain(request: RequestInitChain): Promise; + BeginBlock(request: RequestBeginBlock): Promise; + EndBlock(request: RequestEndBlock): Promise; + ListSnapshots(request: RequestListSnapshots): Promise; + OfferSnapshot(request: RequestOfferSnapshot): Promise; + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; + PrepareProposal(request: RequestPrepareProposal): Promise; + ProcessProposal(request: RequestProcessProposal): Promise; +} + +export class ABCIApplicationClientImpl implements ABCIApplication { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Echo = this.Echo.bind(this); + this.Flush = this.Flush.bind(this); + this.Info = this.Info.bind(this); + this.DeliverTx = this.DeliverTx.bind(this); + this.CheckTx = this.CheckTx.bind(this); + this.Query = this.Query.bind(this); + this.Commit = this.Commit.bind(this); + this.InitChain = this.InitChain.bind(this); + this.BeginBlock = this.BeginBlock.bind(this); + this.EndBlock = this.EndBlock.bind(this); + this.ListSnapshots = this.ListSnapshots.bind(this); + this.OfferSnapshot = this.OfferSnapshot.bind(this); + this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this); + this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this); + this.PrepareProposal = this.PrepareProposal.bind(this); + this.ProcessProposal = this.ProcessProposal.bind(this); + } + Echo(request: RequestEcho): Promise { + const data = RequestEcho.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); + return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))); + } + + Flush(request: RequestFlush): Promise { + const data = RequestFlush.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); + return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))); + } + + Info(request: RequestInfo): Promise { + const data = RequestInfo.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); + return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))); + } + + DeliverTx(request: RequestDeliverTx): Promise { + const data = RequestDeliverTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); + return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))); + } + + CheckTx(request: RequestCheckTx): Promise { + const data = RequestCheckTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); + return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))); + } + + Query(request: RequestQuery): Promise { + const data = RequestQuery.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); + return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))); + } + + Commit(request: RequestCommit): Promise { + const data = RequestCommit.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); + return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))); + } + + InitChain(request: RequestInitChain): Promise { + const data = RequestInitChain.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); + return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))); + } + + BeginBlock(request: RequestBeginBlock): Promise { + const data = RequestBeginBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); + return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))); + } + + EndBlock(request: RequestEndBlock): Promise { + const data = RequestEndBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); + return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))); + } + + ListSnapshots(request: RequestListSnapshots): Promise { + const data = RequestListSnapshots.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); + return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))); + } + + OfferSnapshot(request: RequestOfferSnapshot): Promise { + const data = RequestOfferSnapshot.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); + return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))); + } + + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { + const data = RequestLoadSnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); + return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data))); + } + + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { + const data = RequestApplySnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); + return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data))); + } + + PrepareProposal(request: RequestPrepareProposal): Promise { + const data = RequestPrepareProposal.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "PrepareProposal", data); + return promise.then((data) => ResponsePrepareProposal.decode(new _m0.Reader(data))); + } + + ProcessProposal(request: RequestProcessProposal): Promise { + const data = RequestProcessProposal.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ProcessProposal", data); + return promise.then((data) => ResponseProcessProposal.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts index d913745384..b690245f0b 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts @@ -1,19 +1,21 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; } -const basePublicKey: object = {}; +function createBasePublicKey(): PublicKey { + return { ed25519: undefined, secp256k1: undefined }; +} export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { + encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); } @@ -23,10 +25,10 @@ export const PublicKey = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; + const message = createBasePublicKey(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -45,87 +47,84 @@ export const PublicKey = { }, fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; + return { + ed25519: isSet(object.ed25519) ? bytesFromBase64(object.ed25519) : undefined, + secp256k1: isSet(object.secp256k1) ? bytesFromBase64(object.secp256k1) : undefined, + }; }, toJSON(message: PublicKey): unknown { const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); + message.ed25519 !== undefined + && (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined + && (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); return obj; }, - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } + fromPartial, I>>(object: I): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/proof.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/proof.ts index a74e0d5153..9ef5ed12aa 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/proof.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/crypto/proof.ts @@ -1,14 +1,14 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; export interface Proof { total: number; index: number; - leaf_hash: Uint8Array; + leafHash: Uint8Array; aunts: Uint8Array[]; } @@ -41,18 +41,20 @@ export interface ProofOps { ops: ProofOp[]; } -const baseProof: object = { total: 0, index: 0 }; +function createBaseProof(): Proof { + return { total: 0, index: 0, leafHash: new Uint8Array(), aunts: [] }; +} export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { + encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).int64(message.total); } if (message.index !== 0) { writer.uint32(16).int64(message.index); } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); } for (const v of message.aunts) { writer.uint32(34).bytes(v!); @@ -60,11 +62,10 @@ export const Proof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; + const message = createBaseProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -75,7 +76,7 @@ export const Proof = { message.index = longToNumber(reader.int64() as Long); break; case 3: - message.leaf_hash = reader.bytes(); + message.leafHash = reader.bytes(); break; case 4: message.aunts.push(reader.bytes()); @@ -89,78 +90,44 @@ export const Proof = { }, fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + index: isSet(object.index) ? Number(object.index) : 0, + leafHash: isSet(object.leafHash) ? bytesFromBase64(object.leafHash) : new Uint8Array(), + aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: Proof): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.leafHash !== undefined + && (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.aunts = []; } return obj; }, - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } + fromPartial, I>>(object: I): Proof { + const message = createBaseProof(); + message.total = object.total ?? 0; + message.index = object.index ?? 0; + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map((e) => e) || []; return message; }, }; -const baseValueOp: object = {}; +function createBaseValueOp(): ValueOp { + return { key: new Uint8Array(), proof: undefined }; +} export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { + encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -170,10 +137,10 @@ export const ValueOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; + const message = createBaseValueOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -192,49 +159,34 @@ export const ValueOp = { }, fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: ValueOp): unknown { const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseDominoOp: object = { key: "", input: "", output: "" }; +function createBaseDominoOp(): DominoOp { + return { key: "", input: "", output: "" }; +} export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { + encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -247,10 +199,10 @@ export const DominoOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; + const message = createBaseDominoOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -272,23 +224,11 @@ export const DominoOp = { }, fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; + return { + key: isSet(object.key) ? String(object.key) : "", + input: isSet(object.input) ? String(object.input) : "", + output: isSet(object.output) ? String(object.output) : "", + }; }, toJSON(message: DominoOp): unknown { @@ -299,31 +239,21 @@ export const DominoOp = { return obj; }, - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } + fromPartial, I>>(object: I): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; return message; }, }; -const baseProofOp: object = { type: "" }; +function createBaseProofOp(): ProofOp { + return { type: "", key: new Uint8Array(), data: new Uint8Array() }; +} export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { + encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -336,10 +266,10 @@ export const ProofOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; + const message = createBaseProofOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -361,71 +291,48 @@ export const ProofOp = { }, fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + type: isSet(object.type) ? String(object.type) : "", + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: ProofOp): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>(object: I): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseProofOps: object = {}; +function createBaseProofOps(): ProofOps { + return { ops: [] }; +} export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { + encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; + const message = createBaseProofOps(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -441,82 +348,81 @@ export const ProofOps = { }, fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; + return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; }, toJSON(message: ProofOps): unknown { const obj: any = {}; if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); + obj.ops = message.ops.map((e) => e ? ProofOp.toJSON(e) : undefined); } else { obj.ops = []; } return obj; }, - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -524,7 +430,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/params.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/params.ts new file mode 100644 index 0000000000..10f3a925b3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/params.ts @@ -0,0 +1,499 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../google/protobuf/duration"; + +export const protobufPackage = "tendermint.types"; + +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block: BlockParams | undefined; + evidence: EvidenceParams | undefined; + validator: ValidatorParams | undefined; + version: VersionParams | undefined; +} + +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: number; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: number; +} + +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: number; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration: + | Duration + | undefined; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: number; +} + +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} + +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + app: number; +} + +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: number; + blockMaxGas: number; +} + +function createBaseConsensusParams(): ConsensusParams { + return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; +} + +export const ConsensusParams = { + encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusParams { + return { + block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, + evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, + validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, + version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined, + }; + }, + + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined + && (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusParams { + const message = createBaseConsensusParams(); + message.block = (object.block !== undefined && object.block !== null) + ? BlockParams.fromPartial(object.block) + : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceParams.fromPartial(object.evidence) + : undefined; + message.validator = (object.validator !== undefined && object.validator !== null) + ? ValidatorParams.fromPartial(object.validator) + : undefined; + message.version = (object.version !== undefined && object.version !== null) + ? VersionParams.fromPartial(object.version) + : undefined; + return message; + }, +}; + +function createBaseBlockParams(): BlockParams { + return { maxBytes: 0, maxGas: 0 }; +} + +export const BlockParams = { + encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxBytes !== 0) { + writer.uint32(8).int64(message.maxBytes); + } + if (message.maxGas !== 0) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxGas = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockParams { + return { + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + maxGas: isSet(object.maxGas) ? Number(object.maxGas) : 0, + }; + }, + + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); + message.maxGas !== undefined && (obj.maxGas = Math.round(message.maxGas)); + return obj; + }, + + fromPartial, I>>(object: I): BlockParams { + const message = createBaseBlockParams(); + message.maxBytes = object.maxBytes ?? 0; + message.maxGas = object.maxGas ?? 0; + return message; + }, +}; + +function createBaseEvidenceParams(): EvidenceParams { + return { maxAgeNumBlocks: 0, maxAgeDuration: undefined, maxBytes: 0 }; +} + +export const EvidenceParams = { + encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxAgeNumBlocks !== 0) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (message.maxBytes !== 0) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEvidenceParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EvidenceParams { + return { + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? Number(object.maxAgeNumBlocks) : 0, + maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + }; + }, + + toJSON(message: EvidenceParams): unknown { + const obj: any = {}; + message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = Math.round(message.maxAgeNumBlocks)); + message.maxAgeDuration !== undefined + && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); + return obj; + }, + + fromPartial, I>>(object: I): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks ?? 0; + message.maxAgeDuration = (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) + ? Duration.fromPartial(object.maxAgeDuration) + : undefined; + message.maxBytes = object.maxBytes ?? 0; + return message; + }, +}; + +function createBaseValidatorParams(): ValidatorParams { + return { pubKeyTypes: [] }; +} + +export const ValidatorParams = { + encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorParams { + return { pubKeyTypes: Array.isArray(object?.pubKeyTypes) ? object.pubKeyTypes.map((e: any) => String(e)) : [] }; + }, + + toJSON(message: ValidatorParams): unknown { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); + } else { + obj.pubKeyTypes = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || []; + return message; + }, +}; + +function createBaseVersionParams(): VersionParams { + return { app: 0 }; +} + +export const VersionParams = { + encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.app !== 0) { + writer.uint32(8).uint64(message.app); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.app = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VersionParams { + return { app: isSet(object.app) ? Number(object.app) : 0 }; + }, + + toJSON(message: VersionParams): unknown { + const obj: any = {}; + message.app !== undefined && (obj.app = Math.round(message.app)); + return obj; + }, + + fromPartial, I>>(object: I): VersionParams { + const message = createBaseVersionParams(); + message.app = object.app ?? 0; + return message; + }, +}; + +function createBaseHashedParams(): HashedParams { + return { blockMaxBytes: 0, blockMaxGas: 0 }; +} + +export const HashedParams = { + encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockMaxBytes !== 0) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (message.blockMaxGas !== 0) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHashedParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.blockMaxGas = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HashedParams { + return { + blockMaxBytes: isSet(object.blockMaxBytes) ? Number(object.blockMaxBytes) : 0, + blockMaxGas: isSet(object.blockMaxGas) ? Number(object.blockMaxGas) : 0, + }; + }, + + toJSON(message: HashedParams): unknown { + const obj: any = {}; + message.blockMaxBytes !== undefined && (obj.blockMaxBytes = Math.round(message.blockMaxBytes)); + message.blockMaxGas !== undefined && (obj.blockMaxGas = Math.round(message.blockMaxGas)); + return obj; + }, + + fromPartial, I>>(object: I): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes ?? 0; + message.blockMaxGas = object.blockMaxGas ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/types.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/types.ts index 729e016de7..19f6a749c7 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/types.ts @@ -1,11 +1,11 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; +import { Proof } from "../crypto/proof"; +import { Consensus } from "../version/types"; +import { ValidatorSet } from "./validator"; export const protobufPackage = "tendermint.types"; @@ -49,8 +49,9 @@ export function blockIDFlagToJSON(object: BlockIDFlag): string { return "BLOCK_ID_FLAG_COMMIT"; case BlockIDFlag.BLOCK_ID_FLAG_NIL: return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -96,8 +97,9 @@ export function signedMsgTypeToJSON(object: SignedMsgType): string { return "SIGNED_MSG_TYPE_PRECOMMIT"; case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -116,36 +118,40 @@ export interface Part { /** BlockID */ export interface BlockID { hash: Uint8Array; - part_set_header: PartSetHeader | undefined; + partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; - chain_id: string; + chainId: string; height: number; - time: Date | undefined; + time: + | Date + | undefined; /** prev block info */ - last_block_id: BlockID | undefined; + lastBlockId: + | BlockID + | undefined; /** hashes of block data */ - last_commit_hash: Uint8Array; + lastCommitHash: Uint8Array; /** transactions */ - data_hash: Uint8Array; + dataHash: Uint8Array; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validatorsHash: Uint8Array; /** validators for the next block */ - next_validators_hash: Uint8Array; + nextValidatorsHash: Uint8Array; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensusHash: Uint8Array; /** state after txs from the previous block */ - app_hash: Uint8Array; + appHash: Uint8Array; /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; + lastResultsHash: Uint8Array; /** consensus info */ - evidence_hash: Uint8Array; + evidenceHash: Uint8Array; /** original proposer of the block */ - proposer_address: Uint8Array; + proposerAddress: Uint8Array; } /** Data contains the set of transactions included in the block */ @@ -167,10 +173,10 @@ export interface Vote { height: number; round: number; /** zero if vote is nil. */ - block_id: BlockID | undefined; + blockId: BlockID | undefined; timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; + validatorAddress: Uint8Array; + validatorIndex: number; signature: Uint8Array; } @@ -178,14 +184,14 @@ export interface Vote { export interface Commit { height: number; round: number; - block_id: BlockID | undefined; + blockId: BlockID | undefined; signatures: CommitSig[]; } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; timestamp: Date | undefined; signature: Uint8Array; } @@ -194,8 +200,8 @@ export interface Proposal { type: SignedMsgType; height: number; round: number; - pol_round: number; - block_id: BlockID | undefined; + polRound: number; + blockId: BlockID | undefined; timestamp: Date | undefined; signature: Uint8Array; } @@ -206,28 +212,30 @@ export interface SignedHeader { } export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; + signedHeader: SignedHeader | undefined; + validatorSet: ValidatorSet | undefined; } export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; + blockId: BlockID | undefined; + blockSize: number; header: Header | undefined; - num_txs: number; + numTxs: number; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { - root_hash: Uint8Array; + rootHash: Uint8Array; data: Uint8Array; proof: Proof | undefined; } -const basePartSetHeader: object = { total: 0 }; +function createBasePartSetHeader(): PartSetHeader { + return { total: 0, hash: new Uint8Array() }; +} export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { + encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).uint32(message.total); } @@ -237,10 +245,10 @@ export const PartSetHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; + const message = createBasePartSetHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -259,48 +267,34 @@ export const PartSetHeader = { }, fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + }; }, toJSON(message: PartSetHeader): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } + fromPartial, I>>(object: I): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); return message; }, }; -const basePart: object = { index: 0 }; +function createBasePart(): Part { + return { index: 0, bytes: new Uint8Array(), proof: undefined }; +} export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { + encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -313,10 +307,10 @@ export const Part = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Part { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; + const message = createBasePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -338,76 +332,50 @@ export const Part = { }, fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + index: isSet(object.index) ? Number(object.index) : 0, + bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: Part): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.bytes !== undefined + && (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseBlockID: object = {}; +function createBaseBlockID(): BlockID { + return { hash: new Uint8Array(), partSetHeader: undefined }; +} export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { + encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; + const message = createBaseBlockID(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -415,10 +383,7 @@ export const BlockID = { message.hash = reader.bytes(); break; case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -429,111 +394,101 @@ export const BlockID = { }, fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + partSetHeader: isSet(object.partSetHeader) ? PartSetHeader.fromJSON(object.partSetHeader) : undefined, + }; }, toJSON(message: BlockID): unknown { const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined + && (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); return obj; }, - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } + fromPartial, I>>(object: I): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = (object.partSetHeader !== undefined && object.partSetHeader !== null) + ? PartSetHeader.fromPartial(object.partSetHeader) + : undefined; return message; }, }; -const baseHeader: object = { chain_id: "", height: 0 }; +function createBaseHeader(): Header { + return { + version: undefined, + chainId: "", + height: 0, + time: undefined, + lastBlockId: undefined, + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); } if (message.height !== 0) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; + const message = createBaseHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -541,45 +496,43 @@ export const Header = { message.version = Consensus.decode(reader, reader.uint32()); break; case 2: - message.chain_id = reader.string(); + message.chainId = reader.string(); break; case 3: message.height = longToNumber(reader.int64() as Long); break; case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); + message.lastBlockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.last_commit_hash = reader.bytes(); + message.lastCommitHash = reader.bytes(); break; case 7: - message.data_hash = reader.bytes(); + message.dataHash = reader.bytes(); break; case 8: - message.validators_hash = reader.bytes(); + message.validatorsHash = reader.bytes(); break; case 9: - message.next_validators_hash = reader.bytes(); + message.nextValidatorsHash = reader.bytes(); break; case 10: - message.consensus_hash = reader.bytes(); + message.consensusHash = reader.bytes(); break; case 11: - message.app_hash = reader.bytes(); + message.appHash = reader.bytes(); break; case 12: - message.last_results_hash = reader.bytes(); + message.lastResultsHash = reader.bytes(); break; case 13: - message.evidence_hash = reader.bytes(); + message.evidenceHash = reader.bytes(); break; case 14: - message.proposer_address = reader.bytes(); + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -590,253 +543,109 @@ export const Header = { }, fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; + return { + version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, + lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(), + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(), + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(), + evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; }, toJSON(message: Header): unknown { const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() + message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.lastBlockId !== undefined + && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined + && (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() + message.dataHash !== undefined + && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined + && (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() + message.consensusHash !== undefined + && (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined + && (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() + message.evidenceHash !== undefined + && (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), )); return obj; }, - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } + fromPartial, I>>(object: I): Header { + const message = createBaseHeader(); + message.version = (object.version !== undefined && object.version !== null) + ? Consensus.fromPartial(object.version) + : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.lastBlockId = (object.lastBlockId !== undefined && object.lastBlockId !== null) + ? BlockID.fromPartial(object.lastBlockId) + : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, }; -const baseData: object = {}; +function createBaseData(): Data { + return { txs: [] }; +} export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { + encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; + const message = createBaseData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -852,44 +661,41 @@ export const Data = { }, fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; + return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; }, toJSON(message: Data): unknown { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.txs = []; } return obj; }, - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } + fromPartial, I>>(object: I): Data { + const message = createBaseData(); + message.txs = object.txs?.map((e) => e) || []; return message; }, }; -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; +function createBaseVote(): Vote { + return { + type: 0, + height: 0, + round: 0, + blockId: undefined, + timestamp: undefined, + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array(), + }; +} export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -899,20 +705,17 @@ export const Vote = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); } if (message.signature.length !== 0) { writer.uint32(66).bytes(message.signature); @@ -920,10 +723,10 @@ export const Vote = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; + const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -937,18 +740,16 @@ export const Vote = { message.round = reader.int32(); break; case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 6: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 7: - message.validator_index = reader.int32(); + message.validatorIndex = reader.int32(); break; case 8: message.signature = reader.bytes(); @@ -962,146 +763,65 @@ export const Vote = { }, fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + validatorIndex: isSet(object.validatorIndex) ? Number(object.validatorIndex) : 0, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.validatorIndex !== undefined && (obj.validatorIndex = Math.round(message.validatorIndex)); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.validatorIndex = object.validatorIndex ?? 0; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseCommit: object = { height: 0, round: 0 }; +function createBaseCommit(): Commit { + return { height: 0, round: 0, blockId: undefined, signatures: [] }; +} export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { + encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } if (message.round !== 0) { writer.uint32(16).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); } for (const v of message.signatures) { CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); @@ -1109,11 +829,10 @@ export const Commit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Commit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; + const message = createBaseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1124,7 +843,7 @@ export const Commit = { message.round = reader.int32(); break; case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 4: message.signatures.push(CommitSig.decode(reader, reader.uint32())); @@ -1138,91 +857,53 @@ export const Commit = { }, fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) : [], + }; }, toJSON(message: Commit): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); + obj.signatures = message.signatures.map((e) => e ? CommitSig.toJSON(e) : undefined); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Commit { + const message = createBaseCommit(); + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.signatures = object.signatures?.map((e) => CommitSig.fromPartial(e)) || []; return message; }, }; -const baseCommitSig: object = { block_id_flag: 0 }; +function createBaseCommitSig(): CommitSig { + return { blockIdFlag: 0, validatorAddress: new Uint8Array(), timestamp: undefined, signature: new Uint8Array() }; +} export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); + encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(34).bytes(message.signature); @@ -1230,23 +911,21 @@ export const CommitSig = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; + const message = createBaseCommitSig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id_flag = reader.int32() as any; + message.blockIdFlag = reader.int32() as any; break; case 2: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 4: message.signature = reader.bytes(); @@ -1260,84 +939,51 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: CommitSig): unknown { const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; +function createBaseProposal(): Proposal { + return { + type: 0, + height: 0, + round: 0, + polRound: 0, + blockId: undefined, + timestamp: undefined, + signature: new Uint8Array(), + }; +} export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -1347,17 +993,14 @@ export const Proposal = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(58).bytes(message.signature); @@ -1365,10 +1008,10 @@ export const Proposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; + const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1382,15 +1025,13 @@ export const Proposal = { message.round = reader.int32(); break; case 4: - message.pol_round = reader.int32(); + message.polRound = reader.int32(); break; case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.signature = reader.bytes(); @@ -1404,111 +1045,51 @@ export const Proposal = { }, fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + polRound: isSet(object.polRound) ? Number(object.polRound) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseSignedHeader: object = {}; +function createBaseSignedHeader(): SignedHeader { + return { header: undefined, commit: undefined }; +} export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { + encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -1518,10 +1099,10 @@ export const SignedHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; + const message = createBaseSignedHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1540,76 +1121,58 @@ export const SignedHeader = { }, fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + commit: isSet(object.commit) ? Commit.fromJSON(object.commit) : undefined, + }; }, toJSON(message: SignedHeader): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); return obj; }, - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } + fromPartial, I>>(object: I): SignedHeader { + const message = createBaseSignedHeader(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? Commit.fromPartial(object.commit) + : undefined; return message; }, }; -const baseLightBlock: object = {}; +function createBaseLightBlock(): LightBlock { + return { signedHeader: undefined, validatorSet: undefined }; +} export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); + encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; + const message = createBaseLightBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); break; case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1620,86 +1183,72 @@ export const LightBlock = { }, fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; + return { + signedHeader: isSet(object.signedHeader) ? SignedHeader.fromJSON(object.signedHeader) : undefined, + validatorSet: isSet(object.validatorSet) ? ValidatorSet.fromJSON(object.validatorSet) : undefined, + }; }, toJSON(message: LightBlock): unknown { const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); + message.signedHeader !== undefined + && (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined + && (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); return obj; }, - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } + fromPartial, I>>(object: I): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = (object.signedHeader !== undefined && object.signedHeader !== null) + ? SignedHeader.fromPartial(object.signedHeader) + : undefined; + message.validatorSet = (object.validatorSet !== undefined && object.validatorSet !== null) + ? ValidatorSet.fromPartial(object.validatorSet) + : undefined; return message; }, }; -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; +function createBaseBlockMeta(): BlockMeta { + return { blockId: undefined, blockSize: 0, header: undefined, numTxs: 0 }; +} export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); + encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); + if (message.blockSize !== 0) { + writer.uint32(16).int64(message.blockSize); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(26).fork()).ldelim(); } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); + if (message.numTxs !== 0) { + writer.uint32(32).int64(message.numTxs); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; + const message = createBaseBlockMeta(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.block_size = longToNumber(reader.int64() as Long); + message.blockSize = longToNumber(reader.int64() as Long); break; case 3: message.header = Header.decode(reader, reader.uint32()); break; case 4: - message.num_txs = longToNumber(reader.int64() as Long); + message.numTxs = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -1710,75 +1259,45 @@ export const BlockMeta = { }, fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + blockSize: isSet(object.blockSize) ? Number(object.blockSize) : 0, + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + numTxs: isSet(object.numTxs) ? Number(object.numTxs) : 0, + }; }, toJSON(message: BlockMeta): unknown { const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.blockSize !== undefined && (obj.blockSize = Math.round(message.blockSize)); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = Math.round(message.numTxs)); return obj; }, - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } + fromPartial, I>>(object: I): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.blockSize = object.blockSize ?? 0; + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.numTxs = object.numTxs ?? 0; return message; }, }; -const baseTxProof: object = {}; +function createBaseTxProof(): TxProof { + return { rootHash: new Uint8Array(), data: new Uint8Array(), proof: undefined }; +} export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); + encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -1789,15 +1308,15 @@ export const TxProof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; + const message = createBaseTxProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.root_hash = reader.bytes(); + message.rootHash = reader.bytes(); break; case 2: message.data = reader.bytes(); @@ -1814,101 +1333,87 @@ export const TxProof = { }, fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + rootHash: isSet(object.rootHash) ? bytesFromBase64(object.rootHash) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: TxProof): unknown { const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.rootHash !== undefined + && (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -1938,7 +1443,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/validator.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/validator.ts index d1375eb3f0..f7c906ca4c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/validator.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/types/validator.ts @@ -1,50 +1,51 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PublicKey } from "../crypto/keys"; export const protobufPackage = "tendermint.types"; export interface ValidatorSet { validators: Validator[]; proposer: Validator | undefined; - total_voting_power: number; + totalVotingPower: number; } export interface Validator { address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; + pubKey: PublicKey | undefined; + votingPower: number; + proposerPriority: number; } export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; + pubKey: PublicKey | undefined; + votingPower: number; } -const baseValidatorSet: object = { total_voting_power: 0 }; +function createBaseValidatorSet(): ValidatorSet { + return { validators: [], proposer: undefined, totalVotingPower: 0 }; +} export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { + encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.proposer !== undefined) { Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(24).int64(message.totalVotingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; + const message = createBaseValidatorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -55,7 +56,7 @@ export const ValidatorSet = { message.proposer = Validator.decode(reader, reader.uint32()); break; case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -66,95 +67,62 @@ export const ValidatorSet = { }, fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + }; }, toJSON(message: ValidatorSet): unknown { const obj: any = {}; if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); + message.proposer !== undefined + && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); return obj; }, - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } + fromPartial, I>>(object: I): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.proposer = (object.proposer !== undefined && object.proposer !== null) + ? Validator.fromPartial(object.proposer) + : undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; return message; }, }; -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; +function createBaseValidator(): Validator { + return { address: new Uint8Array(), pubKey: undefined, votingPower: 0, proposerPriority: 0 }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(24).int64(message.votingPower); } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); + if (message.proposerPriority !== 0) { + writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -162,13 +130,13 @@ export const Validator = { message.address = reader.bytes(); break; case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 3: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); + message.proposerPriority = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -179,102 +147,63 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0, + }; }, toJSON(message: Validator): unknown { const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); + message.address !== undefined + && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); + message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority)); return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 0; + message.proposerPriority = object.proposerPriority ?? 0; return message; }, }; -const baseSimpleValidator: object = { voting_power: 0 }; +function createBaseSimpleValidator(): SimpleValidator { + return { pubKey: undefined, votingPower: 0 }; +} export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); + encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(16).int64(message.votingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; + const message = createBaseSimpleValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -285,91 +214,84 @@ export const SimpleValidator = { }, fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + }; }, toJSON(message: SimpleValidator): unknown { const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); return obj; }, - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } + fromPartial, I>>(object: I): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -377,7 +299,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/version/types.ts b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/version/types.ts index e40744b8e8..501ddcdb86 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/version/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.staking.v1beta1/types/tendermint/version/types.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.version"; @@ -25,10 +25,12 @@ export interface Consensus { app: number; } -const baseApp: object = { protocol: 0, software: "" }; +function createBaseApp(): App { + return { protocol: 0, software: "" }; +} export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { + encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.protocol !== 0) { writer.uint32(8).uint64(message.protocol); } @@ -38,10 +40,10 @@ export const App = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): App { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; + const message = createBaseApp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -60,47 +62,33 @@ export const App = { }, fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; + return { + protocol: isSet(object.protocol) ? Number(object.protocol) : 0, + software: isSet(object.software) ? String(object.software) : "", + }; }, toJSON(message: App): unknown { const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); + message.protocol !== undefined && (obj.protocol = Math.round(message.protocol)); message.software !== undefined && (obj.software = message.software); return obj; }, - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } + fromPartial, I>>(object: I): App { + const message = createBaseApp(); + message.protocol = object.protocol ?? 0; + message.software = object.software ?? ""; return message; }, }; -const baseConsensus: object = { block: 0, app: 0 }; +function createBaseConsensus(): Consensus { + return { block: 0, app: 0 }; +} export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { + encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block !== 0) { writer.uint32(8).uint64(message.block); } @@ -110,10 +98,10 @@ export const Consensus = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; + const message = createBaseConsensus(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -132,64 +120,54 @@ export const Consensus = { }, fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; + return { block: isSet(object.block) ? Number(object.block) : 0, app: isSet(object.app) ? Number(object.app) : 0 }; }, toJSON(message: Consensus): unknown { const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); + message.block !== undefined && (obj.block = Math.round(message.block)); + message.app !== undefined && (obj.app = Math.round(message.app)); return obj; }, - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } + fromPartial, I>>(object: I): Consensus { + const message = createBaseConsensus(); + message.block = object.block ?? 0; + message.app = object.app ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -197,7 +175,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/module.ts new file mode 100755 index 0000000000..a37a124812 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/module.ts @@ -0,0 +1,123 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Tx as typeTx} from "./types" +import { TxRaw as typeTxRaw} from "./types" +import { SignDoc as typeSignDoc} from "./types" +import { SignDocDirectAux as typeSignDocDirectAux} from "./types" +import { TxBody as typeTxBody} from "./types" +import { AuthInfo as typeAuthInfo} from "./types" +import { SignerInfo as typeSignerInfo} from "./types" +import { ModeInfo as typeModeInfo} from "./types" +import { ModeInfo_Single as typeModeInfo_Single} from "./types" +import { ModeInfo_Multi as typeModeInfo_Multi} from "./types" +import { Fee as typeFee} from "./types" +import { Tip as typeTip} from "./types" +import { AuxSignerData as typeAuxSignerData} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Tx: getStructure(typeTx.fromPartial({})), + TxRaw: getStructure(typeTxRaw.fromPartial({})), + SignDoc: getStructure(typeSignDoc.fromPartial({})), + SignDocDirectAux: getStructure(typeSignDocDirectAux.fromPartial({})), + TxBody: getStructure(typeTxBody.fromPartial({})), + AuthInfo: getStructure(typeAuthInfo.fromPartial({})), + SignerInfo: getStructure(typeSignerInfo.fromPartial({})), + ModeInfo: getStructure(typeModeInfo.fromPartial({})), + ModeInfo_Single: getStructure(typeModeInfo_Single.fromPartial({})), + ModeInfo_Multi: getStructure(typeModeInfo_Multi.fromPartial({})), + Fee: getStructure(typeFee.fromPartial({})), + Tip: getStructure(typeTip.fromPartial({})), + AuxSignerData: getStructure(typeAuxSignerData.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosTxV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/rest.ts index 38003a65e0..cc4ef730ca 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/rest.ts @@ -24,11 +24,10 @@ export interface AbciEvent { * EventAttribute is a single key-value pair, associated with an event. */ export interface AbciEventAttribute { - /** @format byte */ key?: string; - - /** @format byte */ value?: string; + + /** nondeterministic */ index?: boolean; } @@ -39,6 +38,8 @@ export interface Abciv1Beta1Result { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. * @format byte */ data?: string; @@ -51,6 +52,13 @@ export interface Abciv1Beta1Result { * or handler execution. */ events?: AbciEvent[]; + + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: ProtobufAny[]; } export interface CryptoPublicKey { @@ -158,7 +166,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -167,11 +174,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -194,14 +199,6 @@ export interface TenderminttypesData { txs?: string[]; } -export interface TenderminttypesEvidence { - /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ - duplicate_vote_evidence?: TypesDuplicateVoteEvidence; - - /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ - light_client_attack_evidence?: TypesLightClientAttackEvidence; -} - export interface TenderminttypesValidator { /** @format byte */ address?: string; @@ -215,7 +212,7 @@ export interface TenderminttypesValidator { } export interface TypesBlock { - /** Header defines the structure of a Tendermint block header. */ + /** Header defines the structure of a block header. */ header?: TypesHeader; data?: TenderminttypesData; evidence?: TypesEvidenceList; @@ -292,15 +289,24 @@ export interface TypesDuplicateVoteEvidence { timestamp?: string; } +export interface TypesEvidence { + /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ + duplicate_vote_evidence?: TypesDuplicateVoteEvidence; + + /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ + light_client_attack_evidence?: TypesLightClientAttackEvidence; +} + export interface TypesEvidenceList { - evidence?: TenderminttypesEvidence[]; + evidence?: TypesEvidence[]; } /** - * Header defines the structure of a Tendermint block header. + * Header defines the structure of a block header. */ export interface TypesHeader { /** + * basic block info * Consensus captures the consensus rules for processing a block in the blockchain, * including all blockchain data structures and the rules of the application's * state transition machine. @@ -313,42 +319,65 @@ export interface TypesHeader { /** @format date-time */ time?: string; + + /** prev block info */ last_block_id?: TypesBlockID; /** + * hashes of block data * commit from validators from the last block * @format byte */ last_commit_hash?: string; - /** @format byte */ + /** + * transactions + * @format byte + */ data_hash?: string; /** + * hashes from the app output from the prev block * validators for the current block * @format byte */ validators_hash?: string; - /** @format byte */ + /** + * validators for the next block + * @format byte + */ next_validators_hash?: string; - /** @format byte */ + /** + * consensus params for current block + * @format byte + */ consensus_hash?: string; - /** @format byte */ + /** + * state after txs from the previous block + * @format byte + */ app_hash?: string; - /** @format byte */ + /** + * root hash of all results from the txs from the previous block + * @format byte + */ last_results_hash?: string; /** + * consensus info * evidence included in the block * @format byte */ evidence_hash?: string; - /** @format byte */ + /** + * original proposer of the block + * @format byte + */ proposer_address?: string; } @@ -383,7 +412,7 @@ export interface TypesPartSetHeader { } export interface TypesSignedHeader { - /** Header defines the structure of a Tendermint block header. */ + /** Header defines the structure of a block header. */ header?: TypesHeader; /** Commit contains the evidence that a block was committed by a set of validators. */ @@ -490,14 +519,23 @@ export interface V1Beta1AuthInfo { * of the signers. This can be estimated via simulation. */ fee?: V1Beta1Fee; + + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * Since: cosmos-sdk 0.46 + */ + tip?: V1Beta1Tip; } /** * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for -the tx to be committed in a block. + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, +BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -525,8 +563,8 @@ export interface V1Beta1BroadcastTxRequest { * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. * * - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - * - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. + * - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + * BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. * - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for * a CheckTx execution response only. * - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns @@ -575,9 +613,14 @@ gas to be used by the transaction. The ratio yields an effective "gasprice", which must be above some miminum to be accepted into the mempool. */ export interface V1Beta1Fee { + /** amount is the amount of coins to be paid as a fee */ amount?: V1Beta1Coin[]; - /** @format uint64 */ + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + * @format uint64 + */ gas_limit?: string; /** @@ -586,6 +629,12 @@ export interface V1Beta1Fee { * setting this field does *not* change the ordering of required signers for the transaction. */ payer?: string; + + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ granter?: string; } @@ -643,51 +692,79 @@ export interface V1Beta1GetTxsEventResponse { /** tx_responses is the list of queried TxResponses. */ tx_responses?: V1Beta1TxResponse[]; - /** pagination defines a pagination for the response. */ + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ pagination?: V1Beta1PageResponse; + + /** + * total is total number of results available + * @format uint64 + */ + total?: string; } /** * ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface V1Beta1ModeInfo { + /** single represents a single signer */ single?: V1Beta1ModeInfoSingle; + + /** multi represents a nested multisig signer */ multi?: V1Beta1ModeInfoMulti; } export interface V1Beta1ModeInfoMulti { /** + * bitarray specifies which keys within the multisig are signing * CompactBitArray is an implementation of a space efficient bit array. * This is used to ensure that the encoded data takes up a minimal amount of * space after proto encoding. * This is not thread safe, and is not intended for concurrent usage. */ bitarray?: V1Beta1CompactBitArray; + + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ mode_infos?: V1Beta1ModeInfo[]; } export interface V1Beta1ModeInfoSingle { /** + * mode is the signing mode of the single signer * SignMode represents a signing mode with its own security guarantees. * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. * - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected + * rejected. * - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx + * verified with raw bytes from Tx. * - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT + * from SIGN_MODE_DIRECT. It is currently not supported. + * - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. It also allows + * for adding Tips in transactions. + * Since: cosmos-sdk 0.46 * - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future + * Amino JSON and will be removed in the future. * - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - * * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, * but is not implemented on the SDK by default. To enable EIP-191, you need * to pass a custom `TxConfig` that has an implementation of * `SignModeHandler` for EIP-191. The SDK may decide to fully support * EIP-191 in the future. - * * Since: cosmos-sdk 0.45.2 */ mode?: V1Beta1SignMode; @@ -760,25 +837,47 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } /** * SignMode represents a signing mode with its own security guarantees. +This enum should be considered a registry of all known sign modes +in the Cosmos ecosystem. Apps are not expected to support all known +sign modes. Apps that would like to support custom sign modes are +encouraged to open a small PR against this file to add a new case +to this SignMode enum describing their sign mode so that different +apps have a consistent version of this enum. + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be -rejected +rejected. - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is -verified with raw bytes from Tx +verified with raw bytes from Tx. - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable textual representation on top of the binary representation -from SIGN_MODE_DIRECT +from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses +SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not +require signers signing over other signers' `signer_info`. It also allows +for adding Tips in transactions. + +Since: cosmos-sdk 0.46 - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses -Amino JSON and will be removed in the future +Amino JSON and will be removed in the future. - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 @@ -794,6 +893,7 @@ export enum V1Beta1SignMode { SIGN_MODE_UNSPECIFIED = "SIGN_MODE_UNSPECIFIED", SIGN_MODE_DIRECT = "SIGN_MODE_DIRECT", SIGN_MODE_TEXTUAL = "SIGN_MODE_TEXTUAL", + SIGN_MODE_DIRECT_AUX = "SIGN_MODE_DIRECT_AUX", SIGN_MODE_LEGACY_AMINO_JSON = "SIGN_MODE_LEGACY_AMINO_JSON", SIGNMODEEIP191 = "SIGN_MODE_EIP_191", } @@ -810,7 +910,11 @@ export interface V1Beta1SignerInfo { */ public_key?: ProtobufAny; - /** ModeInfo describes the signing mode of a single or nested multisig signer. */ + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + * ModeInfo describes the signing mode of a single or nested multisig signer. + */ mode_info?: V1Beta1ModeInfo; /** @@ -863,14 +967,32 @@ export interface V1Beta1StringEvent { attributes?: V1Beta1Attribute[]; } +/** +* Tip is the tip used for meta-transactions. + +Since: cosmos-sdk 0.46 +*/ +export interface V1Beta1Tip { + /** amount is the amount of the tip */ + amount?: V1Beta1Coin[]; + + /** tipper is the address of the account paying for the tip */ + tipper?: string; +} + /** * Tx is the standard type used for broadcasting transactions. */ export interface V1Beta1Tx { - /** TxBody is the body of a transaction that all signers sign over. */ + /** + * body is the processable content of the transaction + * TxBody is the body of a transaction that all signers sign over. + */ body?: V1Beta1TxBody; /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee * AuthInfo describes the fee and signer modes that are used to sign a * transaction. */ @@ -906,22 +1028,135 @@ export interface V1Beta1TxBody { */ memo?: string; - /** @format uint64 */ + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + * @format uint64 + */ timeout_height?: string; + + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ extension_options?: ProtobufAny[]; + + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ non_critical_extension_options?: ProtobufAny[]; } +/** +* TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxDecodeAminoRequest { + /** @format byte */ + amino_binary?: string; +} + +/** +* TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxDecodeAminoResponse { + amino_json?: string; +} + +/** +* TxDecodeRequest is the request type for the Service.TxDecode +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxDecodeRequest { + /** + * tx_bytes is the raw transaction. + * @format byte + */ + tx_bytes?: string; +} + +/** +* TxDecodeResponse is the response type for the +Service.TxDecode method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxDecodeResponse { + /** tx is the decoded transaction. */ + tx?: V1Beta1Tx; +} + +/** +* TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxEncodeAminoRequest { + amino_json?: string; +} + +/** +* TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxEncodeAminoResponse { + /** @format byte */ + amino_binary?: string; +} + +/** +* TxEncodeRequest is the request type for the Service.TxEncode +RPC method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxEncodeRequest { + /** tx is the transaction to encode. */ + tx?: V1Beta1Tx; +} + +/** +* TxEncodeResponse is the response type for the +Service.TxEncode method. + +Since: cosmos-sdk 0.47 +*/ +export interface V1Beta1TxEncodeResponse { + /** + * tx_bytes is the encoded transaction bytes. + * @format byte + */ + tx_bytes?: string; +} + /** * TxResponse defines a structure containing relevant tx data and metadata. The tags are stringified and the log is JSON decoded. */ export interface V1Beta1TxResponse { - /** @format int64 */ + /** + * The block height + * @format int64 + */ height?: string; /** The transaction hash. */ txhash?: string; + + /** Namespace for the Code */ codespace?: string; /** @@ -970,7 +1205,7 @@ export interface V1Beta1TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -991,10 +1226,11 @@ export interface VersionConsensus { app?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -1004,30 +1240,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -1035,149 +1262,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -1187,6 +1351,78 @@ export class HttpClient { * @version version not set */ export class Api extends HttpClient { + /** + * @description Since: cosmos-sdk 0.47 + * + * @tags Service + * @name ServiceTxDecode + * @summary TxDecode decodes the transaction. + * @request POST:/cosmos/tx/v1beta1/decode + */ + serviceTxDecode = (body: V1Beta1TxDecodeRequest, params: RequestParams = {}) => + this.request({ + path: `/cosmos/tx/v1beta1/decode`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.47 + * + * @tags Service + * @name ServiceTxDecodeAmino + * @summary TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * @request POST:/cosmos/tx/v1beta1/decode/amino + */ + serviceTxDecodeAmino = (body: V1Beta1TxDecodeAminoRequest, params: RequestParams = {}) => + this.request({ + path: `/cosmos/tx/v1beta1/decode/amino`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.47 + * + * @tags Service + * @name ServiceTxEncode + * @summary TxEncode encodes the transaction. + * @request POST:/cosmos/tx/v1beta1/encode + */ + serviceTxEncode = (body: V1Beta1TxEncodeRequest, params: RequestParams = {}) => + this.request({ + path: `/cosmos/tx/v1beta1/encode`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }); + + /** + * @description Since: cosmos-sdk 0.47 + * + * @tags Service + * @name ServiceTxEncodeAmino + * @summary TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * @request POST:/cosmos/tx/v1beta1/encode/amino + */ + serviceTxEncodeAmino = (body: V1Beta1TxEncodeAminoRequest, params: RequestParams = {}) => + this.request({ + path: `/cosmos/tx/v1beta1/encode/amino`, + method: "POST", + body: body, + type: ContentType.Json, + format: "json", + ...params, + }); + /** * No description * @@ -1222,6 +1458,8 @@ export class Api extends HttpClient diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types.ts new file mode 100755 index 0000000000..8d95cefe1e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types.ts @@ -0,0 +1,32 @@ +//@ts-nocheck +import { Tx } from "./types/cosmos/tx/v1beta1/tx" +import { TxRaw } from "./types/cosmos/tx/v1beta1/tx" +import { SignDoc } from "./types/cosmos/tx/v1beta1/tx" +import { SignDocDirectAux } from "./types/cosmos/tx/v1beta1/tx" +import { TxBody } from "./types/cosmos/tx/v1beta1/tx" +import { AuthInfo } from "./types/cosmos/tx/v1beta1/tx" +import { SignerInfo } from "./types/cosmos/tx/v1beta1/tx" +import { ModeInfo } from "./types/cosmos/tx/v1beta1/tx" +import { ModeInfo_Single } from "./types/cosmos/tx/v1beta1/tx" +import { ModeInfo_Multi } from "./types/cosmos/tx/v1beta1/tx" +import { Fee } from "./types/cosmos/tx/v1beta1/tx" +import { Tip } from "./types/cosmos/tx/v1beta1/tx" +import { AuxSignerData } from "./types/cosmos/tx/v1beta1/tx" + + +export { + Tx, + TxRaw, + SignDoc, + SignDocDirectAux, + TxBody, + AuthInfo, + SignerInfo, + ModeInfo, + ModeInfo_Single, + ModeInfo_Multi, + Fee, + Tip, + AuxSignerData, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts index 8b26a7f1fa..def70df615 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../../google/protobuf/any"; import { Event } from "../../../../tendermint/abci/types"; @@ -26,17 +26,19 @@ export interface TxResponse { * The output of the application's logger (raw string). May be * non-deterministic. */ - raw_log: string; + rawLog: string; /** The output of the application's logger (typed). May be non-deterministic. */ logs: ABCIMessageLog[]; /** Additional information. May be non-deterministic. */ info: string; /** Amount of gas requested for transaction. */ - gas_wanted: number; + gasWanted: number; /** Amount of gas consumed by transaction. */ - gas_used: number; + gasUsed: number; /** The request transaction bytes. */ - tx: Any | undefined; + tx: + | Any + | undefined; /** * Time of the previous block. For heights > 1, it's the weighted median of * the timestamps of the valid votes in the block.LastCommit. For height == 1, @@ -46,7 +48,7 @@ export interface TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -56,7 +58,7 @@ export interface TxResponse { /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLog { - msg_index: number; + msgIndex: number; log: string; /** * Events contains a slice of Event objects that were emitted during some @@ -86,9 +88,9 @@ export interface Attribute { /** GasInfo defines tx execution gas context. */ export interface GasInfo { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted: number; + gasWanted: number; /** GasUsed is the amount of gas actually consumed. */ - gas_used: number; + gasUsed: number; } /** Result is the union of ResponseFormat and ResponseCheckTx. */ @@ -96,6 +98,10 @@ export interface Result { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. + * + * @deprecated */ data: Uint8Array; /** Log contains the log information from message or handler execution. */ @@ -105,6 +111,12 @@ export interface Result { * or handler execution. */ events: Event[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } /** @@ -112,16 +124,18 @@ export interface Result { * successfully simulated. */ export interface SimulationResponse { - gas_info: GasInfo | undefined; + gasInfo: GasInfo | undefined; result: Result | undefined; } /** * MsgData defines the data returned in a Result object during message * execution. + * + * @deprecated */ export interface MsgData { - msg_type: string; + msgType: string; data: Uint8Array; } @@ -130,40 +144,56 @@ export interface MsgData { * for each message. */ export interface TxMsgData { + /** + * data field is deprecated and not populated. + * + * @deprecated + */ data: MsgData[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { /** Count of all txs */ - total_count: number; + totalCount: number; /** Count of txs in current page */ count: number; /** Index of current page, start from 1 */ - page_number: number; + pageNumber: number; /** Count of total pages */ - page_total: number; + pageTotal: number; /** Max count txs per page */ limit: number; /** List of txs in current page */ txs: TxResponse[]; } -const baseTxResponse: object = { - height: 0, - txhash: "", - codespace: "", - code: 0, - data: "", - raw_log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - timestamp: "", -}; +function createBaseTxResponse(): TxResponse { + return { + height: 0, + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + logs: [], + info: "", + gasWanted: 0, + gasUsed: 0, + tx: undefined, + timestamp: "", + events: [], + }; +} export const TxResponse = { - encode(message: TxResponse, writer: Writer = Writer.create()): Writer { + encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } @@ -179,8 +209,8 @@ export const TxResponse = { if (message.data !== "") { writer.uint32(42).string(message.data); } - if (message.raw_log !== "") { - writer.uint32(50).string(message.raw_log); + if (message.rawLog !== "") { + writer.uint32(50).string(message.rawLog); } for (const v of message.logs) { ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); @@ -188,11 +218,11 @@ export const TxResponse = { if (message.info !== "") { writer.uint32(66).string(message.info); } - if (message.gas_wanted !== 0) { - writer.uint32(72).int64(message.gas_wanted); + if (message.gasWanted !== 0) { + writer.uint32(72).int64(message.gasWanted); } - if (message.gas_used !== 0) { - writer.uint32(80).int64(message.gas_used); + if (message.gasUsed !== 0) { + writer.uint32(80).int64(message.gasUsed); } if (message.tx !== undefined) { Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); @@ -206,12 +236,10 @@ export const TxResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; + const message = createBaseTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -231,7 +259,7 @@ export const TxResponse = { message.data = reader.string(); break; case 6: - message.raw_log = reader.string(); + message.rawLog = reader.string(); break; case 7: message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); @@ -240,10 +268,10 @@ export const TxResponse = { message.info = reader.string(); break; case 9: - message.gas_wanted = longToNumber(reader.int64() as Long); + message.gasWanted = longToNumber(reader.int64() as Long); break; case 10: - message.gas_used = longToNumber(reader.int64() as Long); + message.gasUsed = longToNumber(reader.int64() as Long); break; case 11: message.tx = Any.decode(reader, reader.uint32()); @@ -263,185 +291,76 @@ export const TxResponse = { }, fromJSON(object: any): TxResponse { - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.txhash !== undefined && object.txhash !== null) { - message.txhash = String(object.txhash); - } else { - message.txhash = ""; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = String(object.data); - } else { - message.data = ""; - } - if (object.raw_log !== undefined && object.raw_log !== null) { - message.raw_log = String(object.raw_log); - } else { - message.raw_log = ""; - } - if (object.logs !== undefined && object.logs !== null) { - for (const e of object.logs) { - message.logs.push(ABCIMessageLog.fromJSON(e)); - } - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = Any.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = String(object.timestamp); - } else { - message.timestamp = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + txhash: isSet(object.txhash) ? String(object.txhash) : "", + codespace: isSet(object.codespace) ? String(object.codespace) : "", + code: isSet(object.code) ? Number(object.code) : 0, + data: isSet(object.data) ? String(object.data) : "", + rawLog: isSet(object.rawLog) ? String(object.rawLog) : "", + logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromJSON(e)) : [], + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gasWanted) ? Number(object.gasWanted) : 0, + gasUsed: isSet(object.gasUsed) ? Number(object.gasUsed) : 0, + tx: isSet(object.tx) ? Any.fromJSON(object.tx) : undefined, + timestamp: isSet(object.timestamp) ? String(object.timestamp) : "", + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + }; }, toJSON(message: TxResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); message.txhash !== undefined && (obj.txhash = message.txhash); message.codespace !== undefined && (obj.codespace = message.codespace); - message.code !== undefined && (obj.code = message.code); + message.code !== undefined && (obj.code = Math.round(message.code)); message.data !== undefined && (obj.data = message.data); - message.raw_log !== undefined && (obj.raw_log = message.raw_log); + message.rawLog !== undefined && (obj.rawLog = message.rawLog); if (message.logs) { - obj.logs = message.logs.map((e) => - e ? ABCIMessageLog.toJSON(e) : undefined - ); + obj.logs = message.logs.map((e) => e ? ABCIMessageLog.toJSON(e) : undefined); } else { obj.logs = []; } message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); - message.tx !== undefined && - (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); + message.gasWanted !== undefined && (obj.gasWanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gasUsed = Math.round(message.gasUsed)); + message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); message.timestamp !== undefined && (obj.timestamp = message.timestamp); if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } return obj; }, - fromPartial(object: DeepPartial): TxResponse { - const message = { ...baseTxResponse } as TxResponse; - message.logs = []; - message.events = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.txhash !== undefined && object.txhash !== null) { - message.txhash = object.txhash; - } else { - message.txhash = ""; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = ""; - } - if (object.raw_log !== undefined && object.raw_log !== null) { - message.raw_log = object.raw_log; - } else { - message.raw_log = ""; - } - if (object.logs !== undefined && object.logs !== null) { - for (const e of object.logs) { - message.logs.push(ABCIMessageLog.fromPartial(e)); - } - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = Any.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } + fromPartial, I>>(object: I): TxResponse { + const message = createBaseTxResponse(); + message.height = object.height ?? 0; + message.txhash = object.txhash ?? ""; + message.codespace = object.codespace ?? ""; + message.code = object.code ?? 0; + message.data = object.data ?? ""; + message.rawLog = object.rawLog ?? ""; + message.logs = object.logs?.map((e) => ABCIMessageLog.fromPartial(e)) || []; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; + message.tx = (object.tx !== undefined && object.tx !== null) ? Any.fromPartial(object.tx) : undefined; + message.timestamp = object.timestamp ?? ""; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; return message; }, }; -const baseABCIMessageLog: object = { msg_index: 0, log: "" }; +function createBaseABCIMessageLog(): ABCIMessageLog { + return { msgIndex: 0, log: "", events: [] }; +} export const ABCIMessageLog = { - encode(message: ABCIMessageLog, writer: Writer = Writer.create()): Writer { - if (message.msg_index !== 0) { - writer.uint32(8).uint32(message.msg_index); + encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.msgIndex !== 0) { + writer.uint32(8).uint32(message.msgIndex); } if (message.log !== "") { writer.uint32(18).string(message.log); @@ -452,16 +371,15 @@ export const ABCIMessageLog = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ABCIMessageLog { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; + const message = createBaseABCIMessageLog(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.msg_index = reader.uint32(); + message.msgIndex = reader.uint32(); break; case 2: message.log = reader.string(); @@ -478,66 +396,40 @@ export const ABCIMessageLog = { }, fromJSON(object: any): ABCIMessageLog { - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; - if (object.msg_index !== undefined && object.msg_index !== null) { - message.msg_index = Number(object.msg_index); - } else { - message.msg_index = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(StringEvent.fromJSON(e)); - } - } - return message; + return { + msgIndex: isSet(object.msgIndex) ? Number(object.msgIndex) : 0, + log: isSet(object.log) ? String(object.log) : "", + events: Array.isArray(object?.events) ? object.events.map((e: any) => StringEvent.fromJSON(e)) : [], + }; }, toJSON(message: ABCIMessageLog): unknown { const obj: any = {}; - message.msg_index !== undefined && (obj.msg_index = message.msg_index); + message.msgIndex !== undefined && (obj.msgIndex = Math.round(message.msgIndex)); message.log !== undefined && (obj.log = message.log); if (message.events) { - obj.events = message.events.map((e) => - e ? StringEvent.toJSON(e) : undefined - ); + obj.events = message.events.map((e) => e ? StringEvent.toJSON(e) : undefined); } else { obj.events = []; } return obj; }, - fromPartial(object: DeepPartial): ABCIMessageLog { - const message = { ...baseABCIMessageLog } as ABCIMessageLog; - message.events = []; - if (object.msg_index !== undefined && object.msg_index !== null) { - message.msg_index = object.msg_index; - } else { - message.msg_index = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(StringEvent.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ABCIMessageLog { + const message = createBaseABCIMessageLog(); + message.msgIndex = object.msgIndex ?? 0; + message.log = object.log ?? ""; + message.events = object.events?.map((e) => StringEvent.fromPartial(e)) || []; return message; }, }; -const baseStringEvent: object = { type: "" }; +function createBaseStringEvent(): StringEvent { + return { type: "", attributes: [] }; +} export const StringEvent = { - encode(message: StringEvent, writer: Writer = Writer.create()): Writer { + encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -547,11 +439,10 @@ export const StringEvent = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): StringEvent { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; + const message = createBaseStringEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -570,55 +461,37 @@ export const StringEvent = { }, fromJSON(object: any): StringEvent { - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(Attribute.fromJSON(e)); - } - } - return message; + return { + type: isSet(object.type) ? String(object.type) : "", + attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromJSON(e)) : [], + }; }, toJSON(message: StringEvent): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); if (message.attributes) { - obj.attributes = message.attributes.map((e) => - e ? Attribute.toJSON(e) : undefined - ); + obj.attributes = message.attributes.map((e) => e ? Attribute.toJSON(e) : undefined); } else { obj.attributes = []; } return obj; }, - fromPartial(object: DeepPartial): StringEvent { - const message = { ...baseStringEvent } as StringEvent; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(Attribute.fromPartial(e)); - } - } + fromPartial, I>>(object: I): StringEvent { + const message = createBaseStringEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; return message; }, }; -const baseAttribute: object = { key: "", value: "" }; +function createBaseAttribute(): Attribute { + return { key: "", value: "" }; +} export const Attribute = { - encode(message: Attribute, writer: Writer = Writer.create()): Writer { + encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -628,10 +501,10 @@ export const Attribute = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Attribute { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAttribute } as Attribute; + const message = createBaseAttribute(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -650,18 +523,7 @@ export const Attribute = { }, fromJSON(object: any): Attribute { - const message = { ...baseAttribute } as Attribute; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; + return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; }, toJSON(message: Attribute): unknown { @@ -671,47 +533,41 @@ export const Attribute = { return obj; }, - fromPartial(object: DeepPartial): Attribute { - const message = { ...baseAttribute } as Attribute; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } + fromPartial, I>>(object: I): Attribute { + const message = createBaseAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; return message; }, }; -const baseGasInfo: object = { gas_wanted: 0, gas_used: 0 }; +function createBaseGasInfo(): GasInfo { + return { gasWanted: 0, gasUsed: 0 }; +} export const GasInfo = { - encode(message: GasInfo, writer: Writer = Writer.create()): Writer { - if (message.gas_wanted !== 0) { - writer.uint32(8).uint64(message.gas_wanted); + encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.gasWanted !== 0) { + writer.uint32(8).uint64(message.gasWanted); } - if (message.gas_used !== 0) { - writer.uint32(16).uint64(message.gas_used); + if (message.gasUsed !== 0) { + writer.uint32(16).uint64(message.gasUsed); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GasInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGasInfo } as GasInfo; + const message = createBaseGasInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gas_wanted = longToNumber(reader.uint64() as Long); + message.gasWanted = longToNumber(reader.uint64() as Long); break; case 2: - message.gas_used = longToNumber(reader.uint64() as Long); + message.gasUsed = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -722,47 +578,33 @@ export const GasInfo = { }, fromJSON(object: any): GasInfo { - const message = { ...baseGasInfo } as GasInfo; - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - return message; + return { + gasWanted: isSet(object.gasWanted) ? Number(object.gasWanted) : 0, + gasUsed: isSet(object.gasUsed) ? Number(object.gasUsed) : 0, + }; }, toJSON(message: GasInfo): unknown { const obj: any = {}; - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); + message.gasWanted !== undefined && (obj.gasWanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gasUsed = Math.round(message.gasUsed)); return obj; }, - fromPartial(object: DeepPartial): GasInfo { - const message = { ...baseGasInfo } as GasInfo; - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } + fromPartial, I>>(object: I): GasInfo { + const message = createBaseGasInfo(); + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; return message; }, }; -const baseResult: object = { log: "" }; +function createBaseResult(): Result { + return { data: new Uint8Array(), log: "", events: [], msgResponses: [] }; +} export const Result = { - encode(message: Result, writer: Writer = Writer.create()): Writer { + encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } @@ -772,14 +614,16 @@ export const Result = { for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Result { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Result { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResult } as Result; - message.events = []; + const message = createBaseResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -792,6 +636,9 @@ export const Result = { case 3: message.events.push(Event.decode(reader, reader.uint32())); break; + case 4: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -801,70 +648,50 @@ export const Result = { }, fromJSON(object: any): Result { - const message = { ...baseResult } as Result; - message.events = []; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + log: isSet(object.log) ? String(object.log) : "", + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + msgResponses: Array.isArray(object?.msgResponses) ? object.msgResponses.map((e: any) => Any.fromJSON(e)) : [], + }; }, toJSON(message: Result): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } + if (message.msgResponses) { + obj.msgResponses = message.msgResponses.map((e) => e ? Any.toJSON(e) : undefined); + } else { + obj.msgResponses = []; + } return obj; }, - fromPartial(object: DeepPartial): Result { - const message = { ...baseResult } as Result; - message.events = []; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Result { + const message = createBaseResult(); + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -const baseSimulationResponse: object = {}; +function createBaseSimulationResponse(): SimulationResponse { + return { gasInfo: undefined, result: undefined }; +} export const SimulationResponse = { - encode( - message: SimulationResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.gas_info !== undefined) { - GasInfo.encode(message.gas_info, writer.uint32(10).fork()).ldelim(); + encode(message: SimulationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } if (message.result !== undefined) { Result.encode(message.result, writer.uint32(18).fork()).ldelim(); @@ -872,15 +699,15 @@ export const SimulationResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimulationResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulationResponse } as SimulationResponse; + const message = createBaseSimulationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gas_info = GasInfo.decode(reader, reader.uint32()); + message.gasInfo = GasInfo.decode(reader, reader.uint32()); break; case 2: message.result = Result.decode(reader, reader.uint32()); @@ -894,53 +721,39 @@ export const SimulationResponse = { }, fromJSON(object: any): SimulationResponse { - const message = { ...baseSimulationResponse } as SimulationResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromJSON(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; + return { + gasInfo: isSet(object.gasInfo) ? GasInfo.fromJSON(object.gasInfo) : undefined, + result: isSet(object.result) ? Result.fromJSON(object.result) : undefined, + }; }, toJSON(message: SimulationResponse): unknown { const obj: any = {}; - message.gas_info !== undefined && - (obj.gas_info = message.gas_info - ? GasInfo.toJSON(message.gas_info) - : undefined); - message.result !== undefined && - (obj.result = message.result ? Result.toJSON(message.result) : undefined); + message.gasInfo !== undefined && (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); + message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); return obj; }, - fromPartial(object: DeepPartial): SimulationResponse { - const message = { ...baseSimulationResponse } as SimulationResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromPartial(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromPartial(object.result); - } else { - message.result = undefined; - } + fromPartial, I>>(object: I): SimulationResponse { + const message = createBaseSimulationResponse(); + message.gasInfo = (object.gasInfo !== undefined && object.gasInfo !== null) + ? GasInfo.fromPartial(object.gasInfo) + : undefined; + message.result = (object.result !== undefined && object.result !== null) + ? Result.fromPartial(object.result) + : undefined; return message; }, }; -const baseMsgData: object = { msg_type: "" }; +function createBaseMsgData(): MsgData { + return { msgType: "", data: new Uint8Array() }; +} export const MsgData = { - encode(message: MsgData, writer: Writer = Writer.create()): Writer { - if (message.msg_type !== "") { - writer.uint32(10).string(message.msg_type); + encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.msgType !== "") { + writer.uint32(10).string(message.msgType); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -948,15 +761,15 @@ export const MsgData = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgData { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgData } as MsgData; + const message = createBaseMsgData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.msg_type = reader.string(); + message.msgType = reader.string(); break; case 2: message.data = reader.bytes(); @@ -970,65 +783,56 @@ export const MsgData = { }, fromJSON(object: any): MsgData { - const message = { ...baseMsgData } as MsgData; - if (object.msg_type !== undefined && object.msg_type !== null) { - message.msg_type = String(object.msg_type); - } else { - message.msg_type = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + msgType: isSet(object.msgType) ? String(object.msgType) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: MsgData): unknown { const obj: any = {}; - message.msg_type !== undefined && (obj.msg_type = message.msg_type); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.msgType !== undefined && (obj.msgType = message.msgType); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): MsgData { - const message = { ...baseMsgData } as MsgData; - if (object.msg_type !== undefined && object.msg_type !== null) { - message.msg_type = object.msg_type; - } else { - message.msg_type = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>(object: I): MsgData { + const message = createBaseMsgData(); + message.msgType = object.msgType ?? ""; + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseTxMsgData: object = {}; +function createBaseTxMsgData(): TxMsgData { + return { data: [], msgResponses: [] }; +} export const TxMsgData = { - encode(message: TxMsgData, writer: Writer = Writer.create()): Writer { + encode(message: TxMsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxMsgData { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; + const message = createBaseTxMsgData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.data.push(MsgData.decode(reader, reader.uint32())); break; + case 2: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1038,59 +842,52 @@ export const TxMsgData = { }, fromJSON(object: any): TxMsgData { - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; - if (object.data !== undefined && object.data !== null) { - for (const e of object.data) { - message.data.push(MsgData.fromJSON(e)); - } - } - return message; + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromJSON(e)) : [], + msgResponses: Array.isArray(object?.msgResponses) ? object.msgResponses.map((e: any) => Any.fromJSON(e)) : [], + }; }, toJSON(message: TxMsgData): unknown { const obj: any = {}; if (message.data) { - obj.data = message.data.map((e) => (e ? MsgData.toJSON(e) : undefined)); + obj.data = message.data.map((e) => e ? MsgData.toJSON(e) : undefined); } else { obj.data = []; } + if (message.msgResponses) { + obj.msgResponses = message.msgResponses.map((e) => e ? Any.toJSON(e) : undefined); + } else { + obj.msgResponses = []; + } return obj; }, - fromPartial(object: DeepPartial): TxMsgData { - const message = { ...baseTxMsgData } as TxMsgData; - message.data = []; - if (object.data !== undefined && object.data !== null) { - for (const e of object.data) { - message.data.push(MsgData.fromPartial(e)); - } - } + fromPartial, I>>(object: I): TxMsgData { + const message = createBaseTxMsgData(); + message.data = object.data?.map((e) => MsgData.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -const baseSearchTxsResult: object = { - total_count: 0, - count: 0, - page_number: 0, - page_total: 0, - limit: 0, -}; +function createBaseSearchTxsResult(): SearchTxsResult { + return { totalCount: 0, count: 0, pageNumber: 0, pageTotal: 0, limit: 0, txs: [] }; +} export const SearchTxsResult = { - encode(message: SearchTxsResult, writer: Writer = Writer.create()): Writer { - if (message.total_count !== 0) { - writer.uint32(8).uint64(message.total_count); + encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.totalCount !== 0) { + writer.uint32(8).uint64(message.totalCount); } if (message.count !== 0) { writer.uint32(16).uint64(message.count); } - if (message.page_number !== 0) { - writer.uint32(24).uint64(message.page_number); + if (message.pageNumber !== 0) { + writer.uint32(24).uint64(message.pageNumber); } - if (message.page_total !== 0) { - writer.uint32(32).uint64(message.page_total); + if (message.pageTotal !== 0) { + writer.uint32(32).uint64(message.pageTotal); } if (message.limit !== 0) { writer.uint32(40).uint64(message.limit); @@ -1101,25 +898,24 @@ export const SearchTxsResult = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SearchTxsResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; + const message = createBaseSearchTxsResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.total_count = longToNumber(reader.uint64() as Long); + message.totalCount = longToNumber(reader.uint64() as Long); break; case 2: message.count = longToNumber(reader.uint64() as Long); break; case 3: - message.page_number = longToNumber(reader.uint64() as Long); + message.pageNumber = longToNumber(reader.uint64() as Long); break; case 4: - message.page_total = longToNumber(reader.uint64() as Long); + message.pageTotal = longToNumber(reader.uint64() as Long); break; case 5: message.limit = longToNumber(reader.uint64() as Long); @@ -1136,139 +932,98 @@ export const SearchTxsResult = { }, fromJSON(object: any): SearchTxsResult { - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; - if (object.total_count !== undefined && object.total_count !== null) { - message.total_count = Number(object.total_count); - } else { - message.total_count = 0; - } - if (object.count !== undefined && object.count !== null) { - message.count = Number(object.count); - } else { - message.count = 0; - } - if (object.page_number !== undefined && object.page_number !== null) { - message.page_number = Number(object.page_number); - } else { - message.page_number = 0; - } - if (object.page_total !== undefined && object.page_total !== null) { - message.page_total = Number(object.page_total); - } else { - message.page_total = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(TxResponse.fromJSON(e)); - } - } - return message; + return { + totalCount: isSet(object.totalCount) ? Number(object.totalCount) : 0, + count: isSet(object.count) ? Number(object.count) : 0, + pageNumber: isSet(object.pageNumber) ? Number(object.pageNumber) : 0, + pageTotal: isSet(object.pageTotal) ? Number(object.pageTotal) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromJSON(e)) : [], + }; }, toJSON(message: SearchTxsResult): unknown { const obj: any = {}; - message.total_count !== undefined && - (obj.total_count = message.total_count); - message.count !== undefined && (obj.count = message.count); - message.page_number !== undefined && - (obj.page_number = message.page_number); - message.page_total !== undefined && (obj.page_total = message.page_total); - message.limit !== undefined && (obj.limit = message.limit); + message.totalCount !== undefined && (obj.totalCount = Math.round(message.totalCount)); + message.count !== undefined && (obj.count = Math.round(message.count)); + message.pageNumber !== undefined && (obj.pageNumber = Math.round(message.pageNumber)); + message.pageTotal !== undefined && (obj.pageTotal = Math.round(message.pageTotal)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); if (message.txs) { - obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)); + obj.txs = message.txs.map((e) => e ? TxResponse.toJSON(e) : undefined); } else { obj.txs = []; } return obj; }, - fromPartial(object: DeepPartial): SearchTxsResult { - const message = { ...baseSearchTxsResult } as SearchTxsResult; - message.txs = []; - if (object.total_count !== undefined && object.total_count !== null) { - message.total_count = object.total_count; - } else { - message.total_count = 0; - } - if (object.count !== undefined && object.count !== null) { - message.count = object.count; - } else { - message.count = 0; - } - if (object.page_number !== undefined && object.page_number !== null) { - message.page_number = object.page_number; - } else { - message.page_number = 0; - } - if (object.page_total !== undefined && object.page_total !== null) { - message.page_total = object.page_total; - } else { - message.page_total = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(TxResponse.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SearchTxsResult { + const message = createBaseSearchTxsResult(); + message.totalCount = object.totalCount ?? 0; + message.count = object.count ?? 0; + message.pageNumber = object.pageNumber ?? 0; + message.pageTotal = object.pageTotal ?? 0; + message.limit = object.limit ?? 0; + message.txs = object.txs?.map((e) => TxResponse.fromPartial(e)) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1276,7 +1031,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts index 6c63be1cde..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,7 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; /** * reverse is set to true if results are to be returned in the descending order. * @@ -59,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -69,15 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -87,8 +85,8 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); } if (message.reverse === true) { writer.uint32(40).bool(message.reverse); @@ -96,10 +94,10 @@ export const PageRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -113,7 +111,7 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); break; case 5: message.reverse = reader.bool(); @@ -127,84 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -212,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -234,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -323,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/crypto/multisig/v1beta1/multisig.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/crypto/multisig/v1beta1/multisig.ts index 6cb41e6f43..699942b972 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; @@ -20,25 +20,26 @@ export interface MultiSignature { * This is not thread safe, and is not intended for concurrent usage. */ export interface CompactBitArray { - extra_bits_stored: number; + extraBitsStored: number; elems: Uint8Array; } -const baseMultiSignature: object = {}; +function createBaseMultiSignature(): MultiSignature { + return { signatures: [] }; +} export const MultiSignature = { - encode(message: MultiSignature, writer: Writer = Writer.create()): Writer { + encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.signatures) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MultiSignature { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; + const message = createBaseMultiSignature(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -54,46 +55,36 @@ export const MultiSignature = { }, fromJSON(object: any): MultiSignature { - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; + return { + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: MultiSignature): unknown { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): MultiSignature { - const message = { ...baseMultiSignature } as MultiSignature; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } + fromPartial, I>>(object: I): MultiSignature { + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map((e) => e) || []; return message; }, }; -const baseCompactBitArray: object = { extra_bits_stored: 0 }; +function createBaseCompactBitArray(): CompactBitArray { + return { extraBitsStored: 0, elems: new Uint8Array() }; +} export const CompactBitArray = { - encode(message: CompactBitArray, writer: Writer = Writer.create()): Writer { - if (message.extra_bits_stored !== 0) { - writer.uint32(8).uint32(message.extra_bits_stored); + encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.extraBitsStored !== 0) { + writer.uint32(8).uint32(message.extraBitsStored); } if (message.elems.length !== 0) { writer.uint32(18).bytes(message.elems); @@ -101,15 +92,15 @@ export const CompactBitArray = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CompactBitArray { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCompactBitArray } as CompactBitArray; + const message = createBaseCompactBitArray(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.extra_bits_stored = reader.uint32(); + message.extraBitsStored = reader.uint32(); break; case 2: message.elems = reader.bytes(); @@ -123,91 +114,83 @@ export const CompactBitArray = { }, fromJSON(object: any): CompactBitArray { - const message = { ...baseCompactBitArray } as CompactBitArray; - if ( - object.extra_bits_stored !== undefined && - object.extra_bits_stored !== null - ) { - message.extra_bits_stored = Number(object.extra_bits_stored); - } else { - message.extra_bits_stored = 0; - } - if (object.elems !== undefined && object.elems !== null) { - message.elems = bytesFromBase64(object.elems); - } - return message; + return { + extraBitsStored: isSet(object.extraBitsStored) ? Number(object.extraBitsStored) : 0, + elems: isSet(object.elems) ? bytesFromBase64(object.elems) : new Uint8Array(), + }; }, toJSON(message: CompactBitArray): unknown { const obj: any = {}; - message.extra_bits_stored !== undefined && - (obj.extra_bits_stored = message.extra_bits_stored); - message.elems !== undefined && - (obj.elems = base64FromBytes( - message.elems !== undefined ? message.elems : new Uint8Array() - )); + message.extraBitsStored !== undefined && (obj.extraBitsStored = Math.round(message.extraBitsStored)); + message.elems !== undefined + && (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): CompactBitArray { - const message = { ...baseCompactBitArray } as CompactBitArray; - if ( - object.extra_bits_stored !== undefined && - object.extra_bits_stored !== null - ) { - message.extra_bits_stored = object.extra_bits_stored; - } else { - message.extra_bits_stored = 0; - } - if (object.elems !== undefined && object.elems !== null) { - message.elems = object.elems; - } else { - message.elems = new Uint8Array(); - } + fromPartial, I>>(object: I): CompactBitArray { + const message = createBaseCompactBitArray(); + message.extraBitsStored = object.extraBitsStored ?? 0; + message.elems = object.elems ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/signing/v1beta1/signing.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/signing/v1beta1/signing.ts index 832d5074e3..7370a48439 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/signing/v1beta1/signing.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/signing/v1beta1/signing.ts @@ -1,33 +1,51 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../../google/protobuf/any"; -import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { CompactBitArray } from "../../../crypto/multisig/v1beta1/multisig"; export const protobufPackage = "cosmos.tx.signing.v1beta1"; -/** SignMode represents a signing mode with its own security guarantees. */ +/** + * SignMode represents a signing mode with its own security guarantees. + * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. + */ export enum SignMode { /** * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected + * rejected. */ SIGN_MODE_UNSPECIFIED = 0, /** * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx + * verified with raw bytes from Tx. */ SIGN_MODE_DIRECT = 1, /** * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT + * from SIGN_MODE_DIRECT. It is currently not supported. */ SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. It also allows + * for adding Tips in transactions. + * + * Since: cosmos-sdk 0.46 + */ + SIGN_MODE_DIRECT_AUX = 3, /** * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future + * Amino JSON and will be removed in the future. */ SIGN_MODE_LEGACY_AMINO_JSON = 127, /** @@ -57,6 +75,9 @@ export function signModeFromJSON(object: any): SignMode { case 2: case "SIGN_MODE_TEXTUAL": return SignMode.SIGN_MODE_TEXTUAL; + case 3: + case "SIGN_MODE_DIRECT_AUX": + return SignMode.SIGN_MODE_DIRECT_AUX; case 127: case "SIGN_MODE_LEGACY_AMINO_JSON": return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; @@ -78,12 +99,15 @@ export function signModeToJSON(object: SignMode): string { return "SIGN_MODE_DIRECT"; case SignMode.SIGN_MODE_TEXTUAL: return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_DIRECT_AUX: + return "SIGN_MODE_DIRECT_AUX"; case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: return "SIGN_MODE_LEGACY_AMINO_JSON"; case SignMode.SIGN_MODE_EIP_191: return "SIGN_MODE_EIP_191"; + case SignMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -101,8 +125,10 @@ export interface SignatureDescriptors { */ export interface SignatureDescriptor { /** public_key is the public key of the signer */ - public_key: Any | undefined; - data: SignatureDescriptor_Data | undefined; + publicKey: Any | undefined; + data: + | SignatureDescriptor_Data + | undefined; /** * sequence is the sequence of the account, which describes the * number of committed transactions signed by a given address. It is used to prevent @@ -114,7 +140,9 @@ export interface SignatureDescriptor { /** Data represents signature data */ export interface SignatureDescriptor_Data { /** single represents a single signer */ - single: SignatureDescriptor_Data_Single | undefined; + single: + | SignatureDescriptor_Data_Single + | undefined; /** multi represents a multisig signer */ multi: SignatureDescriptor_Data_Multi | undefined; } @@ -130,36 +158,34 @@ export interface SignatureDescriptor_Data_Single { /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_Multi { /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray | undefined; + bitarray: + | CompactBitArray + | undefined; /** signatures is the signatures of the multi-signature */ signatures: SignatureDescriptor_Data[]; } -const baseSignatureDescriptors: object = {}; +function createBaseSignatureDescriptors(): SignatureDescriptors { + return { signatures: [] }; +} export const SignatureDescriptors = { - encode( - message: SignatureDescriptors, - writer: Writer = Writer.create() - ): Writer { + encode(message: SignatureDescriptors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.signatures) { SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignatureDescriptors { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; + const message = createBaseSignatureDescriptors(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signatures.push( - SignatureDescriptor.decode(reader, reader.uint32()) - ); + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -170,55 +196,41 @@ export const SignatureDescriptors = { }, fromJSON(object: any): SignatureDescriptors { - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor.fromJSON(e)); - } - } - return message; + return { + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => SignatureDescriptor.fromJSON(e)) + : [], + }; }, toJSON(message: SignatureDescriptors): unknown { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? SignatureDescriptor.toJSON(e) : undefined - ); + obj.signatures = message.signatures.map((e) => e ? SignatureDescriptor.toJSON(e) : undefined); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): SignatureDescriptors { - const message = { ...baseSignatureDescriptors } as SignatureDescriptors; - message.signatures = []; - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SignatureDescriptors { + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map((e) => SignatureDescriptor.fromPartial(e)) || []; return message; }, }; -const baseSignatureDescriptor: object = { sequence: 0 }; +function createBaseSignatureDescriptor(): SignatureDescriptor { + return { publicKey: undefined, data: undefined, sequence: 0 }; +} export const SignatureDescriptor = { - encode( - message: SignatureDescriptor, - writer: Writer = Writer.create() - ): Writer { - if (message.public_key !== undefined) { - Any.encode(message.public_key, writer.uint32(10).fork()).ldelim(); + encode(message: SignatureDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.data !== undefined) { - SignatureDescriptor_Data.encode( - message.data, - writer.uint32(18).fork() - ).ldelim(); + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); } if (message.sequence !== 0) { writer.uint32(24).uint64(message.sequence); @@ -226,21 +238,18 @@ export const SignatureDescriptor = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + const message = createBaseSignatureDescriptor(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.public_key = Any.decode(reader, reader.uint32()); + message.publicKey = Any.decode(reader, reader.uint32()); break; case 2: - message.data = SignatureDescriptor_Data.decode( - reader, - reader.uint32() - ); + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); break; case 3: message.sequence = longToNumber(reader.uint64() as Long); @@ -254,105 +263,61 @@ export const SignatureDescriptor = { }, fromJSON(object: any): SignatureDescriptor { - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromJSON(object.public_key); - } else { - message.public_key = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = SignatureDescriptor_Data.fromJSON(object.data); - } else { - message.data = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; + return { + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + data: isSet(object.data) ? SignatureDescriptor_Data.fromJSON(object.data) : undefined, + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; }, toJSON(message: SignatureDescriptor): unknown { const obj: any = {}; - message.public_key !== undefined && - (obj.public_key = message.public_key - ? Any.toJSON(message.public_key) - : undefined); - message.data !== undefined && - (obj.data = message.data - ? SignatureDescriptor_Data.toJSON(message.data) - : undefined); - message.sequence !== undefined && (obj.sequence = message.sequence); + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.data !== undefined && (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); return obj; }, - fromPartial(object: DeepPartial): SignatureDescriptor { - const message = { ...baseSignatureDescriptor } as SignatureDescriptor; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromPartial(object.public_key); - } else { - message.public_key = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = SignatureDescriptor_Data.fromPartial(object.data); - } else { - message.data = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } + fromPartial, I>>(object: I): SignatureDescriptor { + const message = createBaseSignatureDescriptor(); + message.publicKey = (object.publicKey !== undefined && object.publicKey !== null) + ? Any.fromPartial(object.publicKey) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? SignatureDescriptor_Data.fromPartial(object.data) + : undefined; + message.sequence = object.sequence ?? 0; return message; }, }; -const baseSignatureDescriptor_Data: object = {}; +function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { + return { single: undefined, multi: undefined }; +} export const SignatureDescriptor_Data = { - encode( - message: SignatureDescriptor_Data, - writer: Writer = Writer.create() - ): Writer { + encode(message: SignatureDescriptor_Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.single !== undefined) { - SignatureDescriptor_Data_Single.encode( - message.single, - writer.uint32(10).fork() - ).ldelim(); + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } if (message.multi !== undefined) { - SignatureDescriptor_Data_Multi.encode( - message.multi, - writer.uint32(18).fork() - ).ldelim(); + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; + const message = createBaseSignatureDescriptor_Data(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.single = SignatureDescriptor_Data_Single.decode( - reader, - reader.uint32() - ); + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); break; case 2: - message.multi = SignatureDescriptor_Data_Multi.decode( - reader, - reader.uint32() - ); + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -363,64 +328,39 @@ export const SignatureDescriptor_Data = { }, fromJSON(object: any): SignatureDescriptor_Data { - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; - if (object.single !== undefined && object.single !== null) { - message.single = SignatureDescriptor_Data_Single.fromJSON(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = SignatureDescriptor_Data_Multi.fromJSON(object.multi); - } else { - message.multi = undefined; - } - return message; + return { + single: isSet(object.single) ? SignatureDescriptor_Data_Single.fromJSON(object.single) : undefined, + multi: isSet(object.multi) ? SignatureDescriptor_Data_Multi.fromJSON(object.multi) : undefined, + }; }, toJSON(message: SignatureDescriptor_Data): unknown { const obj: any = {}; - message.single !== undefined && - (obj.single = message.single - ? SignatureDescriptor_Data_Single.toJSON(message.single) - : undefined); - message.multi !== undefined && - (obj.multi = message.multi - ? SignatureDescriptor_Data_Multi.toJSON(message.multi) - : undefined); + message.single !== undefined + && (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined); + message.multi !== undefined + && (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): SignatureDescriptor_Data { - const message = { - ...baseSignatureDescriptor_Data, - } as SignatureDescriptor_Data; - if (object.single !== undefined && object.single !== null) { - message.single = SignatureDescriptor_Data_Single.fromPartial( - object.single - ); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = SignatureDescriptor_Data_Multi.fromPartial(object.multi); - } else { - message.multi = undefined; - } + fromPartial, I>>(object: I): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data(); + message.single = (object.single !== undefined && object.single !== null) + ? SignatureDescriptor_Data_Single.fromPartial(object.single) + : undefined; + message.multi = (object.multi !== undefined && object.multi !== null) + ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) + : undefined; return message; }, }; -const baseSignatureDescriptor_Data_Single: object = { mode: 0 }; +function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { + return { mode: 0, signature: new Uint8Array() }; +} export const SignatureDescriptor_Data_Single = { - encode( - message: SignatureDescriptor_Data_Single, - writer: Writer = Writer.create() - ): Writer { + encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } @@ -430,15 +370,10 @@ export const SignatureDescriptor_Data_Single = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data_Single { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; + const message = createBaseSignatureDescriptor_Data_Single(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -457,62 +392,38 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = signModeFromJSON(object.mode); - } else { - message.mode = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: SignatureDescriptor_Data_Single): unknown { const obj: any = {}; message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): SignatureDescriptor_Data_Single { - const message = { - ...baseSignatureDescriptor_Data_Single, - } as SignatureDescriptor_Data_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + const message = createBaseSignatureDescriptor_Data_Single(); + message.mode = object.mode ?? 0; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseSignatureDescriptor_Data_Multi: object = {}; +function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { + return { bitarray: undefined, signatures: [] }; +} export const SignatureDescriptor_Data_Multi = { - encode( - message: SignatureDescriptor_Data_Multi, - writer: Writer = Writer.create() - ): Writer { + encode(message: SignatureDescriptor_Data_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.bitarray !== undefined) { - CompactBitArray.encode( - message.bitarray, - writer.uint32(10).fork() - ).ldelim(); + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } for (const v of message.signatures) { SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -520,16 +431,10 @@ export const SignatureDescriptor_Data_Multi = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): SignatureDescriptor_Data_Multi { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; + const message = createBaseSignatureDescriptor_Data_Multi(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -537,9 +442,7 @@ export const SignatureDescriptor_Data_Multi = { message.bitarray = CompactBitArray.decode(reader, reader.uint32()); break; case 2: - message.signatures.push( - SignatureDescriptor_Data.decode(reader, reader.uint32()) - ); + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -550,104 +453,93 @@ export const SignatureDescriptor_Data_Multi = { }, fromJSON(object: any): SignatureDescriptor_Data_Multi { - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromJSON(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor_Data.fromJSON(e)); - } - } - return message; + return { + bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : undefined, + signatures: Array.isArray(object?.signatures) + ? object.signatures.map((e: any) => SignatureDescriptor_Data.fromJSON(e)) + : [], + }; }, toJSON(message: SignatureDescriptor_Data_Multi): unknown { const obj: any = {}; - message.bitarray !== undefined && - (obj.bitarray = message.bitarray - ? CompactBitArray.toJSON(message.bitarray) - : undefined); + message.bitarray !== undefined + && (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? SignatureDescriptor_Data.toJSON(e) : undefined - ); + obj.signatures = message.signatures.map((e) => e ? SignatureDescriptor_Data.toJSON(e) : undefined); } else { obj.signatures = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): SignatureDescriptor_Data_Multi { - const message = { - ...baseSignatureDescriptor_Data_Multi, - } as SignatureDescriptor_Data_Multi; - message.signatures = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromPartial(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(SignatureDescriptor_Data.fromPartial(e)); - } - } + const message = createBaseSignatureDescriptor_Data_Multi(); + message.bitarray = (object.bitarray !== undefined && object.bitarray !== null) + ? CompactBitArray.fromPartial(object.bitarray) + : undefined; + message.signatures = object.signatures?.map((e) => SignatureDescriptor_Data.fromPartial(e)) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -655,7 +547,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts index 7a5bd37b7b..3577423b25 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts @@ -1,19 +1,12 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; -import { Tx } from "../../../cosmos/tx/v1beta1/tx"; -import { - TxResponse, - GasInfo, - Result, -} from "../../../cosmos/base/abci/v1beta1/abci"; -import { BlockID } from "../../../tendermint/types/types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Block } from "../../../tendermint/types/block"; +import { BlockID } from "../../../tendermint/types/types"; +import { GasInfo, Result, TxResponse } from "../../base/abci/v1beta1/abci"; +import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; +import { Tx } from "./tx"; export const protobufPackage = "cosmos.tx.v1beta1"; @@ -54,8 +47,9 @@ export function orderByToJSON(object: OrderBy): string { return "ORDER_BY_ASC"; case OrderBy.ORDER_BY_DESC: return "ORDER_BY_DESC"; + case OrderBy.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -64,8 +58,10 @@ export enum BroadcastMode { /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ BROADCAST_MODE_UNSPECIFIED = 0, /** - * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. + * BROADCAST_MODE_BLOCK - DEPRECATED: use BROADCAST_MODE_SYNC instead, + * BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + * + * @deprecated */ BROADCAST_MODE_BLOCK = 1, /** @@ -112,8 +108,9 @@ export function broadcastModeToJSON(object: BroadcastMode): string { return "BROADCAST_MODE_SYNC"; case BroadcastMode.BROADCAST_MODE_ASYNC: return "BROADCAST_MODE_ASYNC"; + case BroadcastMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -124,9 +121,21 @@ export function broadcastModeToJSON(object: BroadcastMode): string { export interface GetTxsEventRequest { /** events is the list of transaction event type. */ events: string[]; - /** pagination defines a pagination for the request. */ + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + * + * @deprecated + */ pagination: PageRequest | undefined; - order_by: OrderBy; + orderBy: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + page: number; + /** + * 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: number; } /** @@ -137,9 +146,18 @@ export interface GetTxsEventResponse { /** txs is the list of queried transactions. */ txs: Tx[]; /** tx_responses is the list of queried TxResponses. */ - tx_responses: TxResponse[]; - /** pagination defines a pagination for the response. */ - pagination: PageResponse | undefined; + txResponses: TxResponse[]; + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + * + * @deprecated + */ + pagination: + | PageResponse + | undefined; + /** total is total number of results available */ + total: number; } /** @@ -148,7 +166,7 @@ export interface GetTxsEventResponse { */ export interface BroadcastTxRequest { /** tx_bytes is the raw transaction. */ - tx_bytes: Uint8Array; + txBytes: Uint8Array; mode: BroadcastMode; } @@ -158,7 +176,7 @@ export interface BroadcastTxRequest { */ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ - tx_response: TxResponse | undefined; + txResponse: TxResponse | undefined; } /** @@ -172,13 +190,15 @@ export interface SimulateRequest { * * @deprecated */ - tx: Tx | undefined; + tx: + | Tx + | undefined; /** * tx_bytes is the raw transaction. * * Since: cosmos-sdk 0.43 */ - tx_bytes: Uint8Array; + txBytes: Uint8Array; } /** @@ -187,7 +207,9 @@ export interface SimulateRequest { */ export interface SimulateResponse { /** gas_info is the information about gas used in the simulation. */ - gas_info: GasInfo | undefined; + gasInfo: + | GasInfo + | undefined; /** result is the result of the simulation. */ result: Result | undefined; } @@ -204,9 +226,11 @@ export interface GetTxRequest { /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponse { /** tx is the queried transaction. */ - tx: Tx | undefined; + tx: + | Tx + | undefined; /** tx_response is the queried TxResponses. */ - tx_response: TxResponse | undefined; + txResponse: TxResponse | undefined; } /** @@ -230,36 +254,126 @@ export interface GetBlockWithTxsRequest { export interface GetBlockWithTxsResponse { /** txs are the transactions in the block. */ txs: Tx[]; - block_id: BlockID | undefined; - block: Block | undefined; + blockId: BlockID | undefined; + block: + | Block + | undefined; /** pagination defines a pagination for the response. */ pagination: PageResponse | undefined; } -const baseGetTxsEventRequest: object = { events: "", order_by: 0 }; +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; +} + +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponse { + /** tx is the decoded transaction. */ + tx: Tx | undefined; +} + +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequest { + /** tx is the transaction to encode. */ + tx: Tx | undefined; +} + +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponse { + /** tx_bytes is the encoded transaction bytes. */ + txBytes: Uint8Array; +} + +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequest { + aminoJson: string; +} + +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponse { + aminoBinary: Uint8Array; +} + +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequest { + aminoBinary: Uint8Array; +} + +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponse { + aminoJson: string; +} + +function createBaseGetTxsEventRequest(): GetTxsEventRequest { + return { events: [], pagination: undefined, orderBy: 0, page: 0, limit: 0 }; +} export const GetTxsEventRequest = { - encode( - message: GetTxsEventRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetTxsEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.events) { writer.uint32(10).string(v!); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } - if (message.order_by !== 0) { - writer.uint32(24).int32(message.order_by); + if (message.orderBy !== 0) { + writer.uint32(24).int32(message.orderBy); + } + if (message.page !== 0) { + writer.uint32(32).uint64(message.page); + } + if (message.limit !== 0) { + writer.uint32(40).uint64(message.limit); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetTxsEventRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; + const message = createBaseGetTxsEventRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -270,7 +384,13 @@ export const GetTxsEventRequest = { message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 3: - message.order_by = reader.int32() as any; + message.orderBy = reader.int32() as any; + break; + case 4: + message.page = longToNumber(reader.uint64() as Long); + break; + case 5: + message.limit = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -281,24 +401,13 @@ export const GetTxsEventRequest = { }, fromJSON(object: any): GetTxsEventRequest { - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(String(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - if (object.order_by !== undefined && object.order_by !== null) { - message.order_by = orderByFromJSON(object.order_by); - } else { - message.order_by = 0; - } - return message; + return { + events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0, + page: isSet(object.page) ? Number(object.page) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -308,65 +417,52 @@ export const GetTxsEventRequest = { } else { obj.events = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - message.order_by !== undefined && - (obj.order_by = orderByToJSON(message.order_by)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); + message.page !== undefined && (obj.page = Math.round(message.page)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); return obj; }, - fromPartial(object: DeepPartial): GetTxsEventRequest { - const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(e); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - if (object.order_by !== undefined && object.order_by !== null) { - message.order_by = object.order_by; - } else { - message.order_by = 0; - } + fromPartial, I>>(object: I): GetTxsEventRequest { + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map((e) => e) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + message.orderBy = object.orderBy ?? 0; + message.page = object.page ?? 0; + message.limit = object.limit ?? 0; return message; }, }; -const baseGetTxsEventResponse: object = {}; +function createBaseGetTxsEventResponse(): GetTxsEventResponse { + return { txs: [], txResponses: [], pagination: undefined, total: 0 }; +} export const GetTxsEventResponse = { - encode( - message: GetTxsEventResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetTxsEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } - for (const v of message.tx_responses) { + for (const v of message.txResponses) { TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + if (message.total !== 0) { + writer.uint32(32).uint64(message.total); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetTxsEventResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; + const message = createBaseGetTxsEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -374,11 +470,14 @@ export const GetTxsEventResponse = { message.txs.push(Tx.decode(reader, reader.uint32())); break; case 2: - message.tx_responses.push(TxResponse.decode(reader, reader.uint32())); + message.txResponses.push(TxResponse.decode(reader, reader.uint32())); break; case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; + case 4: + message.total = longToNumber(reader.uint64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -388,80 +487,52 @@ export const GetTxsEventResponse = { }, fromJSON(object: any): GetTxsEventResponse { - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromJSON(e)); - } - } - if (object.tx_responses !== undefined && object.tx_responses !== null) { - for (const e of object.tx_responses) { - message.tx_responses.push(TxResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromJSON(e)) : [], + txResponses: Array.isArray(object?.txResponses) ? object.txResponses.map((e: any) => TxResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: GetTxsEventResponse): unknown { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)); + obj.txs = message.txs.map((e) => e ? Tx.toJSON(e) : undefined); } else { obj.txs = []; } - if (message.tx_responses) { - obj.tx_responses = message.tx_responses.map((e) => - e ? TxResponse.toJSON(e) : undefined - ); + if (message.txResponses) { + obj.txResponses = message.txResponses.map((e) => e ? TxResponse.toJSON(e) : undefined); } else { - obj.tx_responses = []; + obj.txResponses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): GetTxsEventResponse { - const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; - message.txs = []; - message.tx_responses = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromPartial(e)); - } - } - if (object.tx_responses !== undefined && object.tx_responses !== null) { - for (const e of object.tx_responses) { - message.tx_responses.push(TxResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): GetTxsEventResponse { + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; + message.txResponses = object.txResponses?.map((e) => TxResponse.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.total = object.total ?? 0; return message; }, }; -const baseBroadcastTxRequest: object = { mode: 0 }; +function createBaseBroadcastTxRequest(): BroadcastTxRequest { + return { txBytes: new Uint8Array(), mode: 0 }; +} export const BroadcastTxRequest = { - encode( - message: BroadcastTxRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_bytes.length !== 0) { - writer.uint32(10).bytes(message.tx_bytes); + encode(message: BroadcastTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); } if (message.mode !== 0) { writer.uint32(16).int32(message.mode); @@ -469,15 +540,15 @@ export const BroadcastTxRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): BroadcastTxRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; + const message = createBaseBroadcastTxRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.tx_bytes = reader.bytes(); + message.txBytes = reader.bytes(); break; case 2: message.mode = reader.int32() as any; @@ -491,67 +562,49 @@ export const BroadcastTxRequest = { }, fromJSON(object: any): BroadcastTxRequest { - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = bytesFromBase64(object.tx_bytes); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = broadcastModeFromJSON(object.mode); - } else { - message.mode = 0; - } - return message; + return { + txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0, + }; }, toJSON(message: BroadcastTxRequest): unknown { const obj: any = {}; - message.tx_bytes !== undefined && - (obj.tx_bytes = base64FromBytes( - message.tx_bytes !== undefined ? message.tx_bytes : new Uint8Array() - )); - message.mode !== undefined && - (obj.mode = broadcastModeToJSON(message.mode)); + message.txBytes !== undefined + && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + message.mode !== undefined && (obj.mode = broadcastModeToJSON(message.mode)); return obj; }, - fromPartial(object: DeepPartial): BroadcastTxRequest { - const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = object.tx_bytes; - } else { - message.tx_bytes = new Uint8Array(); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } + fromPartial, I>>(object: I): BroadcastTxRequest { + const message = createBaseBroadcastTxRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + message.mode = object.mode ?? 0; return message; }, }; -const baseBroadcastTxResponse: object = {}; +function createBaseBroadcastTxResponse(): BroadcastTxResponse { + return { txResponse: undefined }; +} export const BroadcastTxResponse = { - encode( - message: BroadcastTxResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.tx_response !== undefined) { - TxResponse.encode(message.tx_response, writer.uint32(10).fork()).ldelim(); + encode(message: BroadcastTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BroadcastTxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; + const message = createBaseBroadcastTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.tx_response = TxResponse.decode(reader, reader.uint32()); + message.txResponse = TxResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -562,52 +615,44 @@ export const BroadcastTxResponse = { }, fromJSON(object: any): BroadcastTxResponse { - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromJSON(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; + return { txResponse: isSet(object.txResponse) ? TxResponse.fromJSON(object.txResponse) : undefined }; }, toJSON(message: BroadcastTxResponse): unknown { const obj: any = {}; - message.tx_response !== undefined && - (obj.tx_response = message.tx_response - ? TxResponse.toJSON(message.tx_response) - : undefined); + message.txResponse !== undefined + && (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); return obj; }, - fromPartial(object: DeepPartial): BroadcastTxResponse { - const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromPartial(object.tx_response); - } else { - message.tx_response = undefined; - } + fromPartial, I>>(object: I): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + message.txResponse = (object.txResponse !== undefined && object.txResponse !== null) + ? TxResponse.fromPartial(object.txResponse) + : undefined; return message; }, }; -const baseSimulateRequest: object = {}; +function createBaseSimulateRequest(): SimulateRequest { + return { tx: undefined, txBytes: new Uint8Array() }; +} export const SimulateRequest = { - encode(message: SimulateRequest, writer: Writer = Writer.create()): Writer { + encode(message: SimulateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } - if (message.tx_bytes.length !== 0) { - writer.uint32(18).bytes(message.tx_bytes); + if (message.txBytes.length !== 0) { + writer.uint32(18).bytes(message.txBytes); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimulateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulateRequest } as SimulateRequest; + const message = createBaseSimulateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -615,7 +660,7 @@ export const SimulateRequest = { message.tx = Tx.decode(reader, reader.uint32()); break; case 2: - message.tx_bytes = reader.bytes(); + message.txBytes = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -626,51 +671,36 @@ export const SimulateRequest = { }, fromJSON(object: any): SimulateRequest { - const message = { ...baseSimulateRequest } as SimulateRequest; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = bytesFromBase64(object.tx_bytes); - } - return message; + return { + tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined, + txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), + }; }, toJSON(message: SimulateRequest): unknown { const obj: any = {}; - message.tx !== undefined && - (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); - message.tx_bytes !== undefined && - (obj.tx_bytes = base64FromBytes( - message.tx_bytes !== undefined ? message.tx_bytes : new Uint8Array() - )); + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + message.txBytes !== undefined + && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): SimulateRequest { - const message = { ...baseSimulateRequest } as SimulateRequest; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.tx_bytes = object.tx_bytes; - } else { - message.tx_bytes = new Uint8Array(); - } + fromPartial, I>>(object: I): SimulateRequest { + const message = createBaseSimulateRequest(); + message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; + message.txBytes = object.txBytes ?? new Uint8Array(); return message; }, }; -const baseSimulateResponse: object = {}; +function createBaseSimulateResponse(): SimulateResponse { + return { gasInfo: undefined, result: undefined }; +} export const SimulateResponse = { - encode(message: SimulateResponse, writer: Writer = Writer.create()): Writer { - if (message.gas_info !== undefined) { - GasInfo.encode(message.gas_info, writer.uint32(10).fork()).ldelim(); + encode(message: SimulateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } if (message.result !== undefined) { Result.encode(message.result, writer.uint32(18).fork()).ldelim(); @@ -678,15 +708,15 @@ export const SimulateResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimulateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimulateResponse } as SimulateResponse; + const message = createBaseSimulateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gas_info = GasInfo.decode(reader, reader.uint32()); + message.gasInfo = GasInfo.decode(reader, reader.uint32()); break; case 2: message.result = Result.decode(reader, reader.uint32()); @@ -700,61 +730,47 @@ export const SimulateResponse = { }, fromJSON(object: any): SimulateResponse { - const message = { ...baseSimulateResponse } as SimulateResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromJSON(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; + return { + gasInfo: isSet(object.gasInfo) ? GasInfo.fromJSON(object.gasInfo) : undefined, + result: isSet(object.result) ? Result.fromJSON(object.result) : undefined, + }; }, toJSON(message: SimulateResponse): unknown { const obj: any = {}; - message.gas_info !== undefined && - (obj.gas_info = message.gas_info - ? GasInfo.toJSON(message.gas_info) - : undefined); - message.result !== undefined && - (obj.result = message.result ? Result.toJSON(message.result) : undefined); + message.gasInfo !== undefined && (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); + message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); return obj; }, - fromPartial(object: DeepPartial): SimulateResponse { - const message = { ...baseSimulateResponse } as SimulateResponse; - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gas_info = GasInfo.fromPartial(object.gas_info); - } else { - message.gas_info = undefined; - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromPartial(object.result); - } else { - message.result = undefined; - } + fromPartial, I>>(object: I): SimulateResponse { + const message = createBaseSimulateResponse(); + message.gasInfo = (object.gasInfo !== undefined && object.gasInfo !== null) + ? GasInfo.fromPartial(object.gasInfo) + : undefined; + message.result = (object.result !== undefined && object.result !== null) + ? Result.fromPartial(object.result) + : undefined; return message; }, }; -const baseGetTxRequest: object = { hash: "" }; +function createBaseGetTxRequest(): GetTxRequest { + return { hash: "" }; +} export const GetTxRequest = { - encode(message: GetTxRequest, writer: Writer = Writer.create()): Writer { + encode(message: GetTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetTxRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxRequest } as GetTxRequest; + const message = createBaseGetTxRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -770,13 +786,7 @@ export const GetTxRequest = { }, fromJSON(object: any): GetTxRequest { - const message = { ...baseGetTxRequest } as GetTxRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = String(object.hash); - } else { - message.hash = ""; - } - return message; + return { hash: isSet(object.hash) ? String(object.hash) : "" }; }, toJSON(message: GetTxRequest): unknown { @@ -785,34 +795,32 @@ export const GetTxRequest = { return obj; }, - fromPartial(object: DeepPartial): GetTxRequest { - const message = { ...baseGetTxRequest } as GetTxRequest; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = ""; - } + fromPartial, I>>(object: I): GetTxRequest { + const message = createBaseGetTxRequest(); + message.hash = object.hash ?? ""; return message; }, }; -const baseGetTxResponse: object = {}; +function createBaseGetTxResponse(): GetTxResponse { + return { tx: undefined, txResponse: undefined }; +} export const GetTxResponse = { - encode(message: GetTxResponse, writer: Writer = Writer.create()): Writer { + encode(message: GetTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } - if (message.tx_response !== undefined) { - TxResponse.encode(message.tx_response, writer.uint32(18).fork()).ldelim(); + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetTxResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetTxResponse } as GetTxResponse; + const message = createBaseGetTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -820,7 +828,7 @@ export const GetTxResponse = { message.tx = Tx.decode(reader, reader.uint32()); break; case 2: - message.tx_response = TxResponse.decode(reader, reader.uint32()); + message.txResponse = TxResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -831,54 +839,36 @@ export const GetTxResponse = { }, fromJSON(object: any): GetTxResponse { - const message = { ...baseGetTxResponse } as GetTxResponse; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromJSON(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromJSON(object.tx_response); - } else { - message.tx_response = undefined; - } - return message; + return { + tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined, + txResponse: isSet(object.txResponse) ? TxResponse.fromJSON(object.txResponse) : undefined, + }; }, toJSON(message: GetTxResponse): unknown { const obj: any = {}; - message.tx !== undefined && - (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); - message.tx_response !== undefined && - (obj.tx_response = message.tx_response - ? TxResponse.toJSON(message.tx_response) - : undefined); + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + message.txResponse !== undefined + && (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); return obj; }, - fromPartial(object: DeepPartial): GetTxResponse { - const message = { ...baseGetTxResponse } as GetTxResponse; - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromPartial(object.tx); - } else { - message.tx = undefined; - } - if (object.tx_response !== undefined && object.tx_response !== null) { - message.tx_response = TxResponse.fromPartial(object.tx_response); - } else { - message.tx_response = undefined; - } + fromPartial, I>>(object: I): GetTxResponse { + const message = createBaseGetTxResponse(); + message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; + message.txResponse = (object.txResponse !== undefined && object.txResponse !== null) + ? TxResponse.fromPartial(object.txResponse) + : undefined; return message; }, }; -const baseGetBlockWithTxsRequest: object = { height: 0 }; +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { height: 0, pagination: undefined }; +} export const GetBlockWithTxsRequest = { - encode( - message: GetBlockWithTxsRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetBlockWithTxsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } @@ -888,10 +878,10 @@ export const GetBlockWithTxsRequest = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetBlockWithTxsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetBlockWithTxsRequest } as GetBlockWithTxsRequest; + const message = createBaseGetBlockWithTxsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -910,80 +900,55 @@ export const GetBlockWithTxsRequest = { }, fromJSON(object: any): GetBlockWithTxsRequest { - const message = { ...baseGetBlockWithTxsRequest } as GetBlockWithTxsRequest; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: GetBlockWithTxsRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): GetBlockWithTxsRequest { - const message = { ...baseGetBlockWithTxsRequest } as GetBlockWithTxsRequest; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseGetBlockWithTxsResponse: object = {}; +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { txs: [], blockId: undefined, block: undefined, pagination: undefined }; +} export const GetBlockWithTxsResponse = { - encode( - message: GetBlockWithTxsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: GetBlockWithTxsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(18).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); } if (message.block !== undefined) { Block.encode(message.block, writer.uint32(26).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(34).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GetBlockWithTxsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGetBlockWithTxsResponse, - } as GetBlockWithTxsResponse; - message.txs = []; + const message = createBaseGetBlockWithTxsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -991,7 +956,7 @@ export const GetBlockWithTxsResponse = { message.txs.push(Tx.decode(reader, reader.uint32())); break; case 2: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 3: message.block = Block.decode(reader, reader.uint32()); @@ -1008,82 +973,424 @@ export const GetBlockWithTxsResponse = { }, fromJSON(object: any): GetBlockWithTxsResponse { - const message = { - ...baseGetBlockWithTxsResponse, - } as GetBlockWithTxsResponse; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromJSON(e)); + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromJSON(e)) : [], + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + block: isSet(object.block) ? Block.fromJSON(object.block) : undefined, + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: GetBlockWithTxsResponse): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => e ? Tx.toJSON(e) : undefined); + } else { + obj.txs = []; + } + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.block = (object.block !== undefined && object.block !== null) ? Block.fromPartial(object.block) : undefined; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { txBytes: new Uint8Array() }; +} + +export const TxDecodeRequest = { + encode(message: TxDecodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; } } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; + return message; + }, + + fromJSON(object: any): TxDecodeRequest { + return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array() }; + }, + + toJSON(message: TxDecodeRequest): unknown { + const obj: any = {}; + message.txBytes !== undefined + && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, +}; + +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { tx: undefined }; +} + +export const TxDecodeResponse = { + encode(message: TxDecodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromJSON(object.block); - } else { - message.block = undefined; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; + return message; + }, + + fromJSON(object: any): TxDecodeResponse { + return { tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined }; + }, + + toJSON(message: TxDecodeResponse): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; + return message; + }, +}; + +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { tx: undefined }; +} + +export const TxEncodeRequest = { + encode(message: TxEncodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: GetBlockWithTxsResponse): unknown { + fromJSON(object: any): TxEncodeRequest { + return { tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined }; + }, + + toJSON(message: TxEncodeRequest): unknown { const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)); - } else { - obj.txs = []; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + message.tx = (object.tx !== undefined && object.tx !== null) ? Tx.fromPartial(object.tx) : undefined; + return message; + }, +}; + +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { txBytes: new Uint8Array() }; +} + +export const TxEncodeResponse = { + encode(message: TxEncodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block !== undefined && - (obj.block = message.block ? Block.toJSON(message.block) : undefined); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + return message; + }, + + fromJSON(object: any): TxEncodeResponse { + return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array() }; + }, + + toJSON(message: TxEncodeResponse): unknown { + const obj: any = {}; + message.txBytes !== undefined + && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): GetBlockWithTxsResponse { - const message = { - ...baseGetBlockWithTxsResponse, - } as GetBlockWithTxsResponse; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(Tx.fromPartial(e)); + fromPartial, I>>(object: I): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, +}; + +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { aminoJson: "" }; +} + +export const TxEncodeAminoRequest = { + encode(message: TxEncodeAminoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeAminoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; + return message; + }, + + fromJSON(object: any): TxEncodeAminoRequest { + return { aminoJson: isSet(object.aminoJson) ? String(object.aminoJson) : "" }; + }, + + toJSON(message: TxEncodeAminoRequest): unknown { + const obj: any = {}; + message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); + return obj; + }, + + fromPartial, I>>(object: I): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, +}; + +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { aminoBinary: new Uint8Array() }; +} + +export const TxEncodeAminoResponse = { + encode(message: TxEncodeAminoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromPartial(object.block); - } else { - message.block = undefined; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeAminoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; + return message; + }, + + fromJSON(object: any): TxEncodeAminoResponse { + return { aminoBinary: isSet(object.aminoBinary) ? bytesFromBase64(object.aminoBinary) : new Uint8Array() }; + }, + + toJSON(message: TxEncodeAminoResponse): unknown { + const obj: any = {}; + message.aminoBinary !== undefined + && (obj.aminoBinary = base64FromBytes( + message.aminoBinary !== undefined ? message.aminoBinary : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, +}; + +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { aminoBinary: new Uint8Array() }; +} + +export const TxDecodeAminoRequest = { + encode(message: TxDecodeAminoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeAminoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): TxDecodeAminoRequest { + return { aminoBinary: isSet(object.aminoBinary) ? bytesFromBase64(object.aminoBinary) : new Uint8Array() }; + }, + + toJSON(message: TxDecodeAminoRequest): unknown { + const obj: any = {}; + message.aminoBinary !== undefined + && (obj.aminoBinary = base64FromBytes( + message.aminoBinary !== undefined ? message.aminoBinary : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, +}; + +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { aminoJson: "" }; +} + +export const TxDecodeAminoResponse = { + encode(message: TxDecodeAminoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeAminoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxDecodeAminoResponse { + return { aminoJson: isSet(object.aminoJson) ? String(object.aminoJson) : "" }; + }, + + toJSON(message: TxDecodeAminoResponse): unknown { + const obj: any = {}; + message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); + return obj; + }, + + fromPartial, I>>(object: I): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, }; /** Service defines a gRPC service for interacting with transactions. */ @@ -1101,123 +1408,161 @@ export interface Service { * * Since: cosmos-sdk 0.45.2 */ - GetBlockWithTxs( - request: GetBlockWithTxsRequest - ): Promise; + GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise; + /** + * TxDecode decodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + TxDecode(request: TxDecodeRequest): Promise; + /** + * TxEncode encodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + TxEncode(request: TxEncodeRequest): Promise; + /** + * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * + * Since: cosmos-sdk 0.47 + */ + TxEncodeAmino(request: TxEncodeAminoRequest): Promise; + /** + * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * + * Since: cosmos-sdk 0.47 + */ + TxDecodeAmino(request: TxDecodeAminoRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Simulate = this.Simulate.bind(this); + this.GetTx = this.GetTx.bind(this); + this.BroadcastTx = this.BroadcastTx.bind(this); + this.GetTxsEvent = this.GetTxsEvent.bind(this); + this.GetBlockWithTxs = this.GetBlockWithTxs.bind(this); + this.TxDecode = this.TxDecode.bind(this); + this.TxEncode = this.TxEncode.bind(this); + this.TxEncodeAmino = this.TxEncodeAmino.bind(this); + this.TxDecodeAmino = this.TxDecodeAmino.bind(this); } Simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "Simulate", - data - ); - return promise.then((data) => SimulateResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); + return promise.then((data) => SimulateResponse.decode(new _m0.Reader(data))); } GetTx(request: GetTxRequest): Promise { const data = GetTxRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "GetTx", - data - ); - return promise.then((data) => GetTxResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); + return promise.then((data) => GetTxResponse.decode(new _m0.Reader(data))); } BroadcastTx(request: BroadcastTxRequest): Promise { const data = BroadcastTxRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "BroadcastTx", - data - ); - return promise.then((data) => BroadcastTxResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); + return promise.then((data) => BroadcastTxResponse.decode(new _m0.Reader(data))); } GetTxsEvent(request: GetTxsEventRequest): Promise { const data = GetTxsEventRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "GetTxsEvent", - data - ); - return promise.then((data) => GetTxsEventResponse.decode(new Reader(data))); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); + return promise.then((data) => GetTxsEventResponse.decode(new _m0.Reader(data))); } - GetBlockWithTxs( - request: GetBlockWithTxsRequest - ): Promise { + GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise { const data = GetBlockWithTxsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.tx.v1beta1.Service", - "GetBlockWithTxs", - data - ); - return promise.then((data) => - GetBlockWithTxsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); + return promise.then((data) => GetBlockWithTxsResponse.decode(new _m0.Reader(data))); + } + + TxDecode(request: TxDecodeRequest): Promise { + const data = TxDecodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecode", data); + return promise.then((data) => TxDecodeResponse.decode(new _m0.Reader(data))); + } + + TxEncode(request: TxEncodeRequest): Promise { + const data = TxEncodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncode", data); + return promise.then((data) => TxEncodeResponse.decode(new _m0.Reader(data))); + } + + TxEncodeAmino(request: TxEncodeAminoRequest): Promise { + const data = TxEncodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncodeAmino", data); + return promise.then((data) => TxEncodeAminoResponse.decode(new _m0.Reader(data))); + } + + TxDecodeAmino(request: TxDecodeAminoRequest): Promise { + const data = TxDecodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecodeAmino", data); + return promise.then((data) => TxDecodeAminoResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1225,7 +1570,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/tx.ts index a64da76575..bf6b96130e 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/tx.ts @@ -1,27 +1,27 @@ //@ts-nocheck /* eslint-disable */ -import { - SignMode, - signModeFromJSON, - signModeToJSON, -} from "../../../cosmos/tx/signing/v1beta1/signing"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; -import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Coin } from "../../base/v1beta1/coin"; +import { CompactBitArray } from "../../crypto/multisig/v1beta1/multisig"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; export const protobufPackage = "cosmos.tx.v1beta1"; /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { /** body is the processable content of the transaction */ - body: TxBody | undefined; + body: + | TxBody + | undefined; /** * auth_info is the authorization related content of the transaction, * specifically signers, signer modes and fee */ - auth_info: AuthInfo | undefined; + authInfo: + | AuthInfo + | undefined; /** * signatures is a list of signatures that matches the length and order of * AuthInfo's signer_infos to allow connecting signature meta information like @@ -42,12 +42,12 @@ export interface TxRaw { * body_bytes is a protobuf serialization of a TxBody that matches the * representation in SignDoc. */ - body_bytes: Uint8Array; + bodyBytes: Uint8Array; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in SignDoc. */ - auth_info_bytes: Uint8Array; + authInfoBytes: Uint8Array; /** * signatures is a list of signatures that matches the length and order of * AuthInfo's signer_infos to allow connecting signature meta information like @@ -62,20 +62,57 @@ export interface SignDoc { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - body_bytes: Uint8Array; + bodyBytes: Uint8Array; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in TxRaw. */ - auth_info_bytes: Uint8Array; + authInfoBytes: Uint8Array; /** * chain_id is the unique identifier of the chain this transaction targets. * It prevents signed transactions from being used on another chain by an * attacker */ - chain_id: string; + chainId: string; /** account_number is the account number of the account in state */ - account_number: number; + accountNumber: number; +} + +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAux { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** public_key is the public key of the signing account. */ + publicKey: + | Any + | undefined; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chainId: string; + /** account_number is the account number of the account in state. */ + accountNumber: number; + /** sequence is the sequence number of the signing account. */ + sequence: number; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * It should be left empty if the signer is not the tipper for this + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + */ + tip: Tip | undefined; } /** TxBody is the body of a transaction that all signers sign over. */ @@ -100,19 +137,19 @@ export interface TxBody { * timeout is the block height after which this transaction will not * be processed by the chain */ - timeout_height: number; + timeoutHeight: number; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present * and can't be handled, the transaction will be rejected */ - extension_options: Any[]; + extensionOptions: Any[]; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present * and can't be handled, they will be ignored */ - non_critical_extension_options: Any[]; + nonCriticalExtensionOptions: Any[]; } /** @@ -126,14 +163,25 @@ export interface AuthInfo { * messages. The first element is the primary signer and the one which pays * the fee. */ - signer_infos: SignerInfo[]; + signerInfos: SignerInfo[]; /** * Fee is the fee and gas limit for the transaction. The first signer is the * primary signer and the one which pays the fee. The fee can be calculated * based on the cost of evaluating the body and doing signature verification * of the signers. This can be estimated via simulation. */ - fee: Fee | undefined; + fee: + | Fee + | undefined; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + tip: Tip | undefined; } /** @@ -146,12 +194,16 @@ export interface SignerInfo { * that already exist in state. If unset, the verifier can use the required \ * signer address for this position and lookup the public key. */ - public_key: Any | undefined; + publicKey: + | Any + | undefined; /** * mode_info describes the signing mode of the signer and is a nested * structure to support nested multisig pubkey's */ - mode_info: ModeInfo | undefined; + modeInfo: + | ModeInfo + | undefined; /** * sequence is the sequence of the account, which describes the * number of committed transactions signed by a given address. It is used to @@ -163,7 +215,9 @@ export interface SignerInfo { /** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfo { /** single represents a single signer */ - single: ModeInfo_Single | undefined; + single: + | ModeInfo_Single + | undefined; /** multi represents a nested multisig signer */ multi: ModeInfo_Multi | undefined; } @@ -181,12 +235,14 @@ export interface ModeInfo_Single { /** Multi is the mode info for a multisig public key */ export interface ModeInfo_Multi { /** bitarray specifies which keys within the multisig are signing */ - bitarray: CompactBitArray | undefined; + bitarray: + | CompactBitArray + | undefined; /** * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys */ - mode_infos: ModeInfo[]; + modeInfos: ModeInfo[]; } /** @@ -201,7 +257,7 @@ export interface Fee { * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gas_limit: number; + gasLimit: number; /** * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. * the payer must be a tx signer (and thus have signed this field in AuthInfo). @@ -216,15 +272,58 @@ export interface Fee { granter: string; } -const baseTx: object = {}; +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface Tip { + /** amount is the amount of the tip */ + amount: Coin[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} + +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + signDoc: + | SignDocDirectAux + | undefined; + /** mode is the signing mode of the single signer. */ + mode: SignMode; + /** sig is the signature of the sign doc. */ + sig: Uint8Array; +} + +function createBaseTx(): Tx { + return { body: undefined, authInfo: undefined, signatures: [] }; +} export const Tx = { - encode(message: Tx, writer: Writer = Writer.create()): Writer { + encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.body !== undefined) { TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); } - if (message.auth_info !== undefined) { - AuthInfo.encode(message.auth_info, writer.uint32(18).fork()).ldelim(); + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); } for (const v of message.signatures) { writer.uint32(26).bytes(v!); @@ -232,11 +331,10 @@ export const Tx = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Tx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Tx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTx } as Tx; - message.signatures = []; + const message = createBaseTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -244,7 +342,7 @@ export const Tx = { message.body = TxBody.decode(reader, reader.uint32()); break; case 2: - message.auth_info = AuthInfo.decode(reader, reader.uint32()); + message.authInfo = AuthInfo.decode(reader, reader.uint32()); break; case 3: message.signatures.push(reader.bytes()); @@ -258,75 +356,47 @@ export const Tx = { }, fromJSON(object: any): Tx { - const message = { ...baseTx } as Tx; - message.signatures = []; - if (object.body !== undefined && object.body !== null) { - message.body = TxBody.fromJSON(object.body); - } else { - message.body = undefined; - } - if (object.auth_info !== undefined && object.auth_info !== null) { - message.auth_info = AuthInfo.fromJSON(object.auth_info); - } else { - message.auth_info = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; + return { + body: isSet(object.body) ? TxBody.fromJSON(object.body) : undefined, + authInfo: isSet(object.authInfo) ? AuthInfo.fromJSON(object.authInfo) : undefined, + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: Tx): unknown { const obj: any = {}; - message.body !== undefined && - (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); - message.auth_info !== undefined && - (obj.auth_info = message.auth_info - ? AuthInfo.toJSON(message.auth_info) - : undefined); + message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); + message.authInfo !== undefined && (obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): Tx { - const message = { ...baseTx } as Tx; - message.signatures = []; - if (object.body !== undefined && object.body !== null) { - message.body = TxBody.fromPartial(object.body); - } else { - message.body = undefined; - } - if (object.auth_info !== undefined && object.auth_info !== null) { - message.auth_info = AuthInfo.fromPartial(object.auth_info); - } else { - message.auth_info = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } + fromPartial, I>>(object: I): Tx { + const message = createBaseTx(); + message.body = (object.body !== undefined && object.body !== null) ? TxBody.fromPartial(object.body) : undefined; + message.authInfo = (object.authInfo !== undefined && object.authInfo !== null) + ? AuthInfo.fromPartial(object.authInfo) + : undefined; + message.signatures = object.signatures?.map((e) => e) || []; return message; }, }; -const baseTxRaw: object = {}; +function createBaseTxRaw(): TxRaw { + return { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), signatures: [] }; +} export const TxRaw = { - encode(message: TxRaw, writer: Writer = Writer.create()): Writer { - if (message.body_bytes.length !== 0) { - writer.uint32(10).bytes(message.body_bytes); + encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); } - if (message.auth_info_bytes.length !== 0) { - writer.uint32(18).bytes(message.auth_info_bytes); + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); } for (const v of message.signatures) { writer.uint32(26).bytes(v!); @@ -334,19 +404,18 @@ export const TxRaw = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxRaw { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; + const message = createBaseTxRaw(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.body_bytes = reader.bytes(); + message.bodyBytes = reader.bytes(); break; case 2: - message.auth_info_bytes = reader.bytes(); + message.authInfoBytes = reader.bytes(); break; case 3: message.signatures.push(reader.bytes()); @@ -360,109 +429,77 @@ export const TxRaw = { }, fromJSON(object: any): TxRaw { - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = bytesFromBase64(object.auth_info_bytes); - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(bytesFromBase64(e)); - } - } - return message; + return { + bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), + authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(), + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: TxRaw): unknown { const obj: any = {}; - message.body_bytes !== undefined && - (obj.body_bytes = base64FromBytes( - message.body_bytes !== undefined ? message.body_bytes : new Uint8Array() - )); - message.auth_info_bytes !== undefined && - (obj.auth_info_bytes = base64FromBytes( - message.auth_info_bytes !== undefined - ? message.auth_info_bytes - : new Uint8Array() + message.bodyBytes !== undefined + && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.authInfoBytes !== undefined + && (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), )); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): TxRaw { - const message = { ...baseTxRaw } as TxRaw; - message.signatures = []; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = object.body_bytes; - } else { - message.body_bytes = new Uint8Array(); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = object.auth_info_bytes; - } else { - message.auth_info_bytes = new Uint8Array(); - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(e); - } - } + fromPartial, I>>(object: I): TxRaw { + const message = createBaseTxRaw(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.signatures = object.signatures?.map((e) => e) || []; return message; }, }; -const baseSignDoc: object = { chain_id: "", account_number: 0 }; +function createBaseSignDoc(): SignDoc { + return { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), chainId: "", accountNumber: 0 }; +} export const SignDoc = { - encode(message: SignDoc, writer: Writer = Writer.create()): Writer { - if (message.body_bytes.length !== 0) { - writer.uint32(10).bytes(message.body_bytes); + encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); } - if (message.auth_info_bytes.length !== 0) { - writer.uint32(18).bytes(message.auth_info_bytes); + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); } - if (message.chain_id !== "") { - writer.uint32(26).string(message.chain_id); + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); } - if (message.account_number !== 0) { - writer.uint32(32).uint64(message.account_number); + if (message.accountNumber !== 0) { + writer.uint32(32).uint64(message.accountNumber); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignDoc { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignDoc } as SignDoc; + const message = createBaseSignDoc(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.body_bytes = reader.bytes(); + message.bodyBytes = reader.bytes(); break; case 2: - message.auth_info_bytes = reader.bytes(); + message.authInfoBytes = reader.bytes(); break; case 3: - message.chain_id = reader.string(); + message.chainId = reader.string(); break; case 4: - message.account_number = longToNumber(reader.uint64() as Long); + message.accountNumber = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -473,105 +510,169 @@ export const SignDoc = { }, fromJSON(object: any): SignDoc { - const message = { ...baseSignDoc } as SignDoc; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = bytesFromBase64(object.auth_info_bytes); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - return message; + return { + bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), + authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(), + chainId: isSet(object.chainId) ? String(object.chainId) : "", + accountNumber: isSet(object.accountNumber) ? Number(object.accountNumber) : 0, + }; }, toJSON(message: SignDoc): unknown { const obj: any = {}; - message.body_bytes !== undefined && - (obj.body_bytes = base64FromBytes( - message.body_bytes !== undefined ? message.body_bytes : new Uint8Array() + message.bodyBytes !== undefined + && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.authInfoBytes !== undefined + && (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), )); - message.auth_info_bytes !== undefined && - (obj.auth_info_bytes = base64FromBytes( - message.auth_info_bytes !== undefined - ? message.auth_info_bytes - : new Uint8Array() - )); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.account_number !== undefined && - (obj.account_number = message.account_number); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && (obj.accountNumber = Math.round(message.accountNumber)); return obj; }, - fromPartial(object: DeepPartial): SignDoc { - const message = { ...baseSignDoc } as SignDoc; - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.body_bytes = object.body_bytes; - } else { - message.body_bytes = new Uint8Array(); + fromPartial, I>>(object: I): SignDoc { + const message = createBaseSignDoc(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber ?? 0; + return message; + }, +}; + +function createBaseSignDocDirectAux(): SignDocDirectAux { + return { + bodyBytes: new Uint8Array(), + publicKey: undefined, + chainId: "", + accountNumber: 0, + sequence: 0, + tip: undefined, + }; +} + +export const SignDocDirectAux = { + encode(message: SignDocDirectAux, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.auth_info_bytes = object.auth_info_bytes; - } else { - message.auth_info_bytes = new Uint8Array(); + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim(); } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; + if (message.accountNumber !== 0) { + writer.uint32(32).uint64(message.accountNumber); + } + if (message.sequence !== 0) { + writer.uint32(40).uint64(message.sequence); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDocDirectAux(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = longToNumber(reader.uint64() as Long); + break; + case 5: + message.sequence = longToNumber(reader.uint64() as Long); + break; + case 6: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): SignDocDirectAux { + return { + bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + accountNumber: isSet(object.accountNumber) ? Number(object.accountNumber) : 0, + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined, + }; + }, + + toJSON(message: SignDocDirectAux): unknown { + const obj: any = {}; + message.bodyBytes !== undefined + && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && (obj.accountNumber = Math.round(message.accountNumber)); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.publicKey = (object.publicKey !== undefined && object.publicKey !== null) + ? Any.fromPartial(object.publicKey) + : undefined; + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber ?? 0; + message.sequence = object.sequence ?? 0; + message.tip = (object.tip !== undefined && object.tip !== null) ? Tip.fromPartial(object.tip) : undefined; + return message; + }, }; -const baseTxBody: object = { memo: "", timeout_height: 0 }; +function createBaseTxBody(): TxBody { + return { messages: [], memo: "", timeoutHeight: 0, extensionOptions: [], nonCriticalExtensionOptions: [] }; +} export const TxBody = { - encode(message: TxBody, writer: Writer = Writer.create()): Writer { + encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.memo !== "") { writer.uint32(18).string(message.memo); } - if (message.timeout_height !== 0) { - writer.uint32(24).uint64(message.timeout_height); + if (message.timeoutHeight !== 0) { + writer.uint32(24).uint64(message.timeoutHeight); } - for (const v of message.extension_options) { + for (const v of message.extensionOptions) { Any.encode(v!, writer.uint32(8186).fork()).ldelim(); } - for (const v of message.non_critical_extension_options) { + for (const v of message.nonCriticalExtensionOptions) { Any.encode(v!, writer.uint32(16378).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxBody { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxBody { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; + const message = createBaseTxBody(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -582,15 +683,13 @@ export const TxBody = { message.memo = reader.string(); break; case 3: - message.timeout_height = longToNumber(reader.uint64() as Long); + message.timeoutHeight = longToNumber(reader.uint64() as Long); break; case 1023: - message.extension_options.push(Any.decode(reader, reader.uint32())); + message.extensionOptions.push(Any.decode(reader, reader.uint32())); break; case 2047: - message.non_critical_extension_options.push( - Any.decode(reader, reader.uint32()) - ); + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -601,140 +700,86 @@ export const TxBody = { }, fromJSON(object: any): TxBody { - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(Any.fromJSON(e)); - } - } - if (object.memo !== undefined && object.memo !== null) { - message.memo = String(object.memo); - } else { - message.memo = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Number(object.timeout_height); - } else { - message.timeout_height = 0; - } - if ( - object.extension_options !== undefined && - object.extension_options !== null - ) { - for (const e of object.extension_options) { - message.extension_options.push(Any.fromJSON(e)); - } - } - if ( - object.non_critical_extension_options !== undefined && - object.non_critical_extension_options !== null - ) { - for (const e of object.non_critical_extension_options) { - message.non_critical_extension_options.push(Any.fromJSON(e)); - } - } - return message; + return { + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], + memo: isSet(object.memo) ? String(object.memo) : "", + timeoutHeight: isSet(object.timeoutHeight) ? Number(object.timeoutHeight) : 0, + extensionOptions: Array.isArray(object?.extensionOptions) + ? object.extensionOptions.map((e: any) => Any.fromJSON(e)) + : [], + nonCriticalExtensionOptions: Array.isArray(object?.nonCriticalExtensionOptions) + ? object.nonCriticalExtensionOptions.map((e: any) => Any.fromJSON(e)) + : [], + }; }, toJSON(message: TxBody): unknown { const obj: any = {}; if (message.messages) { - obj.messages = message.messages.map((e) => - e ? Any.toJSON(e) : undefined - ); + obj.messages = message.messages.map((e) => e ? Any.toJSON(e) : undefined); } else { obj.messages = []; } message.memo !== undefined && (obj.memo = message.memo); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height); - if (message.extension_options) { - obj.extension_options = message.extension_options.map((e) => - e ? Any.toJSON(e) : undefined - ); + message.timeoutHeight !== undefined && (obj.timeoutHeight = Math.round(message.timeoutHeight)); + if (message.extensionOptions) { + obj.extensionOptions = message.extensionOptions.map((e) => e ? Any.toJSON(e) : undefined); } else { - obj.extension_options = []; + obj.extensionOptions = []; } - if (message.non_critical_extension_options) { - obj.non_critical_extension_options = message.non_critical_extension_options.map( - (e) => (e ? Any.toJSON(e) : undefined) - ); + if (message.nonCriticalExtensionOptions) { + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => e ? Any.toJSON(e) : undefined); } else { - obj.non_critical_extension_options = []; + obj.nonCriticalExtensionOptions = []; } return obj; }, - fromPartial(object: DeepPartial): TxBody { - const message = { ...baseTxBody } as TxBody; - message.messages = []; - message.extension_options = []; - message.non_critical_extension_options = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(Any.fromPartial(e)); - } - } - if (object.memo !== undefined && object.memo !== null) { - message.memo = object.memo; - } else { - message.memo = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = object.timeout_height; - } else { - message.timeout_height = 0; - } - if ( - object.extension_options !== undefined && - object.extension_options !== null - ) { - for (const e of object.extension_options) { - message.extension_options.push(Any.fromPartial(e)); - } - } - if ( - object.non_critical_extension_options !== undefined && - object.non_critical_extension_options !== null - ) { - for (const e of object.non_critical_extension_options) { - message.non_critical_extension_options.push(Any.fromPartial(e)); - } - } + fromPartial, I>>(object: I): TxBody { + const message = createBaseTxBody(); + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; + message.memo = object.memo ?? ""; + message.timeoutHeight = object.timeoutHeight ?? 0; + message.extensionOptions = object.extensionOptions?.map((e) => Any.fromPartial(e)) || []; + message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || []; return message; }, }; -const baseAuthInfo: object = {}; +function createBaseAuthInfo(): AuthInfo { + return { signerInfos: [], fee: undefined, tip: undefined }; +} export const AuthInfo = { - encode(message: AuthInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.signer_infos) { + encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.signerInfos) { SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(26).fork()).ldelim(); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AuthInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; + const message = createBaseAuthInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signer_infos.push(SignerInfo.decode(reader, reader.uint32())); + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); break; case 2: message.fee = Fee.decode(reader, reader.uint32()); break; + case 3: + message.tip = Tip.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -744,61 +789,45 @@ export const AuthInfo = { }, fromJSON(object: any): AuthInfo { - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; - if (object.signer_infos !== undefined && object.signer_infos !== null) { - for (const e of object.signer_infos) { - message.signer_infos.push(SignerInfo.fromJSON(e)); - } - } - if (object.fee !== undefined && object.fee !== null) { - message.fee = Fee.fromJSON(object.fee); - } else { - message.fee = undefined; - } - return message; + return { + signerInfos: Array.isArray(object?.signerInfos) ? object.signerInfos.map((e: any) => SignerInfo.fromJSON(e)) : [], + fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined, + tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined, + }; }, toJSON(message: AuthInfo): unknown { const obj: any = {}; - if (message.signer_infos) { - obj.signer_infos = message.signer_infos.map((e) => - e ? SignerInfo.toJSON(e) : undefined - ); + if (message.signerInfos) { + obj.signerInfos = message.signerInfos.map((e) => e ? SignerInfo.toJSON(e) : undefined); } else { - obj.signer_infos = []; + obj.signerInfos = []; } - message.fee !== undefined && - (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); return obj; }, - fromPartial(object: DeepPartial): AuthInfo { - const message = { ...baseAuthInfo } as AuthInfo; - message.signer_infos = []; - if (object.signer_infos !== undefined && object.signer_infos !== null) { - for (const e of object.signer_infos) { - message.signer_infos.push(SignerInfo.fromPartial(e)); - } - } - if (object.fee !== undefined && object.fee !== null) { - message.fee = Fee.fromPartial(object.fee); - } else { - message.fee = undefined; - } + fromPartial, I>>(object: I): AuthInfo { + const message = createBaseAuthInfo(); + message.signerInfos = object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || []; + message.fee = (object.fee !== undefined && object.fee !== null) ? Fee.fromPartial(object.fee) : undefined; + message.tip = (object.tip !== undefined && object.tip !== null) ? Tip.fromPartial(object.tip) : undefined; return message; }, }; -const baseSignerInfo: object = { sequence: 0 }; +function createBaseSignerInfo(): SignerInfo { + return { publicKey: undefined, modeInfo: undefined, sequence: 0 }; +} export const SignerInfo = { - encode(message: SignerInfo, writer: Writer = Writer.create()): Writer { - if (message.public_key !== undefined) { - Any.encode(message.public_key, writer.uint32(10).fork()).ldelim(); + encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } - if (message.mode_info !== undefined) { - ModeInfo.encode(message.mode_info, writer.uint32(18).fork()).ldelim(); + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); } if (message.sequence !== 0) { writer.uint32(24).uint64(message.sequence); @@ -806,18 +835,18 @@ export const SignerInfo = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignerInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignerInfo } as SignerInfo; + const message = createBaseSignerInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.public_key = Any.decode(reader, reader.uint32()); + message.publicKey = Any.decode(reader, reader.uint32()); break; case 2: - message.mode_info = ModeInfo.decode(reader, reader.uint32()); + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); break; case 3: message.sequence = longToNumber(reader.uint64() as Long); @@ -831,64 +860,40 @@ export const SignerInfo = { }, fromJSON(object: any): SignerInfo { - const message = { ...baseSignerInfo } as SignerInfo; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromJSON(object.public_key); - } else { - message.public_key = undefined; - } - if (object.mode_info !== undefined && object.mode_info !== null) { - message.mode_info = ModeInfo.fromJSON(object.mode_info); - } else { - message.mode_info = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; + return { + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : undefined, + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; }, toJSON(message: SignerInfo): unknown { const obj: any = {}; - message.public_key !== undefined && - (obj.public_key = message.public_key - ? Any.toJSON(message.public_key) - : undefined); - message.mode_info !== undefined && - (obj.mode_info = message.mode_info - ? ModeInfo.toJSON(message.mode_info) - : undefined); - message.sequence !== undefined && (obj.sequence = message.sequence); + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.modeInfo !== undefined && (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); return obj; }, - fromPartial(object: DeepPartial): SignerInfo { - const message = { ...baseSignerInfo } as SignerInfo; - if (object.public_key !== undefined && object.public_key !== null) { - message.public_key = Any.fromPartial(object.public_key); - } else { - message.public_key = undefined; - } - if (object.mode_info !== undefined && object.mode_info !== null) { - message.mode_info = ModeInfo.fromPartial(object.mode_info); - } else { - message.mode_info = undefined; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } + fromPartial, I>>(object: I): SignerInfo { + const message = createBaseSignerInfo(); + message.publicKey = (object.publicKey !== undefined && object.publicKey !== null) + ? Any.fromPartial(object.publicKey) + : undefined; + message.modeInfo = (object.modeInfo !== undefined && object.modeInfo !== null) + ? ModeInfo.fromPartial(object.modeInfo) + : undefined; + message.sequence = object.sequence ?? 0; return message; }, }; -const baseModeInfo: object = {}; +function createBaseModeInfo(): ModeInfo { + return { single: undefined, multi: undefined }; +} export const ModeInfo = { - encode(message: ModeInfo, writer: Writer = Writer.create()): Writer { + encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.single !== undefined) { ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } @@ -898,10 +903,10 @@ export const ModeInfo = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo } as ModeInfo; + const message = createBaseModeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -920,63 +925,47 @@ export const ModeInfo = { }, fromJSON(object: any): ModeInfo { - const message = { ...baseModeInfo } as ModeInfo; - if (object.single !== undefined && object.single !== null) { - message.single = ModeInfo_Single.fromJSON(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = ModeInfo_Multi.fromJSON(object.multi); - } else { - message.multi = undefined; - } - return message; + return { + single: isSet(object.single) ? ModeInfo_Single.fromJSON(object.single) : undefined, + multi: isSet(object.multi) ? ModeInfo_Multi.fromJSON(object.multi) : undefined, + }; }, toJSON(message: ModeInfo): unknown { const obj: any = {}; - message.single !== undefined && - (obj.single = message.single - ? ModeInfo_Single.toJSON(message.single) - : undefined); - message.multi !== undefined && - (obj.multi = message.multi - ? ModeInfo_Multi.toJSON(message.multi) - : undefined); + message.single !== undefined && (obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined); + message.multi !== undefined && (obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined); return obj; }, - fromPartial(object: DeepPartial): ModeInfo { - const message = { ...baseModeInfo } as ModeInfo; - if (object.single !== undefined && object.single !== null) { - message.single = ModeInfo_Single.fromPartial(object.single); - } else { - message.single = undefined; - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = ModeInfo_Multi.fromPartial(object.multi); - } else { - message.multi = undefined; - } + fromPartial, I>>(object: I): ModeInfo { + const message = createBaseModeInfo(); + message.single = (object.single !== undefined && object.single !== null) + ? ModeInfo_Single.fromPartial(object.single) + : undefined; + message.multi = (object.multi !== undefined && object.multi !== null) + ? ModeInfo_Multi.fromPartial(object.multi) + : undefined; return message; }, }; -const baseModeInfo_Single: object = { mode: 0 }; +function createBaseModeInfo_Single(): ModeInfo_Single { + return { mode: 0 }; +} export const ModeInfo_Single = { - encode(message: ModeInfo_Single, writer: Writer = Writer.create()): Writer { + encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModeInfo_Single { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo_Single } as ModeInfo_Single; + const message = createBaseModeInfo_Single(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -992,13 +981,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { - const message = { ...baseModeInfo_Single } as ModeInfo_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = signModeFromJSON(object.mode); - } else { - message.mode = 0; - } - return message; + return { mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1007,38 +990,32 @@ export const ModeInfo_Single = { return obj; }, - fromPartial(object: DeepPartial): ModeInfo_Single { - const message = { ...baseModeInfo_Single } as ModeInfo_Single; - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } else { - message.mode = 0; - } + fromPartial, I>>(object: I): ModeInfo_Single { + const message = createBaseModeInfo_Single(); + message.mode = object.mode ?? 0; return message; }, }; -const baseModeInfo_Multi: object = {}; +function createBaseModeInfo_Multi(): ModeInfo_Multi { + return { bitarray: undefined, modeInfos: [] }; +} export const ModeInfo_Multi = { - encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer { + encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.bitarray !== undefined) { - CompactBitArray.encode( - message.bitarray, - writer.uint32(10).fork() - ).ldelim(); + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } - for (const v of message.mode_infos) { + for (const v of message.modeInfos) { ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModeInfo_Multi { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; + const message = createBaseModeInfo_Multi(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1046,7 +1023,7 @@ export const ModeInfo_Multi = { message.bitarray = CompactBitArray.decode(reader, reader.uint32()); break; case 2: - message.mode_infos.push(ModeInfo.decode(reader, reader.uint32())); + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1057,63 +1034,45 @@ export const ModeInfo_Multi = { }, fromJSON(object: any): ModeInfo_Multi { - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromJSON(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.mode_infos !== undefined && object.mode_infos !== null) { - for (const e of object.mode_infos) { - message.mode_infos.push(ModeInfo.fromJSON(e)); - } - } - return message; + return { + bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : undefined, + modeInfos: Array.isArray(object?.modeInfos) ? object.modeInfos.map((e: any) => ModeInfo.fromJSON(e)) : [], + }; }, toJSON(message: ModeInfo_Multi): unknown { const obj: any = {}; - message.bitarray !== undefined && - (obj.bitarray = message.bitarray - ? CompactBitArray.toJSON(message.bitarray) - : undefined); - if (message.mode_infos) { - obj.mode_infos = message.mode_infos.map((e) => - e ? ModeInfo.toJSON(e) : undefined - ); + message.bitarray !== undefined + && (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.modeInfos) { + obj.modeInfos = message.modeInfos.map((e) => e ? ModeInfo.toJSON(e) : undefined); } else { - obj.mode_infos = []; + obj.modeInfos = []; } return obj; }, - fromPartial(object: DeepPartial): ModeInfo_Multi { - const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; - message.mode_infos = []; - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromPartial(object.bitarray); - } else { - message.bitarray = undefined; - } - if (object.mode_infos !== undefined && object.mode_infos !== null) { - for (const e of object.mode_infos) { - message.mode_infos.push(ModeInfo.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ModeInfo_Multi { + const message = createBaseModeInfo_Multi(); + message.bitarray = (object.bitarray !== undefined && object.bitarray !== null) + ? CompactBitArray.fromPartial(object.bitarray) + : undefined; + message.modeInfos = object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || []; return message; }, }; -const baseFee: object = { gas_limit: 0, payer: "", granter: "" }; +function createBaseFee(): Fee { + return { amount: [], gasLimit: 0, payer: "", granter: "" }; +} export const Fee = { - encode(message: Fee, writer: Writer = Writer.create()): Writer { + encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.gas_limit !== 0) { - writer.uint32(16).uint64(message.gas_limit); + if (message.gasLimit !== 0) { + writer.uint32(16).uint64(message.gasLimit); } if (message.payer !== "") { writer.uint32(26).string(message.payer); @@ -1124,11 +1083,10 @@ export const Fee = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Fee { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFee } as Fee; - message.amount = []; + const message = createBaseFee(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1136,7 +1094,7 @@ export const Fee = { message.amount.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.gas_limit = longToNumber(reader.uint64() as Long); + message.gasLimit = longToNumber(reader.uint64() as Long); break; case 3: message.payer = reader.string(); @@ -1153,115 +1111,234 @@ export const Fee = { }, fromJSON(object: any): Fee { - const message = { ...baseFee } as Fee; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - if (object.gas_limit !== undefined && object.gas_limit !== null) { - message.gas_limit = Number(object.gas_limit); - } else { - message.gas_limit = 0; - } - if (object.payer !== undefined && object.payer !== null) { - message.payer = String(object.payer); - } else { - message.payer = ""; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = String(object.granter); - } else { - message.granter = ""; - } - return message; + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + gasLimit: isSet(object.gasLimit) ? Number(object.gasLimit) : 0, + payer: isSet(object.payer) ? String(object.payer) : "", + granter: isSet(object.granter) ? String(object.granter) : "", + }; }, toJSON(message: Fee): unknown { const obj: any = {}; if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } - message.gas_limit !== undefined && (obj.gas_limit = message.gas_limit); + message.gasLimit !== undefined && (obj.gasLimit = Math.round(message.gasLimit)); message.payer !== undefined && (obj.payer = message.payer); message.granter !== undefined && (obj.granter = message.granter); return obj; }, - fromPartial(object: DeepPartial): Fee { - const message = { ...baseFee } as Fee; - message.amount = []; - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); + fromPartial, I>>(object: I): Fee { + const message = createBaseFee(); + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + message.gasLimit = object.gasLimit ?? 0; + message.payer = object.payer ?? ""; + message.granter = object.granter ?? ""; + return message; + }, +}; + +function createBaseTip(): Tip { + return { amount: [], tipper: "" }; +} + +export const Tip = { + encode(message: Tip, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tipper !== "") { + writer.uint32(18).string(message.tipper); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Tip { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTip(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.tipper = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } } - if (object.gas_limit !== undefined && object.gas_limit !== null) { - message.gas_limit = object.gas_limit; + return message; + }, + + fromJSON(object: any): Tip { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + tipper: isSet(object.tipper) ? String(object.tipper) : "", + }; + }, + + toJSON(message: Tip): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { - message.gas_limit = 0; + obj.amount = []; } - if (object.payer !== undefined && object.payer !== null) { - message.payer = object.payer; - } else { - message.payer = ""; + message.tipper !== undefined && (obj.tipper = message.tipper); + return obj; + }, + + fromPartial, I>>(object: I): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + message.tipper = object.tipper ?? ""; + return message; + }, +}; + +function createBaseAuxSignerData(): AuxSignerData { + return { address: "", signDoc: undefined, mode: 0, sig: new Uint8Array() }; +} + +export const AuxSignerData = { + encode(message: AuxSignerData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); } - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } else { - message.granter = ""; + if (message.signDoc !== undefined) { + SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim(); } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.sig.length !== 0) { + writer.uint32(34).bytes(message.sig); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuxSignerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); + break; + case 3: + message.mode = reader.int32() as any; + break; + case 4: + message.sig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AuxSignerData { + return { + address: isSet(object.address) ? String(object.address) : "", + signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array(), + }; + }, + + toJSON(message: AuxSignerData): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.signDoc !== undefined + && (obj.signDoc = message.signDoc ? SignDocDirectAux.toJSON(message.signDoc) : undefined); + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + message.sig !== undefined + && (obj.sig = base64FromBytes(message.sig !== undefined ? message.sig : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): AuxSignerData { + const message = createBaseAuxSignerData(); + message.address = object.address ?? ""; + message.signDoc = (object.signDoc !== undefined && object.signDoc !== null) + ? SignDocDirectAux.fromPartial(object.signDoc) + : undefined; + message.mode = object.mode ?? 0; + message.sig = object.sig ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1269,7 +1346,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/duration.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/duration.ts index 0cb51f5a90..01ce7b0bf9 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/duration.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/duration.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -83,10 +83,12 @@ export interface Duration { nanos: number; } -const baseDuration: object = { seconds: 0, nanos: 0 }; +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} export const Duration = { - encode(message: Duration, writer: Writer = Writer.create()): Writer { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -96,10 +98,10 @@ export const Duration = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDuration } as Duration; + const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -118,64 +120,57 @@ export const Duration = { }, fromJSON(object: any): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Duration { - const message = { ...baseDuration } as Duration; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -183,7 +178,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/abci/types.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/abci/types.ts index bf5c610217..efc195a846 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/abci/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/abci/types.ts @@ -1,16 +1,12 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { Header } from "../../tendermint/types/types"; -import { ProofOps } from "../../tendermint/crypto/proof"; -import { - EvidenceParams, - ValidatorParams, - VersionParams, -} from "../../tendermint/types/params"; -import { PublicKey } from "../../tendermint/crypto/keys"; +import { PublicKey } from "../crypto/keys"; +import { ProofOps } from "../crypto/proof"; +import { ConsensusParams } from "../types/params"; +import { Header } from "../types/types"; export const protobufPackage = "tendermint.abci"; @@ -41,46 +37,48 @@ export function checkTxTypeToJSON(object: CheckTxType): string { return "NEW"; case CheckTxType.RECHECK: return "RECHECK"; + case CheckTxType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } -export enum EvidenceType { +export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } -export function evidenceTypeFromJSON(object: any): EvidenceType { +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return MisbehaviorType.UNRECOGNIZED; } } -export function evidenceTypeToJSON(object: EvidenceType): string { +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { - case EvidenceType.UNKNOWN: + case MisbehaviorType.UNKNOWN: return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: + case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: + case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; + case MisbehaviorType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -88,45 +86,42 @@ export interface Request { echo: RequestEcho | undefined; flush: RequestFlush | undefined; info: RequestInfo | undefined; - set_option: RequestSetOption | undefined; - init_chain: RequestInitChain | undefined; + initChain: RequestInitChain | undefined; query: RequestQuery | undefined; - begin_block: RequestBeginBlock | undefined; - check_tx: RequestCheckTx | undefined; - deliver_tx: RequestDeliverTx | undefined; - end_block: RequestEndBlock | undefined; + beginBlock: RequestBeginBlock | undefined; + checkTx: RequestCheckTx | undefined; + deliverTx: RequestDeliverTx | undefined; + endBlock: RequestEndBlock | undefined; commit: RequestCommit | undefined; - list_snapshots: RequestListSnapshots | undefined; - offer_snapshot: RequestOfferSnapshot | undefined; - load_snapshot_chunk: RequestLoadSnapshotChunk | undefined; - apply_snapshot_chunk: RequestApplySnapshotChunk | undefined; + listSnapshots: RequestListSnapshots | undefined; + offerSnapshot: RequestOfferSnapshot | undefined; + loadSnapshotChunk: RequestLoadSnapshotChunk | undefined; + applySnapshotChunk: RequestApplySnapshotChunk | undefined; + prepareProposal: RequestPrepareProposal | undefined; + processProposal: RequestProcessProposal | undefined; } export interface RequestEcho { message: string; } -export interface RequestFlush {} +export interface RequestFlush { +} export interface RequestInfo { version: string; - block_version: number; - p2p_version: number; -} - -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; + blockVersion: number; + p2pVersion: number; + abciVersion: string; } export interface RequestInitChain { time: Date | undefined; - chain_id: string; - consensus_params: ConsensusParams | undefined; + chainId: string; + consensusParams: ConsensusParams | undefined; validators: ValidatorUpdate[]; - app_state_bytes: Uint8Array; - initial_height: number; + appStateBytes: Uint8Array; + initialHeight: number; } export interface RequestQuery { @@ -139,8 +134,8 @@ export interface RequestQuery { export interface RequestBeginBlock { hash: Uint8Array; header: Header | undefined; - last_commit_info: LastCommitInfo | undefined; - byzantine_validators: Evidence[]; + lastCommitInfo: CommitInfo | undefined; + byzantineValidators: Misbehavior[]; } export interface RequestCheckTx { @@ -156,17 +151,21 @@ export interface RequestEndBlock { height: number; } -export interface RequestCommit {} +export interface RequestCommit { +} /** lists available snapshots */ -export interface RequestListSnapshots {} +export interface RequestListSnapshots { +} /** offers a snapshot to the application */ export interface RequestOfferSnapshot { /** snapshot offered by peers */ - snapshot: Snapshot | undefined; + snapshot: + | Snapshot + | undefined; /** light client-verified app hash for snapshot height */ - app_hash: Uint8Array; + appHash: Uint8Array; } /** loads a snapshot chunk */ @@ -183,23 +182,54 @@ export interface RequestApplySnapshotChunk { sender: string; } +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: number; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo | undefined; + misbehavior: Misbehavior[]; + height: number; + time: Date | undefined; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} + +export interface RequestProcessProposal { + txs: Uint8Array[]; + proposedLastCommit: CommitInfo | undefined; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: number; + time: Date | undefined; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} + export interface Response { exception: ResponseException | undefined; echo: ResponseEcho | undefined; flush: ResponseFlush | undefined; info: ResponseInfo | undefined; - set_option: ResponseSetOption | undefined; - init_chain: ResponseInitChain | undefined; + initChain: ResponseInitChain | undefined; query: ResponseQuery | undefined; - begin_block: ResponseBeginBlock | undefined; - check_tx: ResponseCheckTx | undefined; - deliver_tx: ResponseDeliverTx | undefined; - end_block: ResponseEndBlock | undefined; + beginBlock: ResponseBeginBlock | undefined; + checkTx: ResponseCheckTx | undefined; + deliverTx: ResponseDeliverTx | undefined; + endBlock: ResponseEndBlock | undefined; commit: ResponseCommit | undefined; - list_snapshots: ResponseListSnapshots | undefined; - offer_snapshot: ResponseOfferSnapshot | undefined; - load_snapshot_chunk: ResponseLoadSnapshotChunk | undefined; - apply_snapshot_chunk: ResponseApplySnapshotChunk | undefined; + listSnapshots: ResponseListSnapshots | undefined; + offerSnapshot: ResponseOfferSnapshot | undefined; + loadSnapshotChunk: ResponseLoadSnapshotChunk | undefined; + applySnapshotChunk: ResponseApplySnapshotChunk | undefined; + prepareProposal: ResponsePrepareProposal | undefined; + processProposal: ResponseProcessProposal | undefined; } /** nondeterministic */ @@ -211,28 +241,21 @@ export interface ResponseEcho { message: string; } -export interface ResponseFlush {} +export interface ResponseFlush { +} export interface ResponseInfo { data: string; version: string; - app_version: number; - last_block_height: number; - last_block_app_hash: Uint8Array; -} - -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; + appVersion: number; + lastBlockHeight: number; + lastBlockAppHash: Uint8Array; } export interface ResponseInitChain { - consensus_params: ConsensusParams | undefined; + consensusParams: ConsensusParams | undefined; validators: ValidatorUpdate[]; - app_hash: Uint8Array; + appHash: Uint8Array; } export interface ResponseQuery { @@ -244,7 +267,7 @@ export interface ResponseQuery { index: number; key: Uint8Array; value: Uint8Array; - proof_ops: ProofOps | undefined; + proofOps: ProofOps | undefined; height: number; codespace: string; } @@ -260,10 +283,17 @@ export interface ResponseCheckTx { log: string; /** nondeterministic */ info: string; - gas_wanted: number; - gas_used: number; + gasWanted: number; + gasUsed: number; events: Event[]; codespace: string; + sender: string; + priority: number; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempoolError: string; } export interface ResponseDeliverTx { @@ -273,22 +303,23 @@ export interface ResponseDeliverTx { log: string; /** nondeterministic */ info: string; - gas_wanted: number; - gas_used: number; + gasWanted: number; + gasUsed: number; + /** nondeterministic */ events: Event[]; codespace: string; } export interface ResponseEndBlock { - validator_updates: ValidatorUpdate[]; - consensus_param_updates: ConsensusParams | undefined; + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates: ConsensusParams | undefined; events: Event[]; } export interface ResponseCommit { /** reserve 1 */ data: Uint8Array; - retain_height: number; + retainHeight: number; } export interface ResponseListSnapshots { @@ -315,9 +346,7 @@ export enum ResponseOfferSnapshot_Result { UNRECOGNIZED = -1, } -export function responseOfferSnapshot_ResultFromJSON( - object: any -): ResponseOfferSnapshot_Result { +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { switch (object) { case 0: case "UNKNOWN": @@ -344,9 +373,7 @@ export function responseOfferSnapshot_ResultFromJSON( } } -export function responseOfferSnapshot_ResultToJSON( - object: ResponseOfferSnapshot_Result -): string { +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { switch (object) { case ResponseOfferSnapshot_Result.UNKNOWN: return "UNKNOWN"; @@ -360,8 +387,9 @@ export function responseOfferSnapshot_ResultToJSON( return "REJECT_FORMAT"; case ResponseOfferSnapshot_Result.REJECT_SENDER: return "REJECT_SENDER"; + case ResponseOfferSnapshot_Result.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -372,9 +400,9 @@ export interface ResponseLoadSnapshotChunk { export interface ResponseApplySnapshotChunk { result: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ - refetch_chunks: number[]; + refetchChunks: number[]; /** Chunk senders to reject and ban */ - reject_senders: string[]; + rejectSenders: string[]; } export enum ResponseApplySnapshotChunk_Result { @@ -393,9 +421,7 @@ export enum ResponseApplySnapshotChunk_Result { UNRECOGNIZED = -1, } -export function responseApplySnapshotChunk_ResultFromJSON( - object: any -): ResponseApplySnapshotChunk_Result { +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { switch (object) { case 0: case "UNKNOWN": @@ -422,9 +448,7 @@ export function responseApplySnapshotChunk_ResultFromJSON( } } -export function responseApplySnapshotChunk_ResultToJSON( - object: ResponseApplySnapshotChunk_Result -): string { +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { switch (object) { case ResponseApplySnapshotChunk_Result.UNKNOWN: return "UNKNOWN"; @@ -438,35 +462,74 @@ export function responseApplySnapshotChunk_ResultToJSON( return "RETRY_SNAPSHOT"; case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: return "REJECT_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block: BlockParams | undefined; - evidence: EvidenceParams | undefined; - validator: ValidatorParams | undefined; - version: VersionParams | undefined; +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} + +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} + +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} + +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } } -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - max_bytes: number; - /** Note: must be greater or equal to -1 */ - max_gas: number; +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } } -export interface LastCommitInfo { +export interface CommitInfo { round: number; votes: VoteInfo[]; } +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} + /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -479,8 +542,8 @@ export interface Event { /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -507,30 +570,41 @@ export interface Validator { /** ValidatorUpdate */ export interface ValidatorUpdate { - pub_key: PublicKey | undefined; + pubKey: PublicKey | undefined; power: number; } /** VoteInfo */ export interface VoteInfo { validator: Validator | undefined; - signed_last_block: boolean; + signedLastBlock: boolean; } -export interface Evidence { - type: EvidenceType; - /** The offending validator */ +export interface ExtendedVoteInfo { validator: Validator | undefined; + signedLastBlock: boolean; + /** Reserved for future use */ + voteExtension: Uint8Array; +} + +export interface Misbehavior { + type: MisbehaviorType; + /** The offending validator */ + validator: + | Validator + | undefined; /** The height when the offense occurred */ height: number; /** The corresponding time where the offense occurred */ - time: Date | undefined; + time: + | Date + | undefined; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - total_voting_power: number; + totalVotingPower: number; } export interface Snapshot { @@ -546,10 +620,29 @@ export interface Snapshot { metadata: Uint8Array; } -const baseRequest: object = {}; +function createBaseRequest(): Request { + return { + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + }; +} export const Request = { - encode(message: Request, writer: Writer = Writer.create()): Writer { + encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.echo !== undefined) { RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); } @@ -559,79 +652,52 @@ export const Request = { if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } - if (message.set_option !== undefined) { - RequestSetOption.encode( - message.set_option, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.init_chain !== undefined) { - RequestInitChain.encode( - message.init_chain, - writer.uint32(42).fork() - ).ldelim(); + if (message.initChain !== undefined) { + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } if (message.query !== undefined) { RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); } - if (message.begin_block !== undefined) { - RequestBeginBlock.encode( - message.begin_block, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.check_tx !== undefined) { - RequestCheckTx.encode( - message.check_tx, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.deliver_tx !== undefined) { - RequestDeliverTx.encode( - message.deliver_tx, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.end_block !== undefined) { - RequestEndBlock.encode( - message.end_block, - writer.uint32(82).fork() - ).ldelim(); + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); } if (message.commit !== undefined) { RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); } - if (message.list_snapshots !== undefined) { - RequestListSnapshots.encode( - message.list_snapshots, - writer.uint32(98).fork() - ).ldelim(); - } - if (message.offer_snapshot !== undefined) { - RequestOfferSnapshot.encode( - message.offer_snapshot, - writer.uint32(106).fork() - ).ldelim(); - } - if (message.load_snapshot_chunk !== undefined) { - RequestLoadSnapshotChunk.encode( - message.load_snapshot_chunk, - writer.uint32(114).fork() - ).ldelim(); - } - if (message.apply_snapshot_chunk !== undefined) { - RequestApplySnapshotChunk.encode( - message.apply_snapshot_chunk, - writer.uint32(122).fork() - ).ldelim(); + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Request { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Request { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequest } as Request; + const message = createBaseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -644,56 +710,44 @@ export const Request = { case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; - case 4: - message.set_option = RequestSetOption.decode(reader, reader.uint32()); - break; case 5: - message.init_chain = RequestInitChain.decode(reader, reader.uint32()); + message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; case 6: message.query = RequestQuery.decode(reader, reader.uint32()); break; case 7: - message.begin_block = RequestBeginBlock.decode( - reader, - reader.uint32() - ); + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); break; case 8: - message.check_tx = RequestCheckTx.decode(reader, reader.uint32()); + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); break; case 9: - message.deliver_tx = RequestDeliverTx.decode(reader, reader.uint32()); + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); break; case 10: - message.end_block = RequestEndBlock.decode(reader, reader.uint32()); + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); break; case 11: message.commit = RequestCommit.decode(reader, reader.uint32()); break; case 12: - message.list_snapshots = RequestListSnapshots.decode( - reader, - reader.uint32() - ); + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); break; case 13: - message.offer_snapshot = RequestOfferSnapshot.decode( - reader, - reader.uint32() - ); + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); break; case 14: - message.load_snapshot_chunk = RequestLoadSnapshotChunk.decode( - reader, - reader.uint32() - ); + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); break; case 15: - message.apply_snapshot_chunk = RequestApplySnapshotChunk.decode( - reader, - reader.uint32() - ); + message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -704,269 +758,140 @@ export const Request = { }, fromJSON(object: any): Request { - const message = { ...baseRequest } as Request; - if (object.echo !== undefined && object.echo !== null) { - message.echo = RequestEcho.fromJSON(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = RequestFlush.fromJSON(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = RequestInfo.fromJSON(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = RequestSetOption.fromJSON(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = RequestInitChain.fromJSON(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = RequestQuery.fromJSON(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = RequestBeginBlock.fromJSON(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = RequestCheckTx.fromJSON(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = RequestDeliverTx.fromJSON(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = RequestEndBlock.fromJSON(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = RequestCommit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = RequestListSnapshots.fromJSON( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = RequestOfferSnapshot.fromJSON( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = RequestLoadSnapshotChunk.fromJSON( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = RequestApplySnapshotChunk.fromJSON( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; + return { + echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined, + flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined, + info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined, + initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined, + query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined, + beginBlock: isSet(object.beginBlock) ? RequestBeginBlock.fromJSON(object.beginBlock) : undefined, + checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined, + deliverTx: isSet(object.deliverTx) ? RequestDeliverTx.fromJSON(object.deliverTx) : undefined, + endBlock: isSet(object.endBlock) ? RequestEndBlock.fromJSON(object.endBlock) : undefined, + commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined, + listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined, + offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) + ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) + : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) + ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk) + : undefined, + prepareProposal: isSet(object.prepareProposal) + ? RequestPrepareProposal.fromJSON(object.prepareProposal) + : undefined, + processProposal: isSet(object.processProposal) + ? RequestProcessProposal.fromJSON(object.processProposal) + : undefined, + }; }, toJSON(message: Request): unknown { const obj: any = {}; - message.echo !== undefined && - (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && - (obj.flush = message.flush - ? RequestFlush.toJSON(message.flush) - : undefined); - message.info !== undefined && - (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); - message.set_option !== undefined && - (obj.set_option = message.set_option - ? RequestSetOption.toJSON(message.set_option) - : undefined); - message.init_chain !== undefined && - (obj.init_chain = message.init_chain - ? RequestInitChain.toJSON(message.init_chain) - : undefined); - message.query !== undefined && - (obj.query = message.query - ? RequestQuery.toJSON(message.query) - : undefined); - message.begin_block !== undefined && - (obj.begin_block = message.begin_block - ? RequestBeginBlock.toJSON(message.begin_block) - : undefined); - message.check_tx !== undefined && - (obj.check_tx = message.check_tx - ? RequestCheckTx.toJSON(message.check_tx) - : undefined); - message.deliver_tx !== undefined && - (obj.deliver_tx = message.deliver_tx - ? RequestDeliverTx.toJSON(message.deliver_tx) - : undefined); - message.end_block !== undefined && - (obj.end_block = message.end_block - ? RequestEndBlock.toJSON(message.end_block) - : undefined); - message.commit !== undefined && - (obj.commit = message.commit - ? RequestCommit.toJSON(message.commit) - : undefined); - message.list_snapshots !== undefined && - (obj.list_snapshots = message.list_snapshots - ? RequestListSnapshots.toJSON(message.list_snapshots) - : undefined); - message.offer_snapshot !== undefined && - (obj.offer_snapshot = message.offer_snapshot - ? RequestOfferSnapshot.toJSON(message.offer_snapshot) - : undefined); - message.load_snapshot_chunk !== undefined && - (obj.load_snapshot_chunk = message.load_snapshot_chunk - ? RequestLoadSnapshotChunk.toJSON(message.load_snapshot_chunk) - : undefined); - message.apply_snapshot_chunk !== undefined && - (obj.apply_snapshot_chunk = message.apply_snapshot_chunk - ? RequestApplySnapshotChunk.toJSON(message.apply_snapshot_chunk) - : undefined); + message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); + message.initChain !== undefined + && (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined + && (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined + && (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined + && (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined + && (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined + && (obj.listSnapshots = message.listSnapshots ? RequestListSnapshots.toJSON(message.listSnapshots) : undefined); + message.offerSnapshot !== undefined + && (obj.offerSnapshot = message.offerSnapshot ? RequestOfferSnapshot.toJSON(message.offerSnapshot) : undefined); + message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk + ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal + ? RequestPrepareProposal.toJSON(message.prepareProposal) + : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal + ? RequestProcessProposal.toJSON(message.processProposal) + : undefined); return obj; }, - fromPartial(object: DeepPartial): Request { - const message = { ...baseRequest } as Request; - if (object.echo !== undefined && object.echo !== null) { - message.echo = RequestEcho.fromPartial(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = RequestFlush.fromPartial(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = RequestInfo.fromPartial(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = RequestSetOption.fromPartial(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = RequestInitChain.fromPartial(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = RequestQuery.fromPartial(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = RequestBeginBlock.fromPartial(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = RequestCheckTx.fromPartial(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = RequestDeliverTx.fromPartial(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = RequestEndBlock.fromPartial(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = RequestCommit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = RequestListSnapshots.fromPartial( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = RequestOfferSnapshot.fromPartial( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = RequestLoadSnapshotChunk.fromPartial( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = RequestApplySnapshotChunk.fromPartial( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } + fromPartial, I>>(object: I): Request { + const message = createBaseRequest(); + message.echo = (object.echo !== undefined && object.echo !== null) + ? RequestEcho.fromPartial(object.echo) + : undefined; + message.flush = (object.flush !== undefined && object.flush !== null) + ? RequestFlush.fromPartial(object.flush) + : undefined; + message.info = (object.info !== undefined && object.info !== null) + ? RequestInfo.fromPartial(object.info) + : undefined; + message.initChain = (object.initChain !== undefined && object.initChain !== null) + ? RequestInitChain.fromPartial(object.initChain) + : undefined; + message.query = (object.query !== undefined && object.query !== null) + ? RequestQuery.fromPartial(object.query) + : undefined; + message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) + ? RequestBeginBlock.fromPartial(object.beginBlock) + : undefined; + message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) + ? RequestCheckTx.fromPartial(object.checkTx) + : undefined; + message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) + ? RequestDeliverTx.fromPartial(object.deliverTx) + : undefined; + message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) + ? RequestEndBlock.fromPartial(object.endBlock) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? RequestCommit.fromPartial(object.commit) + : undefined; + message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) + ? RequestListSnapshots.fromPartial(object.listSnapshots) + : undefined; + message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) + ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined; + message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) + ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined; + message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) + ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined; + message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null) + ? RequestPrepareProposal.fromPartial(object.prepareProposal) + : undefined; + message.processProposal = (object.processProposal !== undefined && object.processProposal !== null) + ? RequestProcessProposal.fromPartial(object.processProposal) + : undefined; return message; }, }; -const baseRequestEcho: object = { message: "" }; +function createBaseRequestEcho(): RequestEcho { + return { message: "" }; +} export const RequestEcho = { - encode(message: RequestEcho, writer: Writer = Writer.create()): Writer { + encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestEcho { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestEcho } as RequestEcho; + const message = createBaseRequestEcho(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -982,13 +907,7 @@ export const RequestEcho = { }, fromJSON(object: any): RequestEcho { - const message = { ...baseRequestEcho } as RequestEcho; - if (object.message !== undefined && object.message !== null) { - message.message = String(object.message); - } else { - message.message = ""; - } - return message; + return { message: isSet(object.message) ? String(object.message) : "" }; }, toJSON(message: RequestEcho): unknown { @@ -997,28 +916,26 @@ export const RequestEcho = { return obj; }, - fromPartial(object: DeepPartial): RequestEcho { - const message = { ...baseRequestEcho } as RequestEcho; - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } else { - message.message = ""; - } + fromPartial, I>>(object: I): RequestEcho { + const message = createBaseRequestEcho(); + message.message = object.message ?? ""; return message; }, }; -const baseRequestFlush: object = {}; +function createBaseRequestFlush(): RequestFlush { + return {}; +} export const RequestFlush = { - encode(_: RequestFlush, writer: Writer = Writer.create()): Writer { + encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestFlush { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestFlush } as RequestFlush; + const message = createBaseRequestFlush(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1031,8 +948,7 @@ export const RequestFlush = { }, fromJSON(_: any): RequestFlush { - const message = { ...baseRequestFlush } as RequestFlush; - return message; + return {}; }, toJSON(_: RequestFlush): unknown { @@ -1040,36 +956,37 @@ export const RequestFlush = { return obj; }, - fromPartial(_: DeepPartial): RequestFlush { - const message = { ...baseRequestFlush } as RequestFlush; + fromPartial, I>>(_: I): RequestFlush { + const message = createBaseRequestFlush(); return message; }, }; -const baseRequestInfo: object = { - version: "", - block_version: 0, - p2p_version: 0, -}; +function createBaseRequestInfo(): RequestInfo { + return { version: "", blockVersion: 0, p2pVersion: 0, abciVersion: "" }; +} export const RequestInfo = { - encode(message: RequestInfo, writer: Writer = Writer.create()): Writer { + encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== "") { writer.uint32(10).string(message.version); } - if (message.block_version !== 0) { - writer.uint32(16).uint64(message.block_version); + if (message.blockVersion !== 0) { + writer.uint32(16).uint64(message.blockVersion); + } + if (message.p2pVersion !== 0) { + writer.uint32(24).uint64(message.p2pVersion); } - if (message.p2p_version !== 0) { - writer.uint32(24).uint64(message.p2p_version); + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestInfo } as RequestInfo; + const message = createBaseRequestInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1077,10 +994,13 @@ export const RequestInfo = { message.version = reader.string(); break; case 2: - message.block_version = longToNumber(reader.uint64() as Long); + message.blockVersion = longToNumber(reader.uint64() as Long); break; case 3: - message.p2p_version = longToNumber(reader.uint64() as Long); + message.p2pVersion = longToNumber(reader.uint64() as Long); + break; + case 4: + message.abciVersion = reader.string(); break; default: reader.skipType(tag & 7); @@ -1091,81 +1011,91 @@ export const RequestInfo = { }, fromJSON(object: any): RequestInfo { - const message = { ...baseRequestInfo } as RequestInfo; - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.block_version !== undefined && object.block_version !== null) { - message.block_version = Number(object.block_version); - } else { - message.block_version = 0; - } - if (object.p2p_version !== undefined && object.p2p_version !== null) { - message.p2p_version = Number(object.p2p_version); - } else { - message.p2p_version = 0; - } - return message; + return { + version: isSet(object.version) ? String(object.version) : "", + blockVersion: isSet(object.blockVersion) ? Number(object.blockVersion) : 0, + p2pVersion: isSet(object.p2pVersion) ? Number(object.p2pVersion) : 0, + abciVersion: isSet(object.abciVersion) ? String(object.abciVersion) : "", + }; }, toJSON(message: RequestInfo): unknown { const obj: any = {}; message.version !== undefined && (obj.version = message.version); - message.block_version !== undefined && - (obj.block_version = message.block_version); - message.p2p_version !== undefined && - (obj.p2p_version = message.p2p_version); + message.blockVersion !== undefined && (obj.blockVersion = Math.round(message.blockVersion)); + message.p2pVersion !== undefined && (obj.p2pVersion = Math.round(message.p2pVersion)); + message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion); return obj; }, - fromPartial(object: DeepPartial): RequestInfo { - const message = { ...baseRequestInfo } as RequestInfo; - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.block_version !== undefined && object.block_version !== null) { - message.block_version = object.block_version; - } else { - message.block_version = 0; - } - if (object.p2p_version !== undefined && object.p2p_version !== null) { - message.p2p_version = object.p2p_version; - } else { - message.p2p_version = 0; - } + fromPartial, I>>(object: I): RequestInfo { + const message = createBaseRequestInfo(); + message.version = object.version ?? ""; + message.blockVersion = object.blockVersion ?? 0; + message.p2pVersion = object.p2pVersion ?? 0; + message.abciVersion = object.abciVersion ?? ""; return message; }, }; -const baseRequestSetOption: object = { key: "", value: "" }; +function createBaseRequestInitChain(): RequestInitChain { + return { + time: undefined, + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: 0, + }; +} -export const RequestSetOption = { - encode(message: RequestSetOption, writer: Writer = Writer.create()): Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); +export const RequestInitChain = { + encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); } - if (message.value !== "") { - writer.uint32(18).string(message.value); + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (message.initialHeight !== 0) { + writer.uint32(48).int64(message.initialHeight); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestSetOption } as RequestSetOption; + const message = createBaseRequestInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.string(); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 2: - message.value = reader.string(); + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -1175,268 +1105,91 @@ export const RequestSetOption = { return message; }, - fromJSON(object: any): RequestSetOption { - const message = { ...baseRequestSetOption } as RequestSetOption; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = String(object.value); - } else { - message.value = ""; - } - return message; + fromJSON(object: any): RequestInitChain { + return { + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(), + initialHeight: isSet(object.initialHeight) ? Number(object.initialHeight) : 0, + }; }, - toJSON(message: RequestSetOption): unknown { + toJSON(message: RequestInitChain): unknown { const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.consensusParams !== undefined + && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.appStateBytes !== undefined + && (obj.appStateBytes = base64FromBytes( + message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), + )); + message.initialHeight !== undefined && (obj.initialHeight = Math.round(message.initialHeight)); return obj; }, - fromPartial(object: DeepPartial): RequestSetOption { - const message = { ...baseRequestSetOption } as RequestSetOption; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = ""; - } + fromPartial, I>>(object: I): RequestInitChain { + const message = createBaseRequestInitChain(); + message.time = object.time ?? undefined; + message.chainId = object.chainId ?? ""; + message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined; + message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.appStateBytes = object.appStateBytes ?? new Uint8Array(); + message.initialHeight = object.initialHeight ?? 0; return message; }, }; -const baseRequestInitChain: object = { chain_id: "", initial_height: 0 }; +function createBaseRequestQuery(): RequestQuery { + return { data: new Uint8Array(), path: "", height: 0, prove: false }; +} -export const RequestInitChain = { - encode(message: RequestInitChain, writer: Writer = Writer.create()): Writer { - if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(10).fork() - ).ldelim(); - } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); - } - if (message.consensus_params !== undefined) { - ConsensusParams.encode( - message.consensus_params, - writer.uint32(26).fork() - ).ldelim(); +export const RequestQuery = { + encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); } - for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + if (message.path !== "") { + writer.uint32(18).string(message.path); } - if (message.app_state_bytes.length !== 0) { - writer.uint32(42).bytes(message.app_state_bytes); + if (message.height !== 0) { + writer.uint32(24).int64(message.height); } - if (message.initial_height !== 0) { - writer.uint32(48).int64(message.initial_height); + if (message.prove === true) { + writer.uint32(32).bool(message.prove); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestInitChain { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; + const message = createBaseRequestQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.data = reader.bytes(); break; case 2: - message.chain_id = reader.string(); + message.path = reader.string(); break; case 3: - message.consensus_params = ConsensusParams.decode( - reader, - reader.uint32() - ); + message.height = longToNumber(reader.int64() as Long); break; case 4: - message.validators.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); - break; - case 5: - message.app_state_bytes = reader.bytes(); - break; - case 6: - message.initial_height = longToNumber(reader.int64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): RequestInitChain { - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromJSON( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromJSON(e)); - } - } - if ( - object.app_state_bytes !== undefined && - object.app_state_bytes !== null - ) { - message.app_state_bytes = bytesFromBase64(object.app_state_bytes); - } - if (object.initial_height !== undefined && object.initial_height !== null) { - message.initial_height = Number(object.initial_height); - } else { - message.initial_height = 0; - } - return message; - }, - - toJSON(message: RequestInitChain): unknown { - const obj: any = {}; - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.consensus_params !== undefined && - (obj.consensus_params = message.consensus_params - ? ConsensusParams.toJSON(message.consensus_params) - : undefined); - if (message.validators) { - obj.validators = message.validators.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); - } else { - obj.validators = []; - } - message.app_state_bytes !== undefined && - (obj.app_state_bytes = base64FromBytes( - message.app_state_bytes !== undefined - ? message.app_state_bytes - : new Uint8Array() - )); - message.initial_height !== undefined && - (obj.initial_height = message.initial_height); - return obj; - }, - - fromPartial(object: DeepPartial): RequestInitChain { - const message = { ...baseRequestInitChain } as RequestInitChain; - message.validators = []; - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromPartial( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromPartial(e)); - } - } - if ( - object.app_state_bytes !== undefined && - object.app_state_bytes !== null - ) { - message.app_state_bytes = object.app_state_bytes; - } else { - message.app_state_bytes = new Uint8Array(); - } - if (object.initial_height !== undefined && object.initial_height !== null) { - message.initial_height = object.initial_height; - } else { - message.initial_height = 0; - } - return message; - }, -}; - -const baseRequestQuery: object = { path: "", height: 0, prove: false }; - -export const RequestQuery = { - encode(message: RequestQuery, writer: Writer = Writer.create()): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - if (message.height !== 0) { - writer.uint32(24).int64(message.height); - } - if (message.prove === true) { - writer.uint32(32).bool(message.prove); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): RequestQuery { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestQuery } as RequestQuery; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - case 2: - message.path = reader.string(); - break; - case 3: - message.height = longToNumber(reader.int64() as Long); - break; - case 4: - message.prove = reader.bool(); + message.prove = reader.bool(); break; default: reader.skipType(tag & 7); @@ -1447,93 +1200,59 @@ export const RequestQuery = { }, fromJSON(object: any): RequestQuery { - const message = { ...baseRequestQuery } as RequestQuery; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.prove !== undefined && object.prove !== null) { - message.prove = Boolean(object.prove); - } else { - message.prove = false; - } - return message; + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + path: isSet(object.path) ? String(object.path) : "", + height: isSet(object.height) ? Number(object.height) : 0, + prove: isSet(object.prove) ? Boolean(object.prove) : false, + }; }, toJSON(message: RequestQuery): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); message.prove !== undefined && (obj.prove = message.prove); return obj; }, - fromPartial(object: DeepPartial): RequestQuery { - const message = { ...baseRequestQuery } as RequestQuery; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.prove !== undefined && object.prove !== null) { - message.prove = object.prove; - } else { - message.prove = false; - } + fromPartial, I>>(object: I): RequestQuery { + const message = createBaseRequestQuery(); + message.data = object.data ?? new Uint8Array(); + message.path = object.path ?? ""; + message.height = object.height ?? 0; + message.prove = object.prove ?? false; return message; }, }; -const baseRequestBeginBlock: object = {}; +function createBaseRequestBeginBlock(): RequestBeginBlock { + return { hash: new Uint8Array(), header: undefined, lastCommitInfo: undefined, byzantineValidators: [] }; +} export const RequestBeginBlock = { - encode(message: RequestBeginBlock, writer: Writer = Writer.create()): Writer { + encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(18).fork()).ldelim(); } - if (message.last_commit_info !== undefined) { - LastCommitInfo.encode( - message.last_commit_info, - writer.uint32(26).fork() - ).ldelim(); + if (message.lastCommitInfo !== undefined) { + CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); } - for (const v of message.byzantine_validators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + for (const v of message.byzantineValidators) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestBeginBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; + const message = createBaseRequestBeginBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1544,15 +1263,10 @@ export const RequestBeginBlock = { message.header = Header.decode(reader, reader.uint32()); break; case 3: - message.last_commit_info = LastCommitInfo.decode( - reader, - reader.uint32() - ); + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()); break; case 4: - message.byzantine_validators.push( - Evidence.decode(reader, reader.uint32()) - ); + message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1563,98 +1277,51 @@ export const RequestBeginBlock = { }, fromJSON(object: any): RequestBeginBlock { - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if ( - object.last_commit_info !== undefined && - object.last_commit_info !== null - ) { - message.last_commit_info = LastCommitInfo.fromJSON( - object.last_commit_info - ); - } else { - message.last_commit_info = undefined; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Evidence.fromJSON(e)); - } - } - return message; + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + lastCommitInfo: isSet(object.lastCommitInfo) ? CommitInfo.fromJSON(object.lastCommitInfo) : undefined, + byzantineValidators: Array.isArray(object?.byzantineValidators) + ? object.byzantineValidators.map((e: any) => Misbehavior.fromJSON(e)) + : [], + }; }, toJSON(message: RequestBeginBlock): unknown { const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.last_commit_info !== undefined && - (obj.last_commit_info = message.last_commit_info - ? LastCommitInfo.toJSON(message.last_commit_info) - : undefined); - if (message.byzantine_validators) { - obj.byzantine_validators = message.byzantine_validators.map((e) => - e ? Evidence.toJSON(e) : undefined - ); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.lastCommitInfo !== undefined + && (obj.lastCommitInfo = message.lastCommitInfo ? CommitInfo.toJSON(message.lastCommitInfo) : undefined); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Misbehavior.toJSON(e) : undefined); } else { - obj.byzantine_validators = []; + obj.byzantineValidators = []; } return obj; }, - fromPartial(object: DeepPartial): RequestBeginBlock { - const message = { ...baseRequestBeginBlock } as RequestBeginBlock; - message.byzantine_validators = []; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if ( - object.last_commit_info !== undefined && - object.last_commit_info !== null - ) { - message.last_commit_info = LastCommitInfo.fromPartial( - object.last_commit_info - ); - } else { - message.last_commit_info = undefined; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Evidence.fromPartial(e)); - } - } + fromPartial, I>>(object: I): RequestBeginBlock { + const message = createBaseRequestBeginBlock(); + message.hash = object.hash ?? new Uint8Array(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.lastCommitInfo = (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) + ? CommitInfo.fromPartial(object.lastCommitInfo) + : undefined; + message.byzantineValidators = object.byzantineValidators?.map((e) => Misbehavior.fromPartial(e)) || []; return message; }, }; -const baseRequestCheckTx: object = { type: 0 }; +function createBaseRequestCheckTx(): RequestCheckTx { + return { tx: new Uint8Array(), type: 0 }; +} export const RequestCheckTx = { - encode(message: RequestCheckTx, writer: Writer = Writer.create()): Writer { + encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } @@ -1664,10 +1331,10 @@ export const RequestCheckTx = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestCheckTx } as RequestCheckTx; + const message = createBaseRequestCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1686,58 +1353,43 @@ export const RequestCheckTx = { }, fromJSON(object: any): RequestCheckTx { - const message = { ...baseRequestCheckTx } as RequestCheckTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.type !== undefined && object.type !== null) { - message.type = checkTxTypeFromJSON(object.type); - } else { - message.type = 0; - } - return message; + return { + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0, + }; }, toJSON(message: RequestCheckTx): unknown { const obj: any = {}; - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); return obj; }, - fromPartial(object: DeepPartial): RequestCheckTx { - const message = { ...baseRequestCheckTx } as RequestCheckTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } + fromPartial, I>>(object: I): RequestCheckTx { + const message = createBaseRequestCheckTx(); + message.tx = object.tx ?? new Uint8Array(); + message.type = object.type ?? 0; return message; }, }; -const baseRequestDeliverTx: object = {}; +function createBaseRequestDeliverTx(): RequestDeliverTx { + return { tx: new Uint8Array() }; +} export const RequestDeliverTx = { - encode(message: RequestDeliverTx, writer: Writer = Writer.create()): Writer { + encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + const message = createBaseRequestDeliverTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1753,47 +1405,38 @@ export const RequestDeliverTx = { }, fromJSON(object: any): RequestDeliverTx { - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - return message; + return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array() }; }, toJSON(message: RequestDeliverTx): unknown { const obj: any = {}; - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): RequestDeliverTx { - const message = { ...baseRequestDeliverTx } as RequestDeliverTx; - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } + fromPartial, I>>(object: I): RequestDeliverTx { + const message = createBaseRequestDeliverTx(); + message.tx = object.tx ?? new Uint8Array(); return message; }, }; -const baseRequestEndBlock: object = { height: 0 }; +function createBaseRequestEndBlock(): RequestEndBlock { + return { height: 0 }; +} export const RequestEndBlock = { - encode(message: RequestEndBlock, writer: Writer = Writer.create()): Writer { + encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestEndBlock } as RequestEndBlock; + const message = createBaseRequestEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1809,43 +1452,35 @@ export const RequestEndBlock = { }, fromJSON(object: any): RequestEndBlock { - const message = { ...baseRequestEndBlock } as RequestEndBlock; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; + return { height: isSet(object.height) ? Number(object.height) : 0 }; }, toJSON(message: RequestEndBlock): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial(object: DeepPartial): RequestEndBlock { - const message = { ...baseRequestEndBlock } as RequestEndBlock; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } + fromPartial, I>>(object: I): RequestEndBlock { + const message = createBaseRequestEndBlock(); + message.height = object.height ?? 0; return message; }, }; -const baseRequestCommit: object = {}; +function createBaseRequestCommit(): RequestCommit { + return {}; +} export const RequestCommit = { - encode(_: RequestCommit, writer: Writer = Writer.create()): Writer { + encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestCommit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestCommit } as RequestCommit; + const message = createBaseRequestCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1858,8 +1493,7 @@ export const RequestCommit = { }, fromJSON(_: any): RequestCommit { - const message = { ...baseRequestCommit } as RequestCommit; - return message; + return {}; }, toJSON(_: RequestCommit): unknown { @@ -1867,23 +1501,25 @@ export const RequestCommit = { return obj; }, - fromPartial(_: DeepPartial): RequestCommit { - const message = { ...baseRequestCommit } as RequestCommit; + fromPartial, I>>(_: I): RequestCommit { + const message = createBaseRequestCommit(); return message; }, }; -const baseRequestListSnapshots: object = {}; +function createBaseRequestListSnapshots(): RequestListSnapshots { + return {}; +} export const RequestListSnapshots = { - encode(_: RequestListSnapshots, writer: Writer = Writer.create()): Writer { + encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestListSnapshots { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; + const message = createBaseRequestListSnapshots(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1896,8 +1532,7 @@ export const RequestListSnapshots = { }, fromJSON(_: any): RequestListSnapshots { - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; - return message; + return {}; }, toJSON(_: RequestListSnapshots): unknown { @@ -1905,32 +1540,31 @@ export const RequestListSnapshots = { return obj; }, - fromPartial(_: DeepPartial): RequestListSnapshots { - const message = { ...baseRequestListSnapshots } as RequestListSnapshots; + fromPartial, I>>(_: I): RequestListSnapshots { + const message = createBaseRequestListSnapshots(); return message; }, }; -const baseRequestOfferSnapshot: object = {}; +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { snapshot: undefined, appHash: new Uint8Array() }; +} export const RequestOfferSnapshot = { - encode( - message: RequestOfferSnapshot, - writer: Writer = Writer.create() - ): Writer { + encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.snapshot !== undefined) { Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); } - if (message.app_hash.length !== 0) { - writer.uint32(18).bytes(message.app_hash); + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): RequestOfferSnapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + const message = createBaseRequestOfferSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1938,7 +1572,7 @@ export const RequestOfferSnapshot = { message.snapshot = Snapshot.decode(reader, reader.uint32()); break; case 2: - message.app_hash = reader.bytes(); + message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1949,54 +1583,36 @@ export const RequestOfferSnapshot = { }, fromJSON(object: any): RequestOfferSnapshot { - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; - if (object.snapshot !== undefined && object.snapshot !== null) { - message.snapshot = Snapshot.fromJSON(object.snapshot); - } else { - message.snapshot = undefined; - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - return message; + return { + snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined, + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + }; }, toJSON(message: RequestOfferSnapshot): unknown { const obj: any = {}; - message.snapshot !== undefined && - (obj.snapshot = message.snapshot - ? Snapshot.toJSON(message.snapshot) - : undefined); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); + message.snapshot !== undefined && (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined); + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): RequestOfferSnapshot { - const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; - if (object.snapshot !== undefined && object.snapshot !== null) { - message.snapshot = Snapshot.fromPartial(object.snapshot); - } else { - message.snapshot = undefined; - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } + fromPartial, I>>(object: I): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot(); + message.snapshot = (object.snapshot !== undefined && object.snapshot !== null) + ? Snapshot.fromPartial(object.snapshot) + : undefined; + message.appHash = object.appHash ?? new Uint8Array(); return message; }, }; -const baseRequestLoadSnapshotChunk: object = { height: 0, format: 0, chunk: 0 }; +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { height: 0, format: 0, chunk: 0 }; +} export const RequestLoadSnapshotChunk = { - encode( - message: RequestLoadSnapshotChunk, - writer: Writer = Writer.create() - ): Writer { + encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).uint64(message.height); } @@ -2009,15 +1625,10 @@ export const RequestLoadSnapshotChunk = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): RequestLoadSnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; + const message = createBaseRequestLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2039,67 +1650,36 @@ export const RequestLoadSnapshotChunk = { }, fromJSON(object: any): RequestLoadSnapshotChunk { - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = Number(object.format); - } else { - message.format = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = Number(object.chunk); - } else { - message.chunk = 0; - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + format: isSet(object.format) ? Number(object.format) : 0, + chunk: isSet(object.chunk) ? Number(object.chunk) : 0, + }; }, toJSON(message: RequestLoadSnapshotChunk): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.format !== undefined && (obj.format = message.format); - message.chunk !== undefined && (obj.chunk = message.chunk); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.format !== undefined && (obj.format = Math.round(message.format)); + message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); return obj; }, - fromPartial( - object: DeepPartial - ): RequestLoadSnapshotChunk { - const message = { - ...baseRequestLoadSnapshotChunk, - } as RequestLoadSnapshotChunk; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } else { - message.format = 0; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = 0; - } + fromPartial, I>>(object: I): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk(); + message.height = object.height ?? 0; + message.format = object.format ?? 0; + message.chunk = object.chunk ?? 0; return message; }, }; -const baseRequestApplySnapshotChunk: object = { index: 0, sender: "" }; +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { index: 0, chunk: new Uint8Array(), sender: "" }; +} export const RequestApplySnapshotChunk = { - encode( - message: RequestApplySnapshotChunk, - writer: Writer = Writer.create() - ): Writer { + encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -2112,15 +1692,10 @@ export const RequestApplySnapshotChunk = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): RequestApplySnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; + const message = createBaseRequestApplySnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2142,70 +1717,345 @@ export const RequestApplySnapshotChunk = { }, fromJSON(object: any): RequestApplySnapshotChunk { - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; + return { + index: isSet(object.index) ? Number(object.index) : 0, + chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(), + sender: isSet(object.sender) ? String(object.sender) : "", + }; + }, + + toJSON(message: RequestApplySnapshotChunk): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = Math.round(message.index)); + message.chunk !== undefined + && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, + + fromPartial, I>>(object: I): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk(); + message.index = object.index ?? 0; + message.chunk = object.chunk ?? new Uint8Array(); + message.sender = object.sender ?? ""; + return message; + }, +}; + +function createBaseRequestPrepareProposal(): RequestPrepareProposal { + return { + maxTxBytes: 0, + txs: [], + localLastCommit: undefined, + misbehavior: [], + height: 0, + time: undefined, + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} + +export const RequestPrepareProposal = { + encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxTxBytes !== 0) { + writer.uint32(8).int64(message.maxTxBytes); } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); + for (const v of message.txs) { + writer.uint32(18).bytes(v!); } - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = longToNumber(reader.int64() as Long); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 5: + message.height = longToNumber(reader.int64() as Long); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: RequestApplySnapshotChunk): unknown { + fromJSON(object: any): RequestPrepareProposal { + return { + maxTxBytes: isSet(object.maxTxBytes) ? Number(object.maxTxBytes) : 0, + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + localLastCommit: isSet(object.localLastCommit) ? ExtendedCommitInfo.fromJSON(object.localLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) + ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) + : [], + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; + }, + + toJSON(message: RequestPrepareProposal): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.chunk !== undefined && - (obj.chunk = base64FromBytes( - message.chunk !== undefined ? message.chunk : new Uint8Array() + message.maxTxBytes !== undefined && (obj.maxTxBytes = Math.round(message.maxTxBytes)); + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.localLastCommit !== undefined + && (obj.localLastCommit = message.localLastCommit + ? ExtendedCommitInfo.toJSON(message.localLastCommit) + : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), )); - message.sender !== undefined && (obj.sender = message.sender); return obj; }, - fromPartial( - object: DeepPartial - ): RequestApplySnapshotChunk { - const message = { - ...baseRequestApplySnapshotChunk, - } as RequestApplySnapshotChunk; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; + fromPartial, I>>(object: I): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes ?? 0; + message.txs = object.txs?.map((e) => e) || []; + message.localLastCommit = (object.localLastCommit !== undefined && object.localLastCommit !== null) + ? ExtendedCommitInfo.fromPartial(object.localLastCommit) + : undefined; + message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, +}; + +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: undefined, + misbehavior: [], + hash: new Uint8Array(), + height: 0, + time: undefined, + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} + +export const RequestProcessProposal = { + encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = new Uint8Array(); + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); } - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== 0) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = longToNumber(reader.int64() as Long); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): RequestProcessProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + proposedLastCommit: isSet(object.proposedLastCommit) ? CommitInfo.fromJSON(object.proposedLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) + ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) + : [], + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; + }, + + toJSON(message: RequestProcessProposal): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.proposedLastCommit !== undefined && (obj.proposedLastCommit = message.proposedLastCommit + ? CommitInfo.toJSON(message.proposedLastCommit) + : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map((e) => e) || []; + message.proposedLastCommit = (object.proposedLastCommit !== undefined && object.proposedLastCommit !== null) + ? CommitInfo.fromPartial(object.proposedLastCommit) + : undefined; + message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, }; -const baseResponse: object = {}; +function createBaseResponse(): Response { + return { + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + }; +} export const Response = { - encode(message: Response, writer: Writer = Writer.create()): Writer { + encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.exception !== undefined) { - ResponseException.encode( - message.exception, - writer.uint32(10).fork() - ).ldelim(); + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } if (message.echo !== undefined) { ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); @@ -2216,79 +2066,52 @@ export const Response = { if (message.info !== undefined) { ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); } - if (message.set_option !== undefined) { - ResponseSetOption.encode( - message.set_option, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.init_chain !== undefined) { - ResponseInitChain.encode( - message.init_chain, - writer.uint32(50).fork() - ).ldelim(); + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); } if (message.query !== undefined) { ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); } - if (message.begin_block !== undefined) { - ResponseBeginBlock.encode( - message.begin_block, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.check_tx !== undefined) { - ResponseCheckTx.encode( - message.check_tx, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.deliver_tx !== undefined) { - ResponseDeliverTx.encode( - message.deliver_tx, - writer.uint32(82).fork() - ).ldelim(); - } - if (message.end_block !== undefined) { - ResponseEndBlock.encode( - message.end_block, - writer.uint32(90).fork() - ).ldelim(); + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); } if (message.commit !== undefined) { ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); } - if (message.list_snapshots !== undefined) { - ResponseListSnapshots.encode( - message.list_snapshots, - writer.uint32(106).fork() - ).ldelim(); - } - if (message.offer_snapshot !== undefined) { - ResponseOfferSnapshot.encode( - message.offer_snapshot, - writer.uint32(114).fork() - ).ldelim(); - } - if (message.load_snapshot_chunk !== undefined) { - ResponseLoadSnapshotChunk.encode( - message.load_snapshot_chunk, - writer.uint32(122).fork() - ).ldelim(); - } - if (message.apply_snapshot_chunk !== undefined) { - ResponseApplySnapshotChunk.encode( - message.apply_snapshot_chunk, - writer.uint32(130).fork() - ).ldelim(); + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + if (message.prepareProposal !== undefined) { + ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Response { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Response { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponse } as Response; + const message = createBaseResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2304,65 +2127,44 @@ export const Response = { case 4: message.info = ResponseInfo.decode(reader, reader.uint32()); break; - case 5: - message.set_option = ResponseSetOption.decode( - reader, - reader.uint32() - ); - break; case 6: - message.init_chain = ResponseInitChain.decode( - reader, - reader.uint32() - ); + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); break; case 7: message.query = ResponseQuery.decode(reader, reader.uint32()); break; case 8: - message.begin_block = ResponseBeginBlock.decode( - reader, - reader.uint32() - ); + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); break; case 9: - message.check_tx = ResponseCheckTx.decode(reader, reader.uint32()); + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); break; case 10: - message.deliver_tx = ResponseDeliverTx.decode( - reader, - reader.uint32() - ); + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); break; case 11: - message.end_block = ResponseEndBlock.decode(reader, reader.uint32()); + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); break; case 12: message.commit = ResponseCommit.decode(reader, reader.uint32()); break; case 13: - message.list_snapshots = ResponseListSnapshots.decode( - reader, - reader.uint32() - ); + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); break; case 14: - message.offer_snapshot = ResponseOfferSnapshot.decode( - reader, - reader.uint32() - ); + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); break; case 15: - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.decode( - reader, - reader.uint32() - ); + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); break; case 16: - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.decode( - reader, - reader.uint32() - ); + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2373,283 +2175,146 @@ export const Response = { }, fromJSON(object: any): Response { - const message = { ...baseResponse } as Response; - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromJSON(object.exception); - } else { - message.exception = undefined; - } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromJSON(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromJSON(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromJSON(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = ResponseSetOption.fromJSON(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = ResponseInitChain.fromJSON(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromJSON(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = ResponseBeginBlock.fromJSON(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = ResponseCheckTx.fromJSON(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = ResponseDeliverTx.fromJSON(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = ResponseEndBlock.fromJSON(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = ResponseListSnapshots.fromJSON( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = ResponseOfferSnapshot.fromJSON( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.fromJSON( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.fromJSON( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } - return message; + return { + exception: isSet(object.exception) ? ResponseException.fromJSON(object.exception) : undefined, + echo: isSet(object.echo) ? ResponseEcho.fromJSON(object.echo) : undefined, + flush: isSet(object.flush) ? ResponseFlush.fromJSON(object.flush) : undefined, + info: isSet(object.info) ? ResponseInfo.fromJSON(object.info) : undefined, + initChain: isSet(object.initChain) ? ResponseInitChain.fromJSON(object.initChain) : undefined, + query: isSet(object.query) ? ResponseQuery.fromJSON(object.query) : undefined, + beginBlock: isSet(object.beginBlock) ? ResponseBeginBlock.fromJSON(object.beginBlock) : undefined, + checkTx: isSet(object.checkTx) ? ResponseCheckTx.fromJSON(object.checkTx) : undefined, + deliverTx: isSet(object.deliverTx) ? ResponseDeliverTx.fromJSON(object.deliverTx) : undefined, + endBlock: isSet(object.endBlock) ? ResponseEndBlock.fromJSON(object.endBlock) : undefined, + commit: isSet(object.commit) ? ResponseCommit.fromJSON(object.commit) : undefined, + listSnapshots: isSet(object.listSnapshots) ? ResponseListSnapshots.fromJSON(object.listSnapshots) : undefined, + offerSnapshot: isSet(object.offerSnapshot) ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) : undefined, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) + ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) + : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) + ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk) + : undefined, + prepareProposal: isSet(object.prepareProposal) + ? ResponsePrepareProposal.fromJSON(object.prepareProposal) + : undefined, + processProposal: isSet(object.processProposal) + ? ResponseProcessProposal.fromJSON(object.processProposal) + : undefined, + }; }, toJSON(message: Response): unknown { const obj: any = {}; - message.exception !== undefined && - (obj.exception = message.exception - ? ResponseException.toJSON(message.exception) - : undefined); - message.echo !== undefined && - (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); - message.flush !== undefined && - (obj.flush = message.flush - ? ResponseFlush.toJSON(message.flush) - : undefined); - message.info !== undefined && - (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); - message.set_option !== undefined && - (obj.set_option = message.set_option - ? ResponseSetOption.toJSON(message.set_option) - : undefined); - message.init_chain !== undefined && - (obj.init_chain = message.init_chain - ? ResponseInitChain.toJSON(message.init_chain) - : undefined); - message.query !== undefined && - (obj.query = message.query - ? ResponseQuery.toJSON(message.query) - : undefined); - message.begin_block !== undefined && - (obj.begin_block = message.begin_block - ? ResponseBeginBlock.toJSON(message.begin_block) - : undefined); - message.check_tx !== undefined && - (obj.check_tx = message.check_tx - ? ResponseCheckTx.toJSON(message.check_tx) - : undefined); - message.deliver_tx !== undefined && - (obj.deliver_tx = message.deliver_tx - ? ResponseDeliverTx.toJSON(message.deliver_tx) - : undefined); - message.end_block !== undefined && - (obj.end_block = message.end_block - ? ResponseEndBlock.toJSON(message.end_block) - : undefined); - message.commit !== undefined && - (obj.commit = message.commit - ? ResponseCommit.toJSON(message.commit) - : undefined); - message.list_snapshots !== undefined && - (obj.list_snapshots = message.list_snapshots - ? ResponseListSnapshots.toJSON(message.list_snapshots) - : undefined); - message.offer_snapshot !== undefined && - (obj.offer_snapshot = message.offer_snapshot - ? ResponseOfferSnapshot.toJSON(message.offer_snapshot) - : undefined); - message.load_snapshot_chunk !== undefined && - (obj.load_snapshot_chunk = message.load_snapshot_chunk - ? ResponseLoadSnapshotChunk.toJSON(message.load_snapshot_chunk) - : undefined); - message.apply_snapshot_chunk !== undefined && - (obj.apply_snapshot_chunk = message.apply_snapshot_chunk - ? ResponseApplySnapshotChunk.toJSON(message.apply_snapshot_chunk) - : undefined); + message.exception !== undefined + && (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined); + message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); + message.initChain !== undefined + && (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined + && (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined + && (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined + && (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined + && (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined + && (obj.listSnapshots = message.listSnapshots ? ResponseListSnapshots.toJSON(message.listSnapshots) : undefined); + message.offerSnapshot !== undefined + && (obj.offerSnapshot = message.offerSnapshot ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) : undefined); + message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk + ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal + ? ResponsePrepareProposal.toJSON(message.prepareProposal) + : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal + ? ResponseProcessProposal.toJSON(message.processProposal) + : undefined); return obj; }, - fromPartial(object: DeepPartial): Response { - const message = { ...baseResponse } as Response; - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromPartial(object.exception); - } else { - message.exception = undefined; - } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromPartial(object.echo); - } else { - message.echo = undefined; - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromPartial(object.flush); - } else { - message.flush = undefined; - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromPartial(object.info); - } else { - message.info = undefined; - } - if (object.set_option !== undefined && object.set_option !== null) { - message.set_option = ResponseSetOption.fromPartial(object.set_option); - } else { - message.set_option = undefined; - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.init_chain = ResponseInitChain.fromPartial(object.init_chain); - } else { - message.init_chain = undefined; - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromPartial(object.query); - } else { - message.query = undefined; - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.begin_block = ResponseBeginBlock.fromPartial(object.begin_block); - } else { - message.begin_block = undefined; - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.check_tx = ResponseCheckTx.fromPartial(object.check_tx); - } else { - message.check_tx = undefined; - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliver_tx = ResponseDeliverTx.fromPartial(object.deliver_tx); - } else { - message.deliver_tx = undefined; - } - if (object.end_block !== undefined && object.end_block !== null) { - message.end_block = ResponseEndBlock.fromPartial(object.end_block); - } else { - message.end_block = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromPartial(object.commit); - } else { - message.commit = undefined; - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.list_snapshots = ResponseListSnapshots.fromPartial( - object.list_snapshots - ); - } else { - message.list_snapshots = undefined; - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offer_snapshot = ResponseOfferSnapshot.fromPartial( - object.offer_snapshot - ); - } else { - message.offer_snapshot = undefined; - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.load_snapshot_chunk = ResponseLoadSnapshotChunk.fromPartial( - object.load_snapshot_chunk - ); - } else { - message.load_snapshot_chunk = undefined; - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.apply_snapshot_chunk = ResponseApplySnapshotChunk.fromPartial( - object.apply_snapshot_chunk - ); - } else { - message.apply_snapshot_chunk = undefined; - } + fromPartial, I>>(object: I): Response { + const message = createBaseResponse(); + message.exception = (object.exception !== undefined && object.exception !== null) + ? ResponseException.fromPartial(object.exception) + : undefined; + message.echo = (object.echo !== undefined && object.echo !== null) + ? ResponseEcho.fromPartial(object.echo) + : undefined; + message.flush = (object.flush !== undefined && object.flush !== null) + ? ResponseFlush.fromPartial(object.flush) + : undefined; + message.info = (object.info !== undefined && object.info !== null) + ? ResponseInfo.fromPartial(object.info) + : undefined; + message.initChain = (object.initChain !== undefined && object.initChain !== null) + ? ResponseInitChain.fromPartial(object.initChain) + : undefined; + message.query = (object.query !== undefined && object.query !== null) + ? ResponseQuery.fromPartial(object.query) + : undefined; + message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null) + ? ResponseBeginBlock.fromPartial(object.beginBlock) + : undefined; + message.checkTx = (object.checkTx !== undefined && object.checkTx !== null) + ? ResponseCheckTx.fromPartial(object.checkTx) + : undefined; + message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null) + ? ResponseDeliverTx.fromPartial(object.deliverTx) + : undefined; + message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) + ? ResponseEndBlock.fromPartial(object.endBlock) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? ResponseCommit.fromPartial(object.commit) + : undefined; + message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null) + ? ResponseListSnapshots.fromPartial(object.listSnapshots) + : undefined; + message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null) + ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined; + message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) + ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined; + message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) + ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined; + message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null) + ? ResponsePrepareProposal.fromPartial(object.prepareProposal) + : undefined; + message.processProposal = (object.processProposal !== undefined && object.processProposal !== null) + ? ResponseProcessProposal.fromPartial(object.processProposal) + : undefined; return message; }, }; -const baseResponseException: object = { error: "" }; +function createBaseResponseException(): ResponseException { + return { error: "" }; +} export const ResponseException = { - encode(message: ResponseException, writer: Writer = Writer.create()): Writer { + encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.error !== "") { writer.uint32(10).string(message.error); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseException { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseException } as ResponseException; + const message = createBaseResponseException(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2665,13 +2330,7 @@ export const ResponseException = { }, fromJSON(object: any): ResponseException { - const message = { ...baseResponseException } as ResponseException; - if (object.error !== undefined && object.error !== null) { - message.error = String(object.error); - } else { - message.error = ""; - } - return message; + return { error: isSet(object.error) ? String(object.error) : "" }; }, toJSON(message: ResponseException): unknown { @@ -2680,31 +2339,29 @@ export const ResponseException = { return obj; }, - fromPartial(object: DeepPartial): ResponseException { - const message = { ...baseResponseException } as ResponseException; - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } else { - message.error = ""; - } + fromPartial, I>>(object: I): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; return message; }, }; -const baseResponseEcho: object = { message: "" }; +function createBaseResponseEcho(): ResponseEcho { + return { message: "" }; +} export const ResponseEcho = { - encode(message: ResponseEcho, writer: Writer = Writer.create()): Writer { + encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseEcho { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseEcho } as ResponseEcho; + const message = createBaseResponseEcho(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2720,13 +2377,7 @@ export const ResponseEcho = { }, fromJSON(object: any): ResponseEcho { - const message = { ...baseResponseEcho } as ResponseEcho; - if (object.message !== undefined && object.message !== null) { - message.message = String(object.message); - } else { - message.message = ""; - } - return message; + return { message: isSet(object.message) ? String(object.message) : "" }; }, toJSON(message: ResponseEcho): unknown { @@ -2735,28 +2386,26 @@ export const ResponseEcho = { return obj; }, - fromPartial(object: DeepPartial): ResponseEcho { - const message = { ...baseResponseEcho } as ResponseEcho; - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } else { - message.message = ""; - } + fromPartial, I>>(object: I): ResponseEcho { + const message = createBaseResponseEcho(); + message.message = object.message ?? ""; return message; }, }; -const baseResponseFlush: object = {}; +function createBaseResponseFlush(): ResponseFlush { + return {}; +} export const ResponseFlush = { - encode(_: ResponseFlush, writer: Writer = Writer.create()): Writer { + encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseFlush { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseFlush } as ResponseFlush; + const message = createBaseResponseFlush(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2769,8 +2418,7 @@ export const ResponseFlush = { }, fromJSON(_: any): ResponseFlush { - const message = { ...baseResponseFlush } as ResponseFlush; - return message; + return {}; }, toJSON(_: ResponseFlush): unknown { @@ -2778,188 +2426,57 @@ export const ResponseFlush = { return obj; }, - fromPartial(_: DeepPartial): ResponseFlush { - const message = { ...baseResponseFlush } as ResponseFlush; + fromPartial, I>>(_: I): ResponseFlush { + const message = createBaseResponseFlush(); return message; }, }; -const baseResponseInfo: object = { - data: "", - version: "", - app_version: 0, - last_block_height: 0, -}; +function createBaseResponseInfo(): ResponseInfo { + return { data: "", version: "", appVersion: 0, lastBlockHeight: 0, lastBlockAppHash: new Uint8Array() }; +} export const ResponseInfo = { - encode(message: ResponseInfo, writer: Writer = Writer.create()): Writer { + encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data !== "") { writer.uint32(10).string(message.data); } if (message.version !== "") { writer.uint32(18).string(message.version); } - if (message.app_version !== 0) { - writer.uint32(24).uint64(message.app_version); - } - if (message.last_block_height !== 0) { - writer.uint32(32).int64(message.last_block_height); - } - if (message.last_block_app_hash.length !== 0) { - writer.uint32(42).bytes(message.last_block_app_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ResponseInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseInfo } as ResponseInfo; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - message.app_version = longToNumber(reader.uint64() as Long); - break; - case 4: - message.last_block_height = longToNumber(reader.int64() as Long); - break; - case 5: - message.last_block_app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ResponseInfo { - const message = { ...baseResponseInfo } as ResponseInfo; - if (object.data !== undefined && object.data !== null) { - message.data = String(object.data); - } else { - message.data = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = String(object.version); - } else { - message.version = ""; - } - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = Number(object.app_version); - } else { - message.app_version = 0; - } - if ( - object.last_block_height !== undefined && - object.last_block_height !== null - ) { - message.last_block_height = Number(object.last_block_height); - } else { - message.last_block_height = 0; - } - if ( - object.last_block_app_hash !== undefined && - object.last_block_app_hash !== null - ) { - message.last_block_app_hash = bytesFromBase64(object.last_block_app_hash); - } - return message; - }, - - toJSON(message: ResponseInfo): unknown { - const obj: any = {}; - message.data !== undefined && (obj.data = message.data); - message.version !== undefined && (obj.version = message.version); - message.app_version !== undefined && - (obj.app_version = message.app_version); - message.last_block_height !== undefined && - (obj.last_block_height = message.last_block_height); - message.last_block_app_hash !== undefined && - (obj.last_block_app_hash = base64FromBytes( - message.last_block_app_hash !== undefined - ? message.last_block_app_hash - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): ResponseInfo { - const message = { ...baseResponseInfo } as ResponseInfo; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = ""; - } - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = object.app_version; - } else { - message.app_version = 0; - } - if ( - object.last_block_height !== undefined && - object.last_block_height !== null - ) { - message.last_block_height = object.last_block_height; - } else { - message.last_block_height = 0; - } - if ( - object.last_block_app_hash !== undefined && - object.last_block_app_hash !== null - ) { - message.last_block_app_hash = object.last_block_app_hash; - } else { - message.last_block_app_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseResponseSetOption: object = { code: 0, log: "", info: "" }; - -export const ResponseSetOption = { - encode(message: ResponseSetOption, writer: Writer = Writer.create()): Writer { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); + if (message.appVersion !== 0) { + writer.uint32(24).uint64(message.appVersion); } - if (message.info !== "") { - writer.uint32(34).string(message.info); + if (message.lastBlockHeight !== 0) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseSetOption } as ResponseSetOption; + const message = createBaseResponseInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code = reader.uint32(); + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); break; case 3: - message.log = reader.string(); + message.appVersion = longToNumber(reader.uint64() as Long); break; case 4: - message.info = reader.string(); + message.lastBlockHeight = longToNumber(reader.int64() as Long); + break; + case 5: + message.lastBlockAppHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -2969,95 +2486,73 @@ export const ResponseSetOption = { return message; }, - fromJSON(object: any): ResponseSetOption { - const message = { ...baseResponseSetOption } as ResponseSetOption; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - return message; + fromJSON(object: any): ResponseInfo { + return { + data: isSet(object.data) ? String(object.data) : "", + version: isSet(object.version) ? String(object.version) : "", + appVersion: isSet(object.appVersion) ? Number(object.appVersion) : 0, + lastBlockHeight: isSet(object.lastBlockHeight) ? Number(object.lastBlockHeight) : 0, + lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array(), + }; }, - toJSON(message: ResponseSetOption): unknown { + toJSON(message: ResponseInfo): unknown { const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.log !== undefined && (obj.log = message.log); - message.info !== undefined && (obj.info = message.info); + message.data !== undefined && (obj.data = message.data); + message.version !== undefined && (obj.version = message.version); + message.appVersion !== undefined && (obj.appVersion = Math.round(message.appVersion)); + message.lastBlockHeight !== undefined && (obj.lastBlockHeight = Math.round(message.lastBlockHeight)); + message.lastBlockAppHash !== undefined + && (obj.lastBlockAppHash = base64FromBytes( + message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), + )); return obj; }, - fromPartial(object: DeepPartial): ResponseSetOption { - const message = { ...baseResponseSetOption } as ResponseSetOption; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } + fromPartial, I>>(object: I): ResponseInfo { + const message = createBaseResponseInfo(); + message.data = object.data ?? ""; + message.version = object.version ?? ""; + message.appVersion = object.appVersion ?? 0; + message.lastBlockHeight = object.lastBlockHeight ?? 0; + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; }, }; -const baseResponseInitChain: object = {}; +function createBaseResponseInitChain(): ResponseInitChain { + return { consensusParams: undefined, validators: [], appHash: new Uint8Array() }; +} export const ResponseInitChain = { - encode(message: ResponseInitChain, writer: Writer = Writer.create()): Writer { - if (message.consensus_params !== undefined) { - ConsensusParams.encode( - message.consensus_params, - writer.uint32(10).fork() - ).ldelim(); + encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); } for (const v of message.validators) { ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.app_hash.length !== 0) { - writer.uint32(26).bytes(message.app_hash); + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseInitChain { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; + const message = createBaseResponseInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.consensus_params = ConsensusParams.decode( - reader, - reader.uint32() - ); + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); break; case 2: - message.validators.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 3: - message.app_hash = reader.bytes(); + message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3068,87 +2563,56 @@ export const ResponseInitChain = { }, fromJSON(object: any): ResponseInitChain { - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromJSON( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromJSON(e)); - } - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - return message; + return { + consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined, + validators: Array.isArray(object?.validators) + ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + }; }, toJSON(message: ResponseInitChain): unknown { const obj: any = {}; - message.consensus_params !== undefined && - (obj.consensus_params = message.consensus_params - ? ConsensusParams.toJSON(message.consensus_params) - : undefined); + message.consensusParams !== undefined + && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined); if (message.validators) { - obj.validators = message.validators.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); } else { obj.validators = []; } - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() - )); + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): ResponseInitChain { - const message = { ...baseResponseInitChain } as ResponseInitChain; - message.validators = []; - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensus_params = ConsensusParams.fromPartial( - object.consensus_params - ); - } else { - message.consensus_params = undefined; - } - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(ValidatorUpdate.fromPartial(e)); - } - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } + fromPartial, I>>(object: I): ResponseInitChain { + const message = createBaseResponseInitChain(); + message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null) + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined; + message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.appHash = object.appHash ?? new Uint8Array(); return message; }, }; -const baseResponseQuery: object = { - code: 0, - log: "", - info: "", - index: 0, - height: 0, - codespace: "", -}; +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: "", + info: "", + index: 0, + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: 0, + codespace: "", + }; +} export const ResponseQuery = { - encode(message: ResponseQuery, writer: Writer = Writer.create()): Writer { + encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -3167,8 +2631,8 @@ export const ResponseQuery = { if (message.value.length !== 0) { writer.uint32(58).bytes(message.value); } - if (message.proof_ops !== undefined) { - ProofOps.encode(message.proof_ops, writer.uint32(66).fork()).ldelim(); + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } if (message.height !== 0) { writer.uint32(72).int64(message.height); @@ -3179,10 +2643,10 @@ export const ResponseQuery = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseQuery { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseQuery } as ResponseQuery; + const message = createBaseResponseQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3205,7 +2669,7 @@ export const ResponseQuery = { message.value = reader.bytes(); break; case 8: - message.proof_ops = ProofOps.decode(reader, reader.uint32()); + message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: message.height = longToNumber(reader.int64() as Long); @@ -3222,143 +2686,68 @@ export const ResponseQuery = { }, fromJSON(object: any): ResponseQuery { - const message = { ...baseResponseQuery } as ResponseQuery; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proof_ops = ProofOps.fromJSON(object.proof_ops); - } else { - message.proof_ops = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; + return { + code: isSet(object.code) ? Number(object.code) : 0, + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + index: isSet(object.index) ? Number(object.index) : 0, + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + codespace: isSet(object.codespace) ? String(object.codespace) : "", + }; }, toJSON(message: ResponseQuery): unknown { const obj: any = {}; - message.code !== undefined && (obj.code = message.code); + message.code !== undefined && (obj.code = Math.round(message.code)); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = message.index); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); - message.proof_ops !== undefined && - (obj.proof_ops = message.proof_ops - ? ProofOps.toJSON(message.proof_ops) - : undefined); - message.height !== undefined && (obj.height = message.height); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, - fromPartial(object: DeepPartial): ResponseQuery { - const message = { ...baseResponseQuery } as ResponseQuery; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proof_ops = ProofOps.fromPartial(object.proof_ops); - } else { - message.proof_ops = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } + fromPartial, I>>(object: I): ResponseQuery { + const message = createBaseResponseQuery(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.index = object.index ?? 0; + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = (object.proofOps !== undefined && object.proofOps !== null) + ? ProofOps.fromPartial(object.proofOps) + : undefined; + message.height = object.height ?? 0; + message.codespace = object.codespace ?? ""; return message; }, }; -const baseResponseBeginBlock: object = {}; +function createBaseResponseBeginBlock(): ResponseBeginBlock { + return { events: [] }; +} export const ResponseBeginBlock = { - encode( - message: ResponseBeginBlock, - writer: Writer = Writer.create() - ): Writer { + encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseBeginBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; + const message = createBaseResponseBeginBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3374,49 +2763,44 @@ export const ResponseBeginBlock = { }, fromJSON(object: any): ResponseBeginBlock { - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; + return { events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] }; }, toJSON(message: ResponseBeginBlock): unknown { const obj: any = {}; if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } return obj; }, - fromPartial(object: DeepPartial): ResponseBeginBlock { - const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; - message.events = []; - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ResponseBeginBlock { + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; return message; }, }; -const baseResponseCheckTx: object = { - code: 0, - log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - codespace: "", -}; +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: 0, + gasUsed: 0, + events: [], + codespace: "", + sender: "", + priority: 0, + mempoolError: "", + }; +} export const ResponseCheckTx = { - encode(message: ResponseCheckTx, writer: Writer = Writer.create()): Writer { + encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -3429,11 +2813,11 @@ export const ResponseCheckTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (message.gas_wanted !== 0) { - writer.uint32(40).int64(message.gas_wanted); + if (message.gasWanted !== 0) { + writer.uint32(40).int64(message.gasWanted); } - if (message.gas_used !== 0) { - writer.uint32(48).int64(message.gas_used); + if (message.gasUsed !== 0) { + writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { Event.encode(v!, writer.uint32(58).fork()).ldelim(); @@ -3441,14 +2825,22 @@ export const ResponseCheckTx = { if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.priority !== 0) { + writer.uint32(80).int64(message.priority); + } + if (message.mempoolError !== "") { + writer.uint32(90).string(message.mempoolError); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseCheckTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; + const message = createBaseResponseCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3465,10 +2857,10 @@ export const ResponseCheckTx = { message.info = reader.string(); break; case 5: - message.gas_wanted = longToNumber(reader.int64() as Long); + message.gasWanted = longToNumber(reader.int64() as Long); break; case 6: - message.gas_used = longToNumber(reader.int64() as Long); + message.gasUsed = longToNumber(reader.int64() as Long); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -3476,6 +2868,15 @@ export const ResponseCheckTx = { case 8: message.codespace = reader.string(); break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.priority = longToNumber(reader.int64() as Long); + break; + case 11: + message.mempoolError = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3485,127 +2886,65 @@ export const ResponseCheckTx = { }, fromJSON(object: any): ResponseCheckTx { - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; + return { + code: isSet(object.code) ? Number(object.code) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0, + gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + codespace: isSet(object.codespace) ? String(object.codespace) : "", + sender: isSet(object.sender) ? String(object.sender) : "", + priority: isSet(object.priority) ? Number(object.priority) : 0, + mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "", + }; }, toJSON(message: ResponseCheckTx): unknown { const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.code !== undefined && (obj.code = Math.round(message.code)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); + message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed)); if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } message.codespace !== undefined && (obj.codespace = message.codespace); + message.sender !== undefined && (obj.sender = message.sender); + message.priority !== undefined && (obj.priority = Math.round(message.priority)); + message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); return obj; }, - fromPartial(object: DeepPartial): ResponseCheckTx { - const message = { ...baseResponseCheckTx } as ResponseCheckTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } + fromPartial, I>>(object: I): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + message.sender = object.sender ?? ""; + message.priority = object.priority ?? 0; + message.mempoolError = object.mempoolError ?? ""; return message; }, }; -const baseResponseDeliverTx: object = { - code: 0, - log: "", - info: "", - gas_wanted: 0, - gas_used: 0, - codespace: "", -}; +function createBaseResponseDeliverTx(): ResponseDeliverTx { + return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: 0, gasUsed: 0, events: [], codespace: "" }; +} export const ResponseDeliverTx = { - encode(message: ResponseDeliverTx, writer: Writer = Writer.create()): Writer { + encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -3618,11 +2957,11 @@ export const ResponseDeliverTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (message.gas_wanted !== 0) { - writer.uint32(40).int64(message.gas_wanted); + if (message.gasWanted !== 0) { + writer.uint32(40).int64(message.gasWanted); } - if (message.gas_used !== 0) { - writer.uint32(48).int64(message.gas_used); + if (message.gasUsed !== 0) { + writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { Event.encode(v!, writer.uint32(58).fork()).ldelim(); @@ -3633,11 +2972,10 @@ export const ResponseDeliverTx = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseDeliverTx { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; + const message = createBaseResponseDeliverTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3654,10 +2992,10 @@ export const ResponseDeliverTx = { message.info = reader.string(); break; case 5: - message.gas_wanted = longToNumber(reader.int64() as Long); + message.gasWanted = longToNumber(reader.int64() as Long); break; case 6: - message.gas_used = longToNumber(reader.int64() as Long); + message.gasUsed = longToNumber(reader.int64() as Long); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -3674,62 +3012,29 @@ export const ResponseDeliverTx = { }, fromJSON(object: any): ResponseDeliverTx { - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = Number(object.code); - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = String(object.log); - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = Number(object.gas_wanted); - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = Number(object.gas_used); - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = String(object.codespace); - } else { - message.codespace = ""; - } - return message; + return { + code: isSet(object.code) ? Number(object.code) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0, + gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + codespace: isSet(object.codespace) ? String(object.codespace) : "", + }; }, toJSON(message: ResponseDeliverTx): unknown { const obj: any = {}; - message.code !== undefined && (obj.code = message.code); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.code !== undefined && (obj.code = Math.round(message.code)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gas_wanted !== undefined && (obj.gas_wanted = message.gas_wanted); - message.gas_used !== undefined && (obj.gas_used = message.gas_used); + message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted)); + message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed)); if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } @@ -3737,65 +3042,31 @@ export const ResponseDeliverTx = { return obj; }, - fromPartial(object: DeepPartial): ResponseDeliverTx { - const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; - message.events = []; - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } else { - message.code = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } else { - message.log = ""; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gas_wanted = object.gas_wanted; - } else { - message.gas_wanted = 0; - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gas_used = object.gas_used; - } else { - message.gas_used = 0; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } else { - message.codespace = ""; - } + fromPartial, I>>(object: I): ResponseDeliverTx { + const message = createBaseResponseDeliverTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted ?? 0; + message.gasUsed = object.gasUsed ?? 0; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; return message; }, }; -const baseResponseEndBlock: object = {}; +function createBaseResponseEndBlock(): ResponseEndBlock { + return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] }; +} export const ResponseEndBlock = { - encode(message: ResponseEndBlock, writer: Writer = Writer.create()): Writer { - for (const v of message.validator_updates) { + encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.consensus_param_updates !== undefined) { - ConsensusParams.encode( - message.consensus_param_updates, - writer.uint32(18).fork() - ).ldelim(); + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); } for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); @@ -3803,25 +3074,18 @@ export const ResponseEndBlock = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; + const message = createBaseResponseEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validator_updates.push( - ValidatorUpdate.decode(reader, reader.uint32()) - ); + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 2: - message.consensus_param_updates = ConsensusParams.decode( - reader, - reader.uint32() - ); + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); break; case 3: message.events.push(Event.decode(reader, reader.uint32())); @@ -3835,104 +3099,66 @@ export const ResponseEndBlock = { }, fromJSON(object: any): ResponseEndBlock { - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; - if ( - object.validator_updates !== undefined && - object.validator_updates !== null - ) { - for (const e of object.validator_updates) { - message.validator_updates.push(ValidatorUpdate.fromJSON(e)); - } - } - if ( - object.consensus_param_updates !== undefined && - object.consensus_param_updates !== null - ) { - message.consensus_param_updates = ConsensusParams.fromJSON( - object.consensus_param_updates - ); - } else { - message.consensus_param_updates = undefined; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromJSON(e)); - } - } - return message; + return { + validatorUpdates: Array.isArray(object?.validatorUpdates) + ? object.validatorUpdates.map((e: any) => ValidatorUpdate.fromJSON(e)) + : [], + consensusParamUpdates: isSet(object.consensusParamUpdates) + ? ConsensusParams.fromJSON(object.consensusParamUpdates) + : undefined, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [], + }; }, toJSON(message: ResponseEndBlock): unknown { const obj: any = {}; - if (message.validator_updates) { - obj.validator_updates = message.validator_updates.map((e) => - e ? ValidatorUpdate.toJSON(e) : undefined - ); + if (message.validatorUpdates) { + obj.validatorUpdates = message.validatorUpdates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined); } else { - obj.validator_updates = []; + obj.validatorUpdates = []; } - message.consensus_param_updates !== undefined && - (obj.consensus_param_updates = message.consensus_param_updates - ? ConsensusParams.toJSON(message.consensus_param_updates) - : undefined); + message.consensusParamUpdates !== undefined && (obj.consensusParamUpdates = message.consensusParamUpdates + ? ConsensusParams.toJSON(message.consensusParamUpdates) + : undefined); if (message.events) { - obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined); } else { obj.events = []; } return obj; }, - fromPartial(object: DeepPartial): ResponseEndBlock { - const message = { ...baseResponseEndBlock } as ResponseEndBlock; - message.validator_updates = []; - message.events = []; - if ( - object.validator_updates !== undefined && - object.validator_updates !== null - ) { - for (const e of object.validator_updates) { - message.validator_updates.push(ValidatorUpdate.fromPartial(e)); - } - } - if ( - object.consensus_param_updates !== undefined && - object.consensus_param_updates !== null - ) { - message.consensus_param_updates = ConsensusParams.fromPartial( - object.consensus_param_updates - ); - } else { - message.consensus_param_updates = undefined; - } - if (object.events !== undefined && object.events !== null) { - for (const e of object.events) { - message.events.push(Event.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ResponseEndBlock { + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; + message.consensusParamUpdates = + (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) + ? ConsensusParams.fromPartial(object.consensusParamUpdates) + : undefined; + message.events = object.events?.map((e) => Event.fromPartial(e)) || []; return message; }, }; -const baseResponseCommit: object = { retain_height: 0 }; +function createBaseResponseCommit(): ResponseCommit { + return { data: new Uint8Array(), retainHeight: 0 }; +} export const ResponseCommit = { - encode(message: ResponseCommit, writer: Writer = Writer.create()): Writer { + encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } - if (message.retain_height !== 0) { - writer.uint32(24).int64(message.retain_height); + if (message.retainHeight !== 0) { + writer.uint32(24).int64(message.retainHeight); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseCommit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseCommit } as ResponseCommit; + const message = createBaseResponseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3940,7 +3166,7 @@ export const ResponseCommit = { message.data = reader.bytes(); break; case 3: - message.retain_height = longToNumber(reader.int64() as Long); + message.retainHeight = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -3951,63 +3177,44 @@ export const ResponseCommit = { }, fromJSON(object: any): ResponseCommit { - const message = { ...baseResponseCommit } as ResponseCommit; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.retain_height !== undefined && object.retain_height !== null) { - message.retain_height = Number(object.retain_height); - } else { - message.retain_height = 0; - } - return message; + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + retainHeight: isSet(object.retainHeight) ? Number(object.retainHeight) : 0, + }; }, toJSON(message: ResponseCommit): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.retain_height !== undefined && - (obj.retain_height = message.retain_height); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.retainHeight !== undefined && (obj.retainHeight = Math.round(message.retainHeight)); return obj; }, - fromPartial(object: DeepPartial): ResponseCommit { - const message = { ...baseResponseCommit } as ResponseCommit; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.retain_height !== undefined && object.retain_height !== null) { - message.retain_height = object.retain_height; - } else { - message.retain_height = 0; - } + fromPartial, I>>(object: I): ResponseCommit { + const message = createBaseResponseCommit(); + message.data = object.data ?? new Uint8Array(); + message.retainHeight = object.retainHeight ?? 0; return message; }, }; -const baseResponseListSnapshots: object = {}; +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { snapshots: [] }; +} export const ResponseListSnapshots = { - encode( - message: ResponseListSnapshots, - writer: Writer = Writer.create() - ): Writer { + encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseListSnapshots { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; + const message = createBaseResponseListSnapshots(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4023,59 +3230,44 @@ export const ResponseListSnapshots = { }, fromJSON(object: any): ResponseListSnapshots { - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; - if (object.snapshots !== undefined && object.snapshots !== null) { - for (const e of object.snapshots) { - message.snapshots.push(Snapshot.fromJSON(e)); - } - } - return message; + return { + snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [], + }; }, toJSON(message: ResponseListSnapshots): unknown { const obj: any = {}; if (message.snapshots) { - obj.snapshots = message.snapshots.map((e) => - e ? Snapshot.toJSON(e) : undefined - ); + obj.snapshots = message.snapshots.map((e) => e ? Snapshot.toJSON(e) : undefined); } else { obj.snapshots = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ResponseListSnapshots { - const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; - message.snapshots = []; - if (object.snapshots !== undefined && object.snapshots !== null) { - for (const e of object.snapshots) { - message.snapshots.push(Snapshot.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ResponseListSnapshots { + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || []; return message; }, }; -const baseResponseOfferSnapshot: object = { result: 0 }; +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { result: 0 }; +} export const ResponseOfferSnapshot = { - encode( - message: ResponseOfferSnapshot, - writer: Writer = Writer.create() - ): Writer { + encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ResponseOfferSnapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + const message = createBaseResponseOfferSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4091,57 +3283,38 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; - if (object.result !== undefined && object.result !== null) { - message.result = responseOfferSnapshot_ResultFromJSON(object.result); - } else { - message.result = 0; - } - return message; + return { result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 }; }, toJSON(message: ResponseOfferSnapshot): unknown { const obj: any = {}; - message.result !== undefined && - (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); + message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); return obj; }, - fromPartial( - object: DeepPartial - ): ResponseOfferSnapshot { - const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = 0; - } + fromPartial, I>>(object: I): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot(); + message.result = object.result ?? 0; return message; }, }; -const baseResponseLoadSnapshotChunk: object = {}; +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { chunk: new Uint8Array() }; +} export const ResponseLoadSnapshotChunk = { - encode( - message: ResponseLoadSnapshotChunk, - writer: Writer = Writer.create() - ): Writer { + encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ResponseLoadSnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; + const message = createBaseResponseLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4157,75 +3330,47 @@ export const ResponseLoadSnapshotChunk = { }, fromJSON(object: any): ResponseLoadSnapshotChunk { - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); - } - return message; + return { chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() }; }, toJSON(message: ResponseLoadSnapshotChunk): unknown { const obj: any = {}; - message.chunk !== undefined && - (obj.chunk = base64FromBytes( - message.chunk !== undefined ? message.chunk : new Uint8Array() - )); + message.chunk !== undefined + && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): ResponseLoadSnapshotChunk { - const message = { - ...baseResponseLoadSnapshotChunk, - } as ResponseLoadSnapshotChunk; - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } else { - message.chunk = new Uint8Array(); - } + fromPartial, I>>(object: I): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk(); + message.chunk = object.chunk ?? new Uint8Array(); return message; }, }; -const baseResponseApplySnapshotChunk: object = { - result: 0, - refetch_chunks: 0, - reject_senders: "", -}; +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { result: 0, refetchChunks: [], rejectSenders: [] }; +} export const ResponseApplySnapshotChunk = { - encode( - message: ResponseApplySnapshotChunk, - writer: Writer = Writer.create() - ): Writer { + encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.result !== 0) { writer.uint32(8).int32(message.result); } writer.uint32(18).fork(); - for (const v of message.refetch_chunks) { + for (const v of message.refetchChunks) { writer.uint32(v); } writer.ldelim(); - for (const v of message.reject_senders) { + for (const v of message.rejectSenders) { writer.uint32(26).string(v!); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ResponseApplySnapshotChunk { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; + const message = createBaseResponseApplySnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4236,14 +3381,14 @@ export const ResponseApplySnapshotChunk = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.refetch_chunks.push(reader.uint32()); + message.refetchChunks.push(reader.uint32()); } } else { - message.refetch_chunks.push(reader.uint32()); + message.refetchChunks.push(reader.uint32()); } break; case 3: - message.reject_senders.push(reader.string()); + message.rejectSenders.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4254,116 +3399,110 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; - if (object.result !== undefined && object.result !== null) { - message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); + return { + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], + rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ResponseApplySnapshotChunk): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); + if (message.refetchChunks) { + obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e)); } else { - message.result = 0; + obj.refetchChunks = []; } - if (object.refetch_chunks !== undefined && object.refetch_chunks !== null) { - for (const e of object.refetch_chunks) { - message.refetch_chunks.push(Number(e)); - } + if (message.rejectSenders) { + obj.rejectSenders = message.rejectSenders.map((e) => e); + } else { + obj.rejectSenders = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk(); + message.result = object.result ?? 0; + message.refetchChunks = object.refetchChunks?.map((e) => e) || []; + message.rejectSenders = object.rejectSenders?.map((e) => e) || []; + return message; + }, +}; + +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { + return { txs: [] }; +} + +export const ResponsePrepareProposal = { + encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (object.reject_senders !== undefined && object.reject_senders !== null) { - for (const e of object.reject_senders) { - message.reject_senders.push(String(e)); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, - toJSON(message: ResponseApplySnapshotChunk): unknown { + fromJSON(object: any): ResponsePrepareProposal { + return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; + }, + + toJSON(message: ResponsePrepareProposal): unknown { const obj: any = {}; - message.result !== undefined && - (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); - if (message.refetch_chunks) { - obj.refetch_chunks = message.refetch_chunks.map((e) => e); - } else { - obj.refetch_chunks = []; - } - if (message.reject_senders) { - obj.reject_senders = message.reject_senders.map((e) => e); + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { - obj.reject_senders = []; + obj.txs = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ResponseApplySnapshotChunk { - const message = { - ...baseResponseApplySnapshotChunk, - } as ResponseApplySnapshotChunk; - message.refetch_chunks = []; - message.reject_senders = []; - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } else { - message.result = 0; - } - if (object.refetch_chunks !== undefined && object.refetch_chunks !== null) { - for (const e of object.refetch_chunks) { - message.refetch_chunks.push(e); - } - } - if (object.reject_senders !== undefined && object.reject_senders !== null) { - for (const e of object.reject_senders) { - message.reject_senders.push(e); - } - } + fromPartial, I>>(object: I): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map((e) => e) || []; return message; }, }; -const baseConsensusParams: object = {}; +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { status: 0 }; +} -export const ConsensusParams = { - encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); - } - if (message.evidence !== undefined) { - EvidenceParams.encode( - message.evidence, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.validator !== undefined) { - ValidatorParams.encode( - message.validator, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); +export const ResponseProcessProposal = { + encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensusParams } as ConsensusParams; + const message = createBaseResponseProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); + message.status = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -4373,103 +3512,50 @@ export const ConsensusParams = { return message; }, - fromJSON(object: any): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromJSON(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromJSON(object.version); - } else { - message.version = undefined; - } - return message; + fromJSON(object: any): ResponseProcessProposal { + return { status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : 0 }; }, - toJSON(message: ConsensusParams): unknown { + toJSON(message: ResponseProcessProposal): unknown { const obj: any = {}; - message.block !== undefined && - (obj.block = message.block - ? BlockParams.toJSON(message.block) - : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceParams.toJSON(message.evidence) - : undefined); - message.validator !== undefined && - (obj.validator = message.validator - ? ValidatorParams.toJSON(message.validator) - : undefined); - message.version !== undefined && - (obj.version = message.version - ? VersionParams.toJSON(message.version) - : undefined); + message.status !== undefined && (obj.status = responseProcessProposal_ProposalStatusToJSON(message.status)); return obj; }, - fromPartial(object: DeepPartial): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromPartial(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromPartial(object.version); - } else { - message.version = undefined; - } + fromPartial, I>>(object: I): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; return message; }, }; -const baseBlockParams: object = { max_bytes: 0, max_gas: 0 }; +function createBaseCommitInfo(): CommitInfo { + return { round: 0, votes: [] }; +} -export const BlockParams = { - encode(message: BlockParams, writer: Writer = Writer.create()): Writer { - if (message.max_bytes !== 0) { - writer.uint32(8).int64(message.max_bytes); +export const CommitInfo = { + encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); } - if (message.max_gas !== 0) { - writer.uint32(16).int64(message.max_gas); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockParams } as BlockParams; + const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_bytes = longToNumber(reader.int64() as Long); + message.round = reader.int32(); break; case 2: - message.max_gas = longToNumber(reader.int64() as Long); + message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4479,62 +3565,51 @@ export const BlockParams = { return message; }, - fromJSON(object: any): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = Number(object.max_gas); - } else { - message.max_gas = 0; - } - return message; + fromJSON(object: any): CommitInfo { + return { + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [], + }; }, - toJSON(message: BlockParams): unknown { + toJSON(message: CommitInfo): unknown { const obj: any = {}; - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); - message.max_gas !== undefined && (obj.max_gas = message.max_gas); + message.round !== undefined && (obj.round = Math.round(message.round)); + if (message.votes) { + obj.votes = message.votes.map((e) => e ? VoteInfo.toJSON(e) : undefined); + } else { + obj.votes = []; + } return obj; }, - fromPartial(object: DeepPartial): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = object.max_gas; - } else { - message.max_gas = 0; - } + fromPartial, I>>(object: I): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || []; return message; }, }; -const baseLastCommitInfo: object = { round: 0 }; +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { + return { round: 0, votes: [] }; +} -export const LastCommitInfo = { - encode(message: LastCommitInfo, writer: Writer = Writer.create()): Writer { +export const ExtendedCommitInfo = { + encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): LastCommitInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; + const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4542,7 +3617,7 @@ export const LastCommitInfo = { message.round = reader.int32(); break; case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4552,56 +3627,38 @@ export const LastCommitInfo = { return message; }, - fromJSON(object: any): LastCommitInfo { - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(VoteInfo.fromJSON(e)); - } - } - return message; + fromJSON(object: any): ExtendedCommitInfo { + return { + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromJSON(e)) : [], + }; }, - toJSON(message: LastCommitInfo): unknown { + toJSON(message: ExtendedCommitInfo): unknown { const obj: any = {}; - message.round !== undefined && (obj.round = message.round); + message.round !== undefined && (obj.round = Math.round(message.round)); if (message.votes) { - obj.votes = message.votes.map((e) => - e ? VoteInfo.toJSON(e) : undefined - ); + obj.votes = message.votes.map((e) => e ? ExtendedVoteInfo.toJSON(e) : undefined); } else { obj.votes = []; } return obj; }, - fromPartial(object: DeepPartial): LastCommitInfo { - const message = { ...baseLastCommitInfo } as LastCommitInfo; - message.votes = []; - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.votes !== undefined && object.votes !== null) { - for (const e of object.votes) { - message.votes.push(VoteInfo.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map((e) => ExtendedVoteInfo.fromPartial(e)) || []; return message; }, }; -const baseEvent: object = { type: "" }; +function createBaseEvent(): Event { + return { type: "", attributes: [] }; +} export const Event = { - encode(message: Event, writer: Writer = Writer.create()): Writer { + encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -4611,11 +3668,10 @@ export const Event = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Event { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Event { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvent } as Event; - message.attributes = []; + const message = createBaseEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4623,9 +3679,7 @@ export const Event = { message.type = reader.string(); break; case 2: - message.attributes.push( - EventAttribute.decode(reader, reader.uint32()) - ); + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4636,60 +3690,44 @@ export const Event = { }, fromJSON(object: any): Event { - const message = { ...baseEvent } as Event; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(EventAttribute.fromJSON(e)); - } - } - return message; + return { + type: isSet(object.type) ? String(object.type) : "", + attributes: Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => EventAttribute.fromJSON(e)) + : [], + }; }, toJSON(message: Event): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); if (message.attributes) { - obj.attributes = message.attributes.map((e) => - e ? EventAttribute.toJSON(e) : undefined - ); + obj.attributes = message.attributes.map((e) => e ? EventAttribute.toJSON(e) : undefined); } else { obj.attributes = []; } return obj; }, - fromPartial(object: DeepPartial): Event { - const message = { ...baseEvent } as Event; - message.attributes = []; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.attributes !== undefined && object.attributes !== null) { - for (const e of object.attributes) { - message.attributes.push(EventAttribute.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Event { + const message = createBaseEvent(); + message.type = object.type ?? ""; + message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || []; return message; }, }; -const baseEventAttribute: object = { index: false }; +function createBaseEventAttribute(): EventAttribute { + return { key: "", value: "", index: false }; +} export const EventAttribute = { - encode(message: EventAttribute, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + if (message.value !== "") { + writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); @@ -4697,18 +3735,18 @@ export const EventAttribute = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): EventAttribute { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEventAttribute } as EventAttribute; + const message = createBaseEventAttribute(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.bytes(); + message.key = reader.string(); break; case 2: - message.value = reader.bytes(); + message.value = reader.string(); break; case 3: message.index = reader.bool(); @@ -4722,60 +3760,36 @@ export const EventAttribute = { }, fromJSON(object: any): EventAttribute { - const message = { ...baseEventAttribute } as EventAttribute; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.index !== undefined && object.index !== null) { - message.index = Boolean(object.index); - } else { - message.index = false; - } - return message; + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + index: isSet(object.index) ? Boolean(object.index) : false, + }; }, toJSON(message: EventAttribute): unknown { const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); message.index !== undefined && (obj.index = message.index); return obj; }, - fromPartial(object: DeepPartial): EventAttribute { - const message = { ...baseEventAttribute } as EventAttribute; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = false; - } + fromPartial, I>>(object: I): EventAttribute { + const message = createBaseEventAttribute(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + message.index = object.index ?? false; return message; }, }; -const baseTxResult: object = { height: 0, index: 0 }; +function createBaseTxResult(): TxResult { + return { height: 0, index: 0, tx: new Uint8Array(), result: undefined }; +} export const TxResult = { - encode(message: TxResult, writer: Writer = Writer.create()): Writer { + encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } @@ -4786,18 +3800,15 @@ export const TxResult = { writer.uint32(26).bytes(message.tx); } if (message.result !== undefined) { - ResponseDeliverTx.encode( - message.result, - writer.uint32(34).fork() - ).ldelim(); + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxResult { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxResult } as TxResult; + const message = createBaseTxResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4822,73 +3833,42 @@ export const TxResult = { }, fromJSON(object: any): TxResult { - const message = { ...baseTxResult } as TxResult; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromJSON(object.result); - } else { - message.result = undefined; - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + index: isSet(object.index) ? Number(object.index) : 0, + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined, + }; }, toJSON(message: TxResult): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.index !== undefined && (obj.index = message.index); - message.tx !== undefined && - (obj.tx = base64FromBytes( - message.tx !== undefined ? message.tx : new Uint8Array() - )); - message.result !== undefined && - (obj.result = message.result - ? ResponseDeliverTx.toJSON(message.result) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.result !== undefined + && (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); return obj; }, - fromPartial(object: DeepPartial): TxResult { - const message = { ...baseTxResult } as TxResult; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = object.tx; - } else { - message.tx = new Uint8Array(); - } - if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromPartial(object.result); - } else { - message.result = undefined; - } + fromPartial, I>>(object: I): TxResult { + const message = createBaseTxResult(); + message.height = object.height ?? 0; + message.index = object.index ?? 0; + message.tx = object.tx ?? new Uint8Array(); + message.result = (object.result !== undefined && object.result !== null) + ? ResponseDeliverTx.fromPartial(object.result) + : undefined; return message; }, }; -const baseValidator: object = { power: 0 }; +function createBaseValidator(): Validator { + return { address: new Uint8Array(), power: 0 }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } @@ -4898,10 +3878,10 @@ export const Validator = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4920,50 +3900,36 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + power: isSet(object.power) ? Number(object.power) : 0, + }; }, toJSON(message: Validator): unknown { const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.power !== undefined && (obj.power = message.power); + message.address !== undefined + && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.power !== undefined && (obj.power = Math.round(message.power)); return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power ?? 0; return message; }, }; -const baseValidatorUpdate: object = { power: 0 }; +function createBaseValidatorUpdate(): ValidatorUpdate { + return { pubKey: undefined, power: 0 }; +} export const ValidatorUpdate = { - encode(message: ValidatorUpdate, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); + encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } if (message.power !== 0) { writer.uint32(16).int64(message.power); @@ -4971,15 +3937,15 @@ export const ValidatorUpdate = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorUpdate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorUpdate } as ValidatorUpdate; + const message = createBaseValidatorUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: message.power = longToNumber(reader.int64() as Long); @@ -4993,63 +3959,48 @@ export const ValidatorUpdate = { }, fromJSON(object: any): ValidatorUpdate { - const message = { ...baseValidatorUpdate } as ValidatorUpdate; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = Number(object.power); - } else { - message.power = 0; - } - return message; + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + power: isSet(object.power) ? Number(object.power) : 0, + }; }, toJSON(message: ValidatorUpdate): unknown { const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.power !== undefined && (obj.power = message.power); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.power !== undefined && (obj.power = Math.round(message.power)); return obj; }, - fromPartial(object: DeepPartial): ValidatorUpdate { - const message = { ...baseValidatorUpdate } as ValidatorUpdate; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.power !== undefined && object.power !== null) { - message.power = object.power; - } else { - message.power = 0; - } + fromPartial, I>>(object: I): ValidatorUpdate { + const message = createBaseValidatorUpdate(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.power = object.power ?? 0; return message; }, }; -const baseVoteInfo: object = { signed_last_block: false }; +function createBaseVoteInfo(): VoteInfo { + return { validator: undefined, signedLastBlock: false }; +} export const VoteInfo = { - encode(message: VoteInfo, writer: Writer = Writer.create()): Writer { + encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } - if (message.signed_last_block === true) { - writer.uint32(16).bool(message.signed_last_block); + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): VoteInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVoteInfo } as VoteInfo; + const message = createBaseVoteInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5057,7 +4008,7 @@ export const VoteInfo = { message.validator = Validator.decode(reader, reader.uint32()); break; case 2: - message.signed_last_block = reader.bool(); + message.signedLastBlock = reader.bool(); break; default: reader.skipType(tag & 7); @@ -5068,57 +4019,109 @@ export const VoteInfo = { }, fromJSON(object: any): VoteInfo { - const message = { ...baseVoteInfo } as VoteInfo; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if ( - object.signed_last_block !== undefined && - object.signed_last_block !== null - ) { - message.signed_last_block = Boolean(object.signed_last_block); - } else { - message.signed_last_block = false; - } - return message; + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, + }; }, toJSON(message: VoteInfo): unknown { const obj: any = {}; - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - message.signed_last_block !== undefined && - (obj.signed_last_block = message.signed_last_block); + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); return obj; }, - fromPartial(object: DeepPartial): VoteInfo { - const message = { ...baseVoteInfo } as VoteInfo; - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; + fromPartial, I>>(object: I): VoteInfo { + const message = createBaseVoteInfo(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + return message; + }, +}; + +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { validator: undefined, signedLastBlock: false, voteExtension: new Uint8Array() }; +} + +export const ExtendedVoteInfo = { + encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } - if ( - object.signed_last_block !== undefined && - object.signed_last_block !== null - ) { - message.signed_last_block = object.signed_last_block; - } else { - message.signed_last_block = false; + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): ExtendedVoteInfo { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, + voteExtension: isSet(object.voteExtension) ? bytesFromBase64(object.voteExtension) : new Uint8Array(), + }; + }, + + toJSON(message: ExtendedVoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + message.voteExtension !== undefined + && (obj.voteExtension = base64FromBytes( + message.voteExtension !== undefined ? message.voteExtension : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, }; -const baseEvidence: object = { type: 0, height: 0, total_voting_power: 0 }; +function createBaseMisbehavior(): Misbehavior { + return { type: 0, validator: undefined, height: 0, time: undefined, totalVotingPower: 0 }; +} -export const Evidence = { - encode(message: Evidence, writer: Writer = Writer.create()): Writer { +export const Misbehavior = { + encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -5129,21 +4132,18 @@ export const Evidence = { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(40).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(40).int64(message.totalVotingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidence } as Evidence; + const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5157,12 +4157,10 @@ export const Evidence = { message.height = longToNumber(reader.int64() as Long); break; case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -5172,93 +4170,46 @@ export const Evidence = { return message; }, - fromJSON(object: any): Evidence { - const message = { ...baseEvidence } as Evidence; - if (object.type !== undefined && object.type !== null) { - message.type = evidenceTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; + fromJSON(object: any): Misbehavior { + return { + type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : 0, + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + }; }, - toJSON(message: Evidence): unknown { + toJSON(message: Misbehavior): unknown { const obj: any = {}; - message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); - message.validator !== undefined && - (obj.validator = message.validator - ? Validator.toJSON(message.validator) - : undefined); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); + message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type)); + message.validator !== undefined + && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); return obj; }, - fromPartial(object: DeepPartial): Evidence { - const message = { ...baseEvidence } as Evidence; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } + fromPartial, I>>(object: I): Misbehavior { + const message = createBaseMisbehavior(); + message.type = object.type ?? 0; + message.validator = (object.validator !== undefined && object.validator !== null) + ? Validator.fromPartial(object.validator) + : undefined; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; return message; }, }; -const baseSnapshot: object = { height: 0, format: 0, chunks: 0 }; +function createBaseSnapshot(): Snapshot { + return { height: 0, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() }; +} export const Snapshot = { - encode(message: Snapshot, writer: Writer = Writer.create()): Writer { + encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).uint64(message.height); } @@ -5277,10 +4228,10 @@ export const Snapshot = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSnapshot } as Snapshot; + const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5308,74 +4259,34 @@ export const Snapshot = { }, fromJSON(object: any): Snapshot { - const message = { ...baseSnapshot } as Snapshot; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = Number(object.format); - } else { - message.format = 0; - } - if (object.chunks !== undefined && object.chunks !== null) { - message.chunks = Number(object.chunks); - } else { - message.chunks = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = bytesFromBase64(object.metadata); - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + format: isSet(object.format) ? Number(object.format) : 0, + chunks: isSet(object.chunks) ? Number(object.chunks) : 0, + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(), + }; }, toJSON(message: Snapshot): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.format !== undefined && (obj.format = message.format); - message.chunks !== undefined && (obj.chunks = message.chunks); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.metadata !== undefined && - (obj.metadata = base64FromBytes( - message.metadata !== undefined ? message.metadata : new Uint8Array() - )); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.format !== undefined && (obj.format = Math.round(message.format)); + message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.metadata !== undefined + && (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Snapshot { - const message = { ...baseSnapshot } as Snapshot; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } else { - message.format = 0; - } - if (object.chunks !== undefined && object.chunks !== null) { - message.chunks = object.chunks; - } else { - message.chunks = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } else { - message.metadata = new Uint8Array(); - } + fromPartial, I>>(object: I): Snapshot { + const message = createBaseSnapshot(); + message.height = object.height ?? 0; + message.format = object.format ?? 0; + message.chunks = object.chunks ?? 0; + message.hash = object.hash ?? new Uint8Array(); + message.metadata = object.metadata ?? new Uint8Array(); return message; }, }; @@ -5384,7 +4295,6 @@ export interface ABCIApplication { Echo(request: RequestEcho): Promise; Flush(request: RequestFlush): Promise; Info(request: RequestInfo): Promise; - SetOption(request: RequestSetOption): Promise; DeliverTx(request: RequestDeliverTx): Promise; CheckTx(request: RequestCheckTx): Promise; Query(request: RequestQuery): Promise; @@ -5394,234 +4304,189 @@ export interface ABCIApplication { EndBlock(request: RequestEndBlock): Promise; ListSnapshots(request: RequestListSnapshots): Promise; OfferSnapshot(request: RequestOfferSnapshot): Promise; - LoadSnapshotChunk( - request: RequestLoadSnapshotChunk - ): Promise; - ApplySnapshotChunk( - request: RequestApplySnapshotChunk - ): Promise; + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; + PrepareProposal(request: RequestPrepareProposal): Promise; + ProcessProposal(request: RequestProcessProposal): Promise; } export class ABCIApplicationClientImpl implements ABCIApplication { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Echo = this.Echo.bind(this); + this.Flush = this.Flush.bind(this); + this.Info = this.Info.bind(this); + this.DeliverTx = this.DeliverTx.bind(this); + this.CheckTx = this.CheckTx.bind(this); + this.Query = this.Query.bind(this); + this.Commit = this.Commit.bind(this); + this.InitChain = this.InitChain.bind(this); + this.BeginBlock = this.BeginBlock.bind(this); + this.EndBlock = this.EndBlock.bind(this); + this.ListSnapshots = this.ListSnapshots.bind(this); + this.OfferSnapshot = this.OfferSnapshot.bind(this); + this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this); + this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this); + this.PrepareProposal = this.PrepareProposal.bind(this); + this.ProcessProposal = this.ProcessProposal.bind(this); } Echo(request: RequestEcho): Promise { const data = RequestEcho.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Echo", - data - ); - return promise.then((data) => ResponseEcho.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); + return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))); } Flush(request: RequestFlush): Promise { const data = RequestFlush.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Flush", - data - ); - return promise.then((data) => ResponseFlush.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); + return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))); } Info(request: RequestInfo): Promise { const data = RequestInfo.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Info", - data - ); - return promise.then((data) => ResponseInfo.decode(new Reader(data))); - } - - SetOption(request: RequestSetOption): Promise { - const data = RequestSetOption.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "SetOption", - data - ); - return promise.then((data) => ResponseSetOption.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); + return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))); } DeliverTx(request: RequestDeliverTx): Promise { const data = RequestDeliverTx.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "DeliverTx", - data - ); - return promise.then((data) => ResponseDeliverTx.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); + return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))); } CheckTx(request: RequestCheckTx): Promise { const data = RequestCheckTx.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "CheckTx", - data - ); - return promise.then((data) => ResponseCheckTx.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); + return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))); } Query(request: RequestQuery): Promise { const data = RequestQuery.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Query", - data - ); - return promise.then((data) => ResponseQuery.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); + return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))); } Commit(request: RequestCommit): Promise { const data = RequestCommit.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "Commit", - data - ); - return promise.then((data) => ResponseCommit.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); + return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))); } InitChain(request: RequestInitChain): Promise { const data = RequestInitChain.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "InitChain", - data - ); - return promise.then((data) => ResponseInitChain.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); + return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))); } BeginBlock(request: RequestBeginBlock): Promise { const data = RequestBeginBlock.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "BeginBlock", - data - ); - return promise.then((data) => ResponseBeginBlock.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); + return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))); } EndBlock(request: RequestEndBlock): Promise { const data = RequestEndBlock.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "EndBlock", - data - ); - return promise.then((data) => ResponseEndBlock.decode(new Reader(data))); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); + return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))); } ListSnapshots(request: RequestListSnapshots): Promise { const data = RequestListSnapshots.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "ListSnapshots", - data - ); - return promise.then((data) => - ResponseListSnapshots.decode(new Reader(data)) - ); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); + return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))); } OfferSnapshot(request: RequestOfferSnapshot): Promise { const data = RequestOfferSnapshot.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "OfferSnapshot", - data - ); - return promise.then((data) => - ResponseOfferSnapshot.decode(new Reader(data)) - ); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); + return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))); } - LoadSnapshotChunk( - request: RequestLoadSnapshotChunk - ): Promise { + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { const data = RequestLoadSnapshotChunk.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "LoadSnapshotChunk", - data - ); - return promise.then((data) => - ResponseLoadSnapshotChunk.decode(new Reader(data)) - ); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); + return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data))); } - ApplySnapshotChunk( - request: RequestApplySnapshotChunk - ): Promise { + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { const data = RequestApplySnapshotChunk.encode(request).finish(); - const promise = this.rpc.request( - "tendermint.abci.ABCIApplication", - "ApplySnapshotChunk", - data - ); - return promise.then((data) => - ResponseApplySnapshotChunk.decode(new Reader(data)) - ); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); + return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data))); + } + + PrepareProposal(request: RequestPrepareProposal): Promise { + const data = RequestPrepareProposal.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "PrepareProposal", data); + return promise.then((data) => ResponsePrepareProposal.decode(new _m0.Reader(data))); + } + + ProcessProposal(request: RequestProcessProposal): Promise { + const data = RequestProcessProposal.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ProcessProposal", data); + return promise.then((data) => ResponseProcessProposal.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -5651,7 +4516,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts index d913745384..b690245f0b 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts @@ -1,19 +1,21 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; } -const basePublicKey: object = {}; +function createBasePublicKey(): PublicKey { + return { ed25519: undefined, secp256k1: undefined }; +} export const PublicKey = { - encode(message: PublicKey, writer: Writer = Writer.create()): Writer { + encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); } @@ -23,10 +25,10 @@ export const PublicKey = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePublicKey } as PublicKey; + const message = createBasePublicKey(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -45,87 +47,84 @@ export const PublicKey = { }, fromJSON(object: any): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; + return { + ed25519: isSet(object.ed25519) ? bytesFromBase64(object.ed25519) : undefined, + secp256k1: isSet(object.secp256k1) ? bytesFromBase64(object.secp256k1) : undefined, + }; }, toJSON(message: PublicKey): unknown { const obj: any = {}; - message.ed25519 !== undefined && - (obj.ed25519 = - message.ed25519 !== undefined - ? base64FromBytes(message.ed25519) - : undefined); - message.secp256k1 !== undefined && - (obj.secp256k1 = - message.secp256k1 !== undefined - ? base64FromBytes(message.secp256k1) - : undefined); + message.ed25519 !== undefined + && (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined + && (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); return obj; }, - fromPartial(object: DeepPartial): PublicKey { - const message = { ...basePublicKey } as PublicKey; - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = object.ed25519; - } else { - message.ed25519 = undefined; - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = object.secp256k1; - } else { - message.secp256k1 = undefined; - } + fromPartial, I>>(object: I): PublicKey { + const message = createBasePublicKey(); + message.ed25519 = object.ed25519 ?? undefined; + message.secp256k1 = object.secp256k1 ?? undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/proof.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/proof.ts index a74e0d5153..9ef5ed12aa 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/proof.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/crypto/proof.ts @@ -1,14 +1,14 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; export interface Proof { total: number; index: number; - leaf_hash: Uint8Array; + leafHash: Uint8Array; aunts: Uint8Array[]; } @@ -41,18 +41,20 @@ export interface ProofOps { ops: ProofOp[]; } -const baseProof: object = { total: 0, index: 0 }; +function createBaseProof(): Proof { + return { total: 0, index: 0, leafHash: new Uint8Array(), aunts: [] }; +} export const Proof = { - encode(message: Proof, writer: Writer = Writer.create()): Writer { + encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).int64(message.total); } if (message.index !== 0) { writer.uint32(16).int64(message.index); } - if (message.leaf_hash.length !== 0) { - writer.uint32(26).bytes(message.leaf_hash); + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); } for (const v of message.aunts) { writer.uint32(34).bytes(v!); @@ -60,11 +62,10 @@ export const Proof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProof } as Proof; - message.aunts = []; + const message = createBaseProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -75,7 +76,7 @@ export const Proof = { message.index = longToNumber(reader.int64() as Long); break; case 3: - message.leaf_hash = reader.bytes(); + message.leafHash = reader.bytes(); break; case 4: message.aunts.push(reader.bytes()); @@ -89,78 +90,44 @@ export const Proof = { }, fromJSON(object: any): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = bytesFromBase64(object.leaf_hash); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(bytesFromBase64(e)); - } - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + index: isSet(object.index) ? Number(object.index) : 0, + leafHash: isSet(object.leafHash) ? bytesFromBase64(object.leafHash) : new Uint8Array(), + aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => bytesFromBase64(e)) : [], + }; }, toJSON(message: Proof): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.index !== undefined && (obj.index = message.index); - message.leaf_hash !== undefined && - (obj.leaf_hash = base64FromBytes( - message.leaf_hash !== undefined ? message.leaf_hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.leafHash !== undefined + && (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); if (message.aunts) { - obj.aunts = message.aunts.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.aunts = []; } return obj; }, - fromPartial(object: DeepPartial): Proof { - const message = { ...baseProof } as Proof; - message.aunts = []; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leaf_hash = object.leaf_hash; - } else { - message.leaf_hash = new Uint8Array(); - } - if (object.aunts !== undefined && object.aunts !== null) { - for (const e of object.aunts) { - message.aunts.push(e); - } - } + fromPartial, I>>(object: I): Proof { + const message = createBaseProof(); + message.total = object.total ?? 0; + message.index = object.index ?? 0; + message.leafHash = object.leafHash ?? new Uint8Array(); + message.aunts = object.aunts?.map((e) => e) || []; return message; }, }; -const baseValueOp: object = {}; +function createBaseValueOp(): ValueOp { + return { key: new Uint8Array(), proof: undefined }; +} export const ValueOp = { - encode(message: ValueOp, writer: Writer = Writer.create()): Writer { + encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -170,10 +137,10 @@ export const ValueOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValueOp } as ValueOp; + const message = createBaseValueOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -192,49 +159,34 @@ export const ValueOp = { }, fromJSON(object: any): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: ValueOp): unknown { const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): ValueOp { - const message = { ...baseValueOp } as ValueOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): ValueOp { + const message = createBaseValueOp(); + message.key = object.key ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseDominoOp: object = { key: "", input: "", output: "" }; +function createBaseDominoOp(): DominoOp { + return { key: "", input: "", output: "" }; +} export const DominoOp = { - encode(message: DominoOp, writer: Writer = Writer.create()): Writer { + encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -247,10 +199,10 @@ export const DominoOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDominoOp } as DominoOp; + const message = createBaseDominoOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -272,23 +224,11 @@ export const DominoOp = { }, fromJSON(object: any): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = String(object.key); - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = String(object.input); - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = String(object.output); - } else { - message.output = ""; - } - return message; + return { + key: isSet(object.key) ? String(object.key) : "", + input: isSet(object.input) ? String(object.input) : "", + output: isSet(object.output) ? String(object.output) : "", + }; }, toJSON(message: DominoOp): unknown { @@ -299,31 +239,21 @@ export const DominoOp = { return obj; }, - fromPartial(object: DeepPartial): DominoOp { - const message = { ...baseDominoOp } as DominoOp; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = ""; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } else { - message.input = ""; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } else { - message.output = ""; - } + fromPartial, I>>(object: I): DominoOp { + const message = createBaseDominoOp(); + message.key = object.key ?? ""; + message.input = object.input ?? ""; + message.output = object.output ?? ""; return message; }, }; -const baseProofOp: object = { type: "" }; +function createBaseProofOp(): ProofOp { + return { type: "", key: new Uint8Array(), data: new Uint8Array() }; +} export const ProofOp = { - encode(message: ProofOp, writer: Writer = Writer.create()): Writer { + encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -336,10 +266,10 @@ export const ProofOp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOp } as ProofOp; + const message = createBaseProofOp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -361,71 +291,48 @@ export const ProofOp = { }, fromJSON(object: any): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = String(object.type); - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + type: isSet(object.type) ? String(object.type) : "", + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: ProofOp): unknown { const obj: any = {}; message.type !== undefined && (obj.type = message.type); - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): ProofOp { - const message = { ...baseProofOp } as ProofOp; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = ""; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>(object: I): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseProofOps: object = {}; +function createBaseProofOps(): ProofOps { + return { ops: [] }; +} export const ProofOps = { - encode(message: ProofOps, writer: Writer = Writer.create()): Writer { + encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProofOps } as ProofOps; - message.ops = []; + const message = createBaseProofOps(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -441,82 +348,81 @@ export const ProofOps = { }, fromJSON(object: any): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromJSON(e)); - } - } - return message; + return { ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] }; }, toJSON(message: ProofOps): unknown { const obj: any = {}; if (message.ops) { - obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); + obj.ops = message.ops.map((e) => e ? ProofOp.toJSON(e) : undefined); } else { obj.ops = []; } return obj; }, - fromPartial(object: DeepPartial): ProofOps { - const message = { ...baseProofOps } as ProofOps; - message.ops = []; - if (object.ops !== undefined && object.ops !== null) { - for (const e of object.ops) { - message.ops.push(ProofOp.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -524,7 +430,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/block.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/block.ts index 38888c856d..e34236067f 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/block.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/block.ts @@ -1,8 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Header, Data, Commit } from "../../tendermint/types/types"; -import { EvidenceList } from "../../tendermint/types/evidence"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { EvidenceList } from "./evidence"; +import { Commit, Data, Header } from "./types"; export const protobufPackage = "tendermint.types"; @@ -10,13 +10,15 @@ export interface Block { header: Header | undefined; data: Data | undefined; evidence: EvidenceList | undefined; - last_commit: Commit | undefined; + lastCommit: Commit | undefined; } -const baseBlock: object = {}; +function createBaseBlock(): Block { + return { header: undefined, data: undefined, evidence: undefined, lastCommit: undefined }; +} export const Block = { - encode(message: Block, writer: Writer = Writer.create()): Writer { + encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -26,16 +28,16 @@ export const Block = { if (message.evidence !== undefined) { EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); } - if (message.last_commit !== undefined) { - Commit.encode(message.last_commit, writer.uint32(34).fork()).ldelim(); + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Block { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Block { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlock } as Block; + const message = createBaseBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -49,7 +51,7 @@ export const Block = { message.evidence = EvidenceList.decode(reader, reader.uint32()); break; case 4: - message.last_commit = Commit.decode(reader, reader.uint32()); + message.lastCommit = Commit.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -60,80 +62,52 @@ export const Block = { }, fromJSON(object: any): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromJSON(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromJSON(object.last_commit); - } else { - message.last_commit = undefined; - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + data: isSet(object.data) ? Data.fromJSON(object.data) : undefined, + evidence: isSet(object.evidence) ? EvidenceList.fromJSON(object.evidence) : undefined, + lastCommit: isSet(object.lastCommit) ? Commit.fromJSON(object.lastCommit) : undefined, + }; }, toJSON(message: Block): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.data !== undefined && - (obj.data = message.data ? Data.toJSON(message.data) : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceList.toJSON(message.evidence) - : undefined); - message.last_commit !== undefined && - (obj.last_commit = message.last_commit - ? Commit.toJSON(message.last_commit) - : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); + message.lastCommit !== undefined + && (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); return obj; }, - fromPartial(object: DeepPartial): Block { - const message = { ...baseBlock } as Block; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromPartial(object.data); - } else { - message.data = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.last_commit = Commit.fromPartial(object.last_commit); - } else { - message.last_commit = undefined; - } + fromPartial, I>>(object: I): Block { + const message = createBaseBlock(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Data.fromPartial(object.data) : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceList.fromPartial(object.evidence) + : undefined; + message.lastCommit = (object.lastCommit !== undefined && object.lastCommit !== null) + ? Commit.fromPartial(object.lastCommit) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/evidence.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/evidence.ts index 99e6824048..49dd0a8b5d 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/evidence.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/evidence.ts @@ -1,33 +1,33 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Vote, LightBlock } from "../../tendermint/types/types"; -import { Validator } from "../../tendermint/types/validator"; +import { LightBlock, Vote } from "./types"; +import { Validator } from "./validator"; export const protobufPackage = "tendermint.types"; export interface Evidence { - duplicate_vote_evidence: DuplicateVoteEvidence | undefined; - light_client_attack_evidence: LightClientAttackEvidence | undefined; + duplicateVoteEvidence: DuplicateVoteEvidence | undefined; + lightClientAttackEvidence: LightClientAttackEvidence | undefined; } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - vote_a: Vote | undefined; - vote_b: Vote | undefined; - total_voting_power: number; - validator_power: number; + voteA: Vote | undefined; + voteB: Vote | undefined; + totalVotingPower: number; + validatorPower: number; timestamp: Date | undefined; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflicting_block: LightBlock | undefined; - common_height: number; - byzantine_validators: Validator[]; - total_voting_power: number; + conflictingBlock: LightBlock | undefined; + commonHeight: number; + byzantineValidators: Validator[]; + totalVotingPower: number; timestamp: Date | undefined; } @@ -35,43 +35,33 @@ export interface EvidenceList { evidence: Evidence[]; } -const baseEvidence: object = {}; +function createBaseEvidence(): Evidence { + return { duplicateVoteEvidence: undefined, lightClientAttackEvidence: undefined }; +} export const Evidence = { - encode(message: Evidence, writer: Writer = Writer.create()): Writer { - if (message.duplicate_vote_evidence !== undefined) { - DuplicateVoteEvidence.encode( - message.duplicate_vote_evidence, - writer.uint32(10).fork() - ).ldelim(); + encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); } - if (message.light_client_attack_evidence !== undefined) { - LightClientAttackEvidence.encode( - message.light_client_attack_evidence, - writer.uint32(18).fork() - ).ldelim(); + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidence } as Evidence; + const message = createBaseEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.duplicate_vote_evidence = DuplicateVoteEvidence.decode( - reader, - reader.uint32() - ); + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); break; case 2: - message.light_client_attack_evidence = LightClientAttackEvidence.decode( - reader, - reader.uint32() - ); + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -82,123 +72,87 @@ export const Evidence = { }, fromJSON(object: any): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromJSON( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromJSON( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } - return message; + return { + duplicateVoteEvidence: isSet(object.duplicateVoteEvidence) + ? DuplicateVoteEvidence.fromJSON(object.duplicateVoteEvidence) + : undefined, + lightClientAttackEvidence: isSet(object.lightClientAttackEvidence) + ? LightClientAttackEvidence.fromJSON(object.lightClientAttackEvidence) + : undefined, + }; }, toJSON(message: Evidence): unknown { const obj: any = {}; - message.duplicate_vote_evidence !== undefined && - (obj.duplicate_vote_evidence = message.duplicate_vote_evidence - ? DuplicateVoteEvidence.toJSON(message.duplicate_vote_evidence) - : undefined); - message.light_client_attack_evidence !== undefined && - (obj.light_client_attack_evidence = message.light_client_attack_evidence - ? LightClientAttackEvidence.toJSON(message.light_client_attack_evidence) + message.duplicateVoteEvidence !== undefined && (obj.duplicateVoteEvidence = message.duplicateVoteEvidence + ? DuplicateVoteEvidence.toJSON(message.duplicateVoteEvidence) + : undefined); + message.lightClientAttackEvidence !== undefined + && (obj.lightClientAttackEvidence = message.lightClientAttackEvidence + ? LightClientAttackEvidence.toJSON(message.lightClientAttackEvidence) : undefined); return obj; }, - fromPartial(object: DeepPartial): Evidence { - const message = { ...baseEvidence } as Evidence; - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicate_vote_evidence = DuplicateVoteEvidence.fromPartial( - object.duplicate_vote_evidence - ); - } else { - message.duplicate_vote_evidence = undefined; - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.light_client_attack_evidence = LightClientAttackEvidence.fromPartial( - object.light_client_attack_evidence - ); - } else { - message.light_client_attack_evidence = undefined; - } + fromPartial, I>>(object: I): Evidence { + const message = createBaseEvidence(); + message.duplicateVoteEvidence = + (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) + ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) + : undefined; + message.lightClientAttackEvidence = + (object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null) + ? LightClientAttackEvidence.fromPartial(object.lightClientAttackEvidence) + : undefined; return message; }, }; -const baseDuplicateVoteEvidence: object = { - total_voting_power: 0, - validator_power: 0, -}; +function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { + return { voteA: undefined, voteB: undefined, totalVotingPower: 0, validatorPower: 0, timestamp: undefined }; +} export const DuplicateVoteEvidence = { - encode( - message: DuplicateVoteEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.vote_a !== undefined) { - Vote.encode(message.vote_a, writer.uint32(10).fork()).ldelim(); + encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); } - if (message.vote_b !== undefined) { - Vote.encode(message.vote_b, writer.uint32(18).fork()).ldelim(); + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(24).int64(message.totalVotingPower); } - if (message.validator_power !== 0) { - writer.uint32(32).int64(message.validator_power); + if (message.validatorPower !== 0) { + writer.uint32(32).int64(message.validatorPower); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; + const message = createBaseDuplicateVoteEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vote_a = Vote.decode(reader, reader.uint32()); + message.voteA = Vote.decode(reader, reader.uint32()); break; case 2: - message.vote_b = Vote.decode(reader, reader.uint32()); + message.voteB = Vote.decode(reader, reader.uint32()); break; case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; case 4: - message.validator_power = longToNumber(reader.int64() as Long); + message.validatorPower = longToNumber(reader.int64() as Long); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -209,166 +163,87 @@ export const DuplicateVoteEvidence = { }, fromJSON(object: any): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromJSON(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromJSON(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = Number(object.validator_power); - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; + return { + voteA: isSet(object.voteA) ? Vote.fromJSON(object.voteA) : undefined, + voteB: isSet(object.voteB) ? Vote.fromJSON(object.voteB) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + validatorPower: isSet(object.validatorPower) ? Number(object.validatorPower) : 0, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + }; }, toJSON(message: DuplicateVoteEvidence): unknown { const obj: any = {}; - message.vote_a !== undefined && - (obj.vote_a = message.vote_a ? Vote.toJSON(message.vote_a) : undefined); - message.vote_b !== undefined && - (obj.vote_b = message.vote_b ? Vote.toJSON(message.vote_b) : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.validator_power !== undefined && - (obj.validator_power = message.validator_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); + message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); + message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); + message.validatorPower !== undefined && (obj.validatorPower = Math.round(message.validatorPower)); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); return obj; }, - fromPartial( - object: DeepPartial - ): DuplicateVoteEvidence { - const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; - if (object.vote_a !== undefined && object.vote_a !== null) { - message.vote_a = Vote.fromPartial(object.vote_a); - } else { - message.vote_a = undefined; - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.vote_b = Vote.fromPartial(object.vote_b); - } else { - message.vote_b = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validator_power = object.validator_power; - } else { - message.validator_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } + fromPartial, I>>(object: I): DuplicateVoteEvidence { + const message = createBaseDuplicateVoteEvidence(); + message.voteA = (object.voteA !== undefined && object.voteA !== null) ? Vote.fromPartial(object.voteA) : undefined; + message.voteB = (object.voteB !== undefined && object.voteB !== null) ? Vote.fromPartial(object.voteB) : undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; + message.validatorPower = object.validatorPower ?? 0; + message.timestamp = object.timestamp ?? undefined; return message; }, }; -const baseLightClientAttackEvidence: object = { - common_height: 0, - total_voting_power: 0, -}; +function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { + return { + conflictingBlock: undefined, + commonHeight: 0, + byzantineValidators: [], + totalVotingPower: 0, + timestamp: undefined, + }; +} export const LightClientAttackEvidence = { - encode( - message: LightClientAttackEvidence, - writer: Writer = Writer.create() - ): Writer { - if (message.conflicting_block !== undefined) { - LightBlock.encode( - message.conflicting_block, - writer.uint32(10).fork() - ).ldelim(); + encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); } - if (message.common_height !== 0) { - writer.uint32(16).int64(message.common_height); + if (message.commonHeight !== 0) { + writer.uint32(16).int64(message.commonHeight); } - for (const v of message.byzantine_validators) { + for (const v of message.byzantineValidators) { Validator.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(32).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(32).int64(message.totalVotingPower); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): LightClientAttackEvidence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; + const message = createBaseLightClientAttackEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.conflicting_block = LightBlock.decode( - reader, - reader.uint32() - ); + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); break; case 2: - message.common_height = longToNumber(reader.int64() as Long); + message.commonHeight = longToNumber(reader.int64() as Long); break; case 3: - message.byzantine_validators.push( - Validator.decode(reader, reader.uint32()) - ); + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); break; case 4: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -379,134 +254,61 @@ export const LightClientAttackEvidence = { }, fromJSON(object: any): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromJSON(object.conflicting_block); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = Number(object.common_height); - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromJSON(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - return message; + return { + conflictingBlock: isSet(object.conflictingBlock) ? LightBlock.fromJSON(object.conflictingBlock) : undefined, + commonHeight: isSet(object.commonHeight) ? Number(object.commonHeight) : 0, + byzantineValidators: Array.isArray(object?.byzantineValidators) + ? object.byzantineValidators.map((e: any) => Validator.fromJSON(e)) + : [], + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + }; }, toJSON(message: LightClientAttackEvidence): unknown { const obj: any = {}; - message.conflicting_block !== undefined && - (obj.conflicting_block = message.conflicting_block - ? LightBlock.toJSON(message.conflicting_block) - : undefined); - message.common_height !== undefined && - (obj.common_height = message.common_height); - if (message.byzantine_validators) { - obj.byzantine_validators = message.byzantine_validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + message.conflictingBlock !== undefined + && (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); + message.commonHeight !== undefined && (obj.commonHeight = Math.round(message.commonHeight)); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Validator.toJSON(e) : undefined); } else { - obj.byzantine_validators = []; + obj.byzantineValidators = []; } - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); return obj; }, - fromPartial( - object: DeepPartial - ): LightClientAttackEvidence { - const message = { - ...baseLightClientAttackEvidence, - } as LightClientAttackEvidence; - message.byzantine_validators = []; - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflicting_block = LightBlock.fromPartial( - object.conflicting_block - ); - } else { - message.conflicting_block = undefined; - } - if (object.common_height !== undefined && object.common_height !== null) { - message.common_height = object.common_height; - } else { - message.common_height = 0; - } - if ( - object.byzantine_validators !== undefined && - object.byzantine_validators !== null - ) { - for (const e of object.byzantine_validators) { - message.byzantine_validators.push(Validator.fromPartial(e)); - } - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } + fromPartial, I>>(object: I): LightClientAttackEvidence { + const message = createBaseLightClientAttackEvidence(); + message.conflictingBlock = (object.conflictingBlock !== undefined && object.conflictingBlock !== null) + ? LightBlock.fromPartial(object.conflictingBlock) + : undefined; + message.commonHeight = object.commonHeight ?? 0; + message.byzantineValidators = object.byzantineValidators?.map((e) => Validator.fromPartial(e)) || []; + message.totalVotingPower = object.totalVotingPower ?? 0; + message.timestamp = object.timestamp ?? undefined; return message; }, }; -const baseEvidenceList: object = {}; +function createBaseEvidenceList(): EvidenceList { + return { evidence: [] }; +} export const EvidenceList = { - encode(message: EvidenceList, writer: Writer = Writer.create()): Writer { + encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.evidence) { Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; + const message = createBaseEvidenceList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -522,61 +324,56 @@ export const EvidenceList = { }, fromJSON(object: any): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromJSON(e)); - } - } - return message; + return { evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromJSON(e)) : [] }; }, toJSON(message: EvidenceList): unknown { const obj: any = {}; if (message.evidence) { - obj.evidence = message.evidence.map((e) => - e ? Evidence.toJSON(e) : undefined - ); + obj.evidence = message.evidence.map((e) => e ? Evidence.toJSON(e) : undefined); } else { obj.evidence = []; } return obj; }, - fromPartial(object: DeepPartial): EvidenceList { - const message = { ...baseEvidenceList } as EvidenceList; - message.evidence = []; - if (object.evidence !== undefined && object.evidence !== null) { - for (const e of object.evidence) { - message.evidence.push(Evidence.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EvidenceList { + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map((e) => Evidence.fromPartial(e)) || []; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -606,7 +403,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/params.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/params.ts index 69ac59d773..10f3a925b3 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/params.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/params.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Duration } from "../../google/protobuf/duration"; export const protobufPackage = "tendermint.types"; @@ -23,19 +23,12 @@ export interface BlockParams { * Max block size, in bytes. * Note: must be greater than 0 */ - max_bytes: number; + maxBytes: number; /** * Max gas per block. * Note: must be greater or equal to -1 */ - max_gas: number; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - time_iota_ms: number; + maxGas: number; } /** EvidenceParams determine how we handle evidence of malfeasance. */ @@ -46,7 +39,7 @@ export interface EvidenceParams { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - max_age_num_blocks: number; + maxAgeNumBlocks: number; /** * Max age of evidence, in time. * @@ -54,13 +47,15 @@ export interface EvidenceParams { * mechanism for handling [Nothing-At-Stake * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). */ - max_age_duration: Duration | undefined; + maxAgeDuration: + | Duration + | undefined; /** * This sets the maximum size of total evidence in bytes that can be committed in a single block. * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - max_bytes: number; + maxBytes: number; } /** @@ -68,12 +63,12 @@ export interface EvidenceParams { * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParams { - pub_key_types: string[]; + pubKeyTypes: string[]; } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - app_version: number; + app: number; } /** @@ -82,28 +77,24 @@ export interface VersionParams { * It is hashed into the Header.ConsensusHash. */ export interface HashedParams { - block_max_bytes: number; - block_max_gas: number; + blockMaxBytes: number; + blockMaxGas: number; } -const baseConsensusParams: object = {}; +function createBaseConsensusParams(): ConsensusParams { + return { block: undefined, evidence: undefined, validator: undefined, version: undefined }; +} export const ConsensusParams = { - encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer { + encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block !== undefined) { BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); } if (message.evidence !== undefined) { - EvidenceParams.encode( - message.evidence, - writer.uint32(18).fork() - ).ldelim(); + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); } if (message.validator !== undefined) { - ValidatorParams.encode( - message.validator, - writer.uint32(26).fork() - ).ldelim(); + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); } if (message.version !== undefined) { VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); @@ -111,10 +102,10 @@ export const ConsensusParams = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensusParams } as ConsensusParams; + const message = createBaseConsensusParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -139,108 +130,71 @@ export const ConsensusParams = { }, fromJSON(object: any): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromJSON(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromJSON(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromJSON(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromJSON(object.version); - } else { - message.version = undefined; - } - return message; + return { + block: isSet(object.block) ? BlockParams.fromJSON(object.block) : undefined, + evidence: isSet(object.evidence) ? EvidenceParams.fromJSON(object.evidence) : undefined, + validator: isSet(object.validator) ? ValidatorParams.fromJSON(object.validator) : undefined, + version: isSet(object.version) ? VersionParams.fromJSON(object.version) : undefined, + }; }, toJSON(message: ConsensusParams): unknown { const obj: any = {}; - message.block !== undefined && - (obj.block = message.block - ? BlockParams.toJSON(message.block) - : undefined); - message.evidence !== undefined && - (obj.evidence = message.evidence - ? EvidenceParams.toJSON(message.evidence) - : undefined); - message.validator !== undefined && - (obj.validator = message.validator - ? ValidatorParams.toJSON(message.validator) - : undefined); - message.version !== undefined && - (obj.version = message.version - ? VersionParams.toJSON(message.version) - : undefined); + message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined + && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined + && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined + && (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); return obj; }, - fromPartial(object: DeepPartial): ConsensusParams { - const message = { ...baseConsensusParams } as ConsensusParams; - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromPartial(object.block); - } else { - message.block = undefined; - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromPartial(object.evidence); - } else { - message.evidence = undefined; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromPartial(object.validator); - } else { - message.validator = undefined; - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromPartial(object.version); - } else { - message.version = undefined; - } + fromPartial, I>>(object: I): ConsensusParams { + const message = createBaseConsensusParams(); + message.block = (object.block !== undefined && object.block !== null) + ? BlockParams.fromPartial(object.block) + : undefined; + message.evidence = (object.evidence !== undefined && object.evidence !== null) + ? EvidenceParams.fromPartial(object.evidence) + : undefined; + message.validator = (object.validator !== undefined && object.validator !== null) + ? ValidatorParams.fromPartial(object.validator) + : undefined; + message.version = (object.version !== undefined && object.version !== null) + ? VersionParams.fromPartial(object.version) + : undefined; return message; }, }; -const baseBlockParams: object = { max_bytes: 0, max_gas: 0, time_iota_ms: 0 }; +function createBaseBlockParams(): BlockParams { + return { maxBytes: 0, maxGas: 0 }; +} export const BlockParams = { - encode(message: BlockParams, writer: Writer = Writer.create()): Writer { - if (message.max_bytes !== 0) { - writer.uint32(8).int64(message.max_bytes); - } - if (message.max_gas !== 0) { - writer.uint32(16).int64(message.max_gas); + encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxBytes !== 0) { + writer.uint32(8).int64(message.maxBytes); } - if (message.time_iota_ms !== 0) { - writer.uint32(24).int64(message.time_iota_ms); + if (message.maxGas !== 0) { + writer.uint32(16).int64(message.maxGas); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockParams } as BlockParams; + const message = createBaseBlockParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_bytes = longToNumber(reader.int64() as Long); + message.maxBytes = longToNumber(reader.int64() as Long); break; case 2: - message.max_gas = longToNumber(reader.int64() as Long); - break; - case 3: - message.time_iota_ms = longToNumber(reader.int64() as Long); + message.maxGas = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -251,89 +205,60 @@ export const BlockParams = { }, fromJSON(object: any): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = Number(object.max_gas); - } else { - message.max_gas = 0; - } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.time_iota_ms = Number(object.time_iota_ms); - } else { - message.time_iota_ms = 0; - } - return message; + return { + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + maxGas: isSet(object.maxGas) ? Number(object.maxGas) : 0, + }; }, toJSON(message: BlockParams): unknown { const obj: any = {}; - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); - message.max_gas !== undefined && (obj.max_gas = message.max_gas); - message.time_iota_ms !== undefined && - (obj.time_iota_ms = message.time_iota_ms); + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); + message.maxGas !== undefined && (obj.maxGas = Math.round(message.maxGas)); return obj; }, - fromPartial(object: DeepPartial): BlockParams { - const message = { ...baseBlockParams } as BlockParams; - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.max_gas = object.max_gas; - } else { - message.max_gas = 0; - } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.time_iota_ms = object.time_iota_ms; - } else { - message.time_iota_ms = 0; - } + fromPartial, I>>(object: I): BlockParams { + const message = createBaseBlockParams(); + message.maxBytes = object.maxBytes ?? 0; + message.maxGas = object.maxGas ?? 0; return message; }, }; -const baseEvidenceParams: object = { max_age_num_blocks: 0, max_bytes: 0 }; +function createBaseEvidenceParams(): EvidenceParams { + return { maxAgeNumBlocks: 0, maxAgeDuration: undefined, maxBytes: 0 }; +} export const EvidenceParams = { - encode(message: EvidenceParams, writer: Writer = Writer.create()): Writer { - if (message.max_age_num_blocks !== 0) { - writer.uint32(8).int64(message.max_age_num_blocks); + encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxAgeNumBlocks !== 0) { + writer.uint32(8).int64(message.maxAgeNumBlocks); } - if (message.max_age_duration !== undefined) { - Duration.encode( - message.max_age_duration, - writer.uint32(18).fork() - ).ldelim(); + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); } - if (message.max_bytes !== 0) { - writer.uint32(24).int64(message.max_bytes); + if (message.maxBytes !== 0) { + writer.uint32(24).int64(message.maxBytes); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EvidenceParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEvidenceParams } as EvidenceParams; + const message = createBaseEvidenceParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_age_num_blocks = longToNumber(reader.int64() as Long); + message.maxAgeNumBlocks = longToNumber(reader.int64() as Long); break; case 2: - message.max_age_duration = Duration.decode(reader, reader.uint32()); + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); break; case 3: - message.max_bytes = longToNumber(reader.int64() as Long); + message.maxBytes = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -344,90 +269,54 @@ export const EvidenceParams = { }, fromJSON(object: any): EvidenceParams { - const message = { ...baseEvidenceParams } as EvidenceParams; - if ( - object.max_age_num_blocks !== undefined && - object.max_age_num_blocks !== null - ) { - message.max_age_num_blocks = Number(object.max_age_num_blocks); - } else { - message.max_age_num_blocks = 0; - } - if ( - object.max_age_duration !== undefined && - object.max_age_duration !== null - ) { - message.max_age_duration = Duration.fromJSON(object.max_age_duration); - } else { - message.max_age_duration = undefined; - } - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = Number(object.max_bytes); - } else { - message.max_bytes = 0; - } - return message; + return { + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? Number(object.maxAgeNumBlocks) : 0, + maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, + maxBytes: isSet(object.maxBytes) ? Number(object.maxBytes) : 0, + }; }, toJSON(message: EvidenceParams): unknown { const obj: any = {}; - message.max_age_num_blocks !== undefined && - (obj.max_age_num_blocks = message.max_age_num_blocks); - message.max_age_duration !== undefined && - (obj.max_age_duration = message.max_age_duration - ? Duration.toJSON(message.max_age_duration) - : undefined); - message.max_bytes !== undefined && (obj.max_bytes = message.max_bytes); + message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = Math.round(message.maxAgeNumBlocks)); + message.maxAgeDuration !== undefined + && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = Math.round(message.maxBytes)); return obj; }, - fromPartial(object: DeepPartial): EvidenceParams { - const message = { ...baseEvidenceParams } as EvidenceParams; - if ( - object.max_age_num_blocks !== undefined && - object.max_age_num_blocks !== null - ) { - message.max_age_num_blocks = object.max_age_num_blocks; - } else { - message.max_age_num_blocks = 0; - } - if ( - object.max_age_duration !== undefined && - object.max_age_duration !== null - ) { - message.max_age_duration = Duration.fromPartial(object.max_age_duration); - } else { - message.max_age_duration = undefined; - } - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.max_bytes = object.max_bytes; - } else { - message.max_bytes = 0; - } + fromPartial, I>>(object: I): EvidenceParams { + const message = createBaseEvidenceParams(); + message.maxAgeNumBlocks = object.maxAgeNumBlocks ?? 0; + message.maxAgeDuration = (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) + ? Duration.fromPartial(object.maxAgeDuration) + : undefined; + message.maxBytes = object.maxBytes ?? 0; return message; }, }; -const baseValidatorParams: object = { pub_key_types: "" }; +function createBaseValidatorParams(): ValidatorParams { + return { pubKeyTypes: [] }; +} export const ValidatorParams = { - encode(message: ValidatorParams, writer: Writer = Writer.create()): Writer { - for (const v of message.pub_key_types) { + encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pubKeyTypes) { writer.uint32(10).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; + const message = createBaseValidatorParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pub_key_types.push(reader.string()); + message.pubKeyTypes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -438,57 +327,47 @@ export const ValidatorParams = { }, fromJSON(object: any): ValidatorParams { - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; - if (object.pub_key_types !== undefined && object.pub_key_types !== null) { - for (const e of object.pub_key_types) { - message.pub_key_types.push(String(e)); - } - } - return message; + return { pubKeyTypes: Array.isArray(object?.pubKeyTypes) ? object.pubKeyTypes.map((e: any) => String(e)) : [] }; }, toJSON(message: ValidatorParams): unknown { const obj: any = {}; - if (message.pub_key_types) { - obj.pub_key_types = message.pub_key_types.map((e) => e); + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); } else { - obj.pub_key_types = []; + obj.pubKeyTypes = []; } return obj; }, - fromPartial(object: DeepPartial): ValidatorParams { - const message = { ...baseValidatorParams } as ValidatorParams; - message.pub_key_types = []; - if (object.pub_key_types !== undefined && object.pub_key_types !== null) { - for (const e of object.pub_key_types) { - message.pub_key_types.push(e); - } - } + fromPartial, I>>(object: I): ValidatorParams { + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || []; return message; }, }; -const baseVersionParams: object = { app_version: 0 }; +function createBaseVersionParams(): VersionParams { + return { app: 0 }; +} export const VersionParams = { - encode(message: VersionParams, writer: Writer = Writer.create()): Writer { - if (message.app_version !== 0) { - writer.uint32(8).uint64(message.app_version); + encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.app !== 0) { + writer.uint32(8).uint64(message.app); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): VersionParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVersionParams } as VersionParams; + const message = createBaseVersionParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.app_version = longToNumber(reader.uint64() as Long); + message.app = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -499,58 +378,49 @@ export const VersionParams = { }, fromJSON(object: any): VersionParams { - const message = { ...baseVersionParams } as VersionParams; - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = Number(object.app_version); - } else { - message.app_version = 0; - } - return message; + return { app: isSet(object.app) ? Number(object.app) : 0 }; }, toJSON(message: VersionParams): unknown { const obj: any = {}; - message.app_version !== undefined && - (obj.app_version = message.app_version); + message.app !== undefined && (obj.app = Math.round(message.app)); return obj; }, - fromPartial(object: DeepPartial): VersionParams { - const message = { ...baseVersionParams } as VersionParams; - if (object.app_version !== undefined && object.app_version !== null) { - message.app_version = object.app_version; - } else { - message.app_version = 0; - } + fromPartial, I>>(object: I): VersionParams { + const message = createBaseVersionParams(); + message.app = object.app ?? 0; return message; }, }; -const baseHashedParams: object = { block_max_bytes: 0, block_max_gas: 0 }; +function createBaseHashedParams(): HashedParams { + return { blockMaxBytes: 0, blockMaxGas: 0 }; +} export const HashedParams = { - encode(message: HashedParams, writer: Writer = Writer.create()): Writer { - if (message.block_max_bytes !== 0) { - writer.uint32(8).int64(message.block_max_bytes); + encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockMaxBytes !== 0) { + writer.uint32(8).int64(message.blockMaxBytes); } - if (message.block_max_gas !== 0) { - writer.uint32(16).int64(message.block_max_gas); + if (message.blockMaxGas !== 0) { + writer.uint32(16).int64(message.blockMaxGas); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HashedParams { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHashedParams } as HashedParams; + const message = createBaseHashedParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_max_bytes = longToNumber(reader.int64() as Long); + message.blockMaxBytes = longToNumber(reader.int64() as Long); break; case 2: - message.block_max_gas = longToNumber(reader.int64() as Long); + message.blockMaxGas = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -561,72 +431,57 @@ export const HashedParams = { }, fromJSON(object: any): HashedParams { - const message = { ...baseHashedParams } as HashedParams; - if ( - object.block_max_bytes !== undefined && - object.block_max_bytes !== null - ) { - message.block_max_bytes = Number(object.block_max_bytes); - } else { - message.block_max_bytes = 0; - } - if (object.block_max_gas !== undefined && object.block_max_gas !== null) { - message.block_max_gas = Number(object.block_max_gas); - } else { - message.block_max_gas = 0; - } - return message; + return { + blockMaxBytes: isSet(object.blockMaxBytes) ? Number(object.blockMaxBytes) : 0, + blockMaxGas: isSet(object.blockMaxGas) ? Number(object.blockMaxGas) : 0, + }; }, toJSON(message: HashedParams): unknown { const obj: any = {}; - message.block_max_bytes !== undefined && - (obj.block_max_bytes = message.block_max_bytes); - message.block_max_gas !== undefined && - (obj.block_max_gas = message.block_max_gas); + message.blockMaxBytes !== undefined && (obj.blockMaxBytes = Math.round(message.blockMaxBytes)); + message.blockMaxGas !== undefined && (obj.blockMaxGas = Math.round(message.blockMaxGas)); return obj; }, - fromPartial(object: DeepPartial): HashedParams { - const message = { ...baseHashedParams } as HashedParams; - if ( - object.block_max_bytes !== undefined && - object.block_max_bytes !== null - ) { - message.block_max_bytes = object.block_max_bytes; - } else { - message.block_max_bytes = 0; - } - if (object.block_max_gas !== undefined && object.block_max_gas !== null) { - message.block_max_gas = object.block_max_gas; - } else { - message.block_max_gas = 0; - } + fromPartial, I>>(object: I): HashedParams { + const message = createBaseHashedParams(); + message.blockMaxBytes = object.blockMaxBytes ?? 0; + message.blockMaxGas = object.blockMaxGas ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -634,7 +489,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/types.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/types.ts index 729e016de7..19f6a749c7 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/types.ts @@ -1,11 +1,11 @@ //@ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Proof } from "../../tendermint/crypto/proof"; -import { Consensus } from "../../tendermint/version/types"; -import { ValidatorSet } from "../../tendermint/types/validator"; +import { Proof } from "../crypto/proof"; +import { Consensus } from "../version/types"; +import { ValidatorSet } from "./validator"; export const protobufPackage = "tendermint.types"; @@ -49,8 +49,9 @@ export function blockIDFlagToJSON(object: BlockIDFlag): string { return "BLOCK_ID_FLAG_COMMIT"; case BlockIDFlag.BLOCK_ID_FLAG_NIL: return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -96,8 +97,9 @@ export function signedMsgTypeToJSON(object: SignedMsgType): string { return "SIGNED_MSG_TYPE_PRECOMMIT"; case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: return "SIGNED_MSG_TYPE_PROPOSAL"; + case SignedMsgType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -116,36 +118,40 @@ export interface Part { /** BlockID */ export interface BlockID { hash: Uint8Array; - part_set_header: PartSetHeader | undefined; + partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; - chain_id: string; + chainId: string; height: number; - time: Date | undefined; + time: + | Date + | undefined; /** prev block info */ - last_block_id: BlockID | undefined; + lastBlockId: + | BlockID + | undefined; /** hashes of block data */ - last_commit_hash: Uint8Array; + lastCommitHash: Uint8Array; /** transactions */ - data_hash: Uint8Array; + dataHash: Uint8Array; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validatorsHash: Uint8Array; /** validators for the next block */ - next_validators_hash: Uint8Array; + nextValidatorsHash: Uint8Array; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensusHash: Uint8Array; /** state after txs from the previous block */ - app_hash: Uint8Array; + appHash: Uint8Array; /** root hash of all results from the txs from the previous block */ - last_results_hash: Uint8Array; + lastResultsHash: Uint8Array; /** consensus info */ - evidence_hash: Uint8Array; + evidenceHash: Uint8Array; /** original proposer of the block */ - proposer_address: Uint8Array; + proposerAddress: Uint8Array; } /** Data contains the set of transactions included in the block */ @@ -167,10 +173,10 @@ export interface Vote { height: number; round: number; /** zero if vote is nil. */ - block_id: BlockID | undefined; + blockId: BlockID | undefined; timestamp: Date | undefined; - validator_address: Uint8Array; - validator_index: number; + validatorAddress: Uint8Array; + validatorIndex: number; signature: Uint8Array; } @@ -178,14 +184,14 @@ export interface Vote { export interface Commit { height: number; round: number; - block_id: BlockID | undefined; + blockId: BlockID | undefined; signatures: CommitSig[]; } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSig { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; timestamp: Date | undefined; signature: Uint8Array; } @@ -194,8 +200,8 @@ export interface Proposal { type: SignedMsgType; height: number; round: number; - pol_round: number; - block_id: BlockID | undefined; + polRound: number; + blockId: BlockID | undefined; timestamp: Date | undefined; signature: Uint8Array; } @@ -206,28 +212,30 @@ export interface SignedHeader { } export interface LightBlock { - signed_header: SignedHeader | undefined; - validator_set: ValidatorSet | undefined; + signedHeader: SignedHeader | undefined; + validatorSet: ValidatorSet | undefined; } export interface BlockMeta { - block_id: BlockID | undefined; - block_size: number; + blockId: BlockID | undefined; + blockSize: number; header: Header | undefined; - num_txs: number; + numTxs: number; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { - root_hash: Uint8Array; + rootHash: Uint8Array; data: Uint8Array; proof: Proof | undefined; } -const basePartSetHeader: object = { total: 0 }; +function createBasePartSetHeader(): PartSetHeader { + return { total: 0, hash: new Uint8Array() }; +} export const PartSetHeader = { - encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer { + encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.total !== 0) { writer.uint32(8).uint32(message.total); } @@ -237,10 +245,10 @@ export const PartSetHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePartSetHeader } as PartSetHeader; + const message = createBasePartSetHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -259,48 +267,34 @@ export const PartSetHeader = { }, fromJSON(object: any): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; + return { + total: isSet(object.total) ? Number(object.total) : 0, + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + }; }, toJSON(message: PartSetHeader): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = message.total); - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); + message.total !== undefined && (obj.total = Math.round(message.total)); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): PartSetHeader { - const message = { ...basePartSetHeader } as PartSetHeader; - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } + fromPartial, I>>(object: I): PartSetHeader { + const message = createBasePartSetHeader(); + message.total = object.total ?? 0; + message.hash = object.hash ?? new Uint8Array(); return message; }, }; -const basePart: object = { index: 0 }; +function createBasePart(): Part { + return { index: 0, bytes: new Uint8Array(), proof: undefined }; +} export const Part = { - encode(message: Part, writer: Writer = Writer.create()): Writer { + encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -313,10 +307,10 @@ export const Part = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Part { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Part { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePart } as Part; + const message = createBasePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -338,76 +332,50 @@ export const Part = { }, fromJSON(object: any): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + index: isSet(object.index) ? Number(object.index) : 0, + bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: Part): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.bytes !== undefined && - (obj.bytes = base64FromBytes( - message.bytes !== undefined ? message.bytes : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.index !== undefined && (obj.index = Math.round(message.index)); + message.bytes !== undefined + && (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): Part { - const message = { ...basePart } as Part; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = object.bytes; - } else { - message.bytes = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): Part { + const message = createBasePart(); + message.index = object.index ?? 0; + message.bytes = object.bytes ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; return message; }, }; -const baseBlockID: object = {}; +function createBaseBlockID(): BlockID { + return { hash: new Uint8Array(), partSetHeader: undefined }; +} export const BlockID = { - encode(message: BlockID, writer: Writer = Writer.create()): Writer { + encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } - if (message.part_set_header !== undefined) { - PartSetHeader.encode( - message.part_set_header, - writer.uint32(18).fork() - ).ldelim(); + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockID } as BlockID; + const message = createBaseBlockID(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -415,10 +383,7 @@ export const BlockID = { message.hash = reader.bytes(); break; case 2: - message.part_set_header = PartSetHeader.decode( - reader, - reader.uint32() - ); + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -429,111 +394,101 @@ export const BlockID = { }, fromJSON(object: any): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromJSON(object.part_set_header); - } else { - message.part_set_header = undefined; - } - return message; + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + partSetHeader: isSet(object.partSetHeader) ? PartSetHeader.fromJSON(object.partSetHeader) : undefined, + }; }, toJSON(message: BlockID): unknown { const obj: any = {}; - message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array() - )); - message.part_set_header !== undefined && - (obj.part_set_header = message.part_set_header - ? PartSetHeader.toJSON(message.part_set_header) - : undefined); + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined + && (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); return obj; }, - fromPartial(object: DeepPartial): BlockID { - const message = { ...baseBlockID } as BlockID; - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } else { - message.hash = new Uint8Array(); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.part_set_header = PartSetHeader.fromPartial( - object.part_set_header - ); - } else { - message.part_set_header = undefined; - } + fromPartial, I>>(object: I): BlockID { + const message = createBaseBlockID(); + message.hash = object.hash ?? new Uint8Array(); + message.partSetHeader = (object.partSetHeader !== undefined && object.partSetHeader !== null) + ? PartSetHeader.fromPartial(object.partSetHeader) + : undefined; return message; }, }; -const baseHeader: object = { chain_id: "", height: 0 }; +function createBaseHeader(): Header { + return { + version: undefined, + chainId: "", + height: 0, + time: undefined, + lastBlockId: undefined, + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: new Uint8Array(), + }; +} export const Header = { - encode(message: Header, writer: Writer = Writer.create()): Writer { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } - if (message.chain_id !== "") { - writer.uint32(18).string(message.chain_id); + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); } if (message.height !== 0) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(34).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); } - if (message.last_block_id !== undefined) { - BlockID.encode(message.last_block_id, writer.uint32(42).fork()).ldelim(); + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); } - if (message.last_commit_hash.length !== 0) { - writer.uint32(50).bytes(message.last_commit_hash); + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); } - if (message.data_hash.length !== 0) { - writer.uint32(58).bytes(message.data_hash); + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); } - if (message.validators_hash.length !== 0) { - writer.uint32(66).bytes(message.validators_hash); + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); } - if (message.next_validators_hash.length !== 0) { - writer.uint32(74).bytes(message.next_validators_hash); + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); } - if (message.consensus_hash.length !== 0) { - writer.uint32(82).bytes(message.consensus_hash); + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); } - if (message.app_hash.length !== 0) { - writer.uint32(90).bytes(message.app_hash); + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); } - if (message.last_results_hash.length !== 0) { - writer.uint32(98).bytes(message.last_results_hash); + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); } - if (message.evidence_hash.length !== 0) { - writer.uint32(106).bytes(message.evidence_hash); + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); } - if (message.proposer_address.length !== 0) { - writer.uint32(114).bytes(message.proposer_address); + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Header { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHeader } as Header; + const message = createBaseHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -541,45 +496,43 @@ export const Header = { message.version = Consensus.decode(reader, reader.uint32()); break; case 2: - message.chain_id = reader.string(); + message.chainId = reader.string(); break; case 3: message.height = longToNumber(reader.int64() as Long); break; case 4: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 5: - message.last_block_id = BlockID.decode(reader, reader.uint32()); + message.lastBlockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.last_commit_hash = reader.bytes(); + message.lastCommitHash = reader.bytes(); break; case 7: - message.data_hash = reader.bytes(); + message.dataHash = reader.bytes(); break; case 8: - message.validators_hash = reader.bytes(); + message.validatorsHash = reader.bytes(); break; case 9: - message.next_validators_hash = reader.bytes(); + message.nextValidatorsHash = reader.bytes(); break; case 10: - message.consensus_hash = reader.bytes(); + message.consensusHash = reader.bytes(); break; case 11: - message.app_hash = reader.bytes(); + message.appHash = reader.bytes(); break; case 12: - message.last_results_hash = reader.bytes(); + message.lastResultsHash = reader.bytes(); break; case 13: - message.evidence_hash = reader.bytes(); + message.evidenceHash = reader.bytes(); break; case 14: - message.proposer_address = reader.bytes(); + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -590,253 +543,109 @@ export const Header = { }, fromJSON(object: any): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromJSON(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = String(object.chain_id); - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromJSON(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = bytesFromBase64( - object.next_validators_hash - ); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = bytesFromBase64(object.proposer_address); - } - return message; + return { + version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + height: isSet(object.height) ? Number(object.height) : 0, + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + lastBlockId: isSet(object.lastBlockId) ? BlockID.fromJSON(object.lastBlockId) : undefined, + lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(), + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(), + nextValidatorsHash: isSet(object.nextValidatorsHash) + ? bytesFromBase64(object.nextValidatorsHash) + : new Uint8Array(), + consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(), + appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(), + lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(), + evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(), + }; }, toJSON(message: Header): unknown { const obj: any = {}; - message.version !== undefined && - (obj.version = message.version - ? Consensus.toJSON(message.version) - : undefined); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - message.height !== undefined && (obj.height = message.height); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.last_block_id !== undefined && - (obj.last_block_id = message.last_block_id - ? BlockID.toJSON(message.last_block_id) - : undefined); - message.last_commit_hash !== undefined && - (obj.last_commit_hash = base64FromBytes( - message.last_commit_hash !== undefined - ? message.last_commit_hash - : new Uint8Array() - )); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() + message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.lastBlockId !== undefined + && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined + && (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), )); - message.validators_hash !== undefined && - (obj.validators_hash = base64FromBytes( - message.validators_hash !== undefined - ? message.validators_hash - : new Uint8Array() + message.dataHash !== undefined + && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined + && (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), )); - message.next_validators_hash !== undefined && - (obj.next_validators_hash = base64FromBytes( - message.next_validators_hash !== undefined - ? message.next_validators_hash - : new Uint8Array() + message.nextValidatorsHash !== undefined + && (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), )); - message.consensus_hash !== undefined && - (obj.consensus_hash = base64FromBytes( - message.consensus_hash !== undefined - ? message.consensus_hash - : new Uint8Array() + message.consensusHash !== undefined + && (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), )); - message.app_hash !== undefined && - (obj.app_hash = base64FromBytes( - message.app_hash !== undefined ? message.app_hash : new Uint8Array() + message.appHash !== undefined + && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined + && (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), )); - message.last_results_hash !== undefined && - (obj.last_results_hash = base64FromBytes( - message.last_results_hash !== undefined - ? message.last_results_hash - : new Uint8Array() + message.evidenceHash !== undefined + && (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), )); - message.evidence_hash !== undefined && - (obj.evidence_hash = base64FromBytes( - message.evidence_hash !== undefined - ? message.evidence_hash - : new Uint8Array() - )); - message.proposer_address !== undefined && - (obj.proposer_address = base64FromBytes( - message.proposer_address !== undefined - ? message.proposer_address - : new Uint8Array() + message.proposerAddress !== undefined + && (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), )); return obj; }, - fromPartial(object: DeepPartial
): Header { - const message = { ...baseHeader } as Header; - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromPartial(object.version); - } else { - message.version = undefined; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = ""; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.last_block_id = BlockID.fromPartial(object.last_block_id); - } else { - message.last_block_id = undefined; - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.last_commit_hash = object.last_commit_hash; - } else { - message.last_commit_hash = new Uint8Array(); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validators_hash = object.validators_hash; - } else { - message.validators_hash = new Uint8Array(); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.next_validators_hash = object.next_validators_hash; - } else { - message.next_validators_hash = new Uint8Array(); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensus_hash = object.consensus_hash; - } else { - message.consensus_hash = new Uint8Array(); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.app_hash = object.app_hash; - } else { - message.app_hash = new Uint8Array(); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.last_results_hash = object.last_results_hash; - } else { - message.last_results_hash = new Uint8Array(); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidence_hash = object.evidence_hash; - } else { - message.evidence_hash = new Uint8Array(); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposer_address = object.proposer_address; - } else { - message.proposer_address = new Uint8Array(); - } + fromPartial, I>>(object: I): Header { + const message = createBaseHeader(); + message.version = (object.version !== undefined && object.version !== null) + ? Consensus.fromPartial(object.version) + : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height ?? 0; + message.time = object.time ?? undefined; + message.lastBlockId = (object.lastBlockId !== undefined && object.lastBlockId !== null) + ? BlockID.fromPartial(object.lastBlockId) + : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, }; -const baseData: object = {}; +function createBaseData(): Data { + return { txs: [] }; +} export const Data = { - encode(message: Data, writer: Writer = Writer.create()): Writer { + encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Data { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseData } as Data; - message.txs = []; + const message = createBaseData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -852,44 +661,41 @@ export const Data = { }, fromJSON(object: any): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(bytesFromBase64(e)); - } - } - return message; + return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] }; }, toJSON(message: Data): unknown { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.txs = []; } return obj; }, - fromPartial(object: DeepPartial): Data { - const message = { ...baseData } as Data; - message.txs = []; - if (object.txs !== undefined && object.txs !== null) { - for (const e of object.txs) { - message.txs.push(e); - } - } + fromPartial, I>>(object: I): Data { + const message = createBaseData(); + message.txs = object.txs?.map((e) => e) || []; return message; }, }; -const baseVote: object = { type: 0, height: 0, round: 0, validator_index: 0 }; +function createBaseVote(): Vote { + return { + type: 0, + height: 0, + round: 0, + blockId: undefined, + timestamp: undefined, + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array(), + }; +} export const Vote = { - encode(message: Vote, writer: Writer = Writer.create()): Writer { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -899,20 +705,17 @@ export const Vote = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(34).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(42).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); } - if (message.validator_address.length !== 0) { - writer.uint32(50).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); } - if (message.validator_index !== 0) { - writer.uint32(56).int32(message.validator_index); + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); } if (message.signature.length !== 0) { writer.uint32(66).bytes(message.signature); @@ -920,10 +723,10 @@ export const Vote = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseVote } as Vote; + const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -937,18 +740,16 @@ export const Vote = { message.round = reader.int32(); break; case 4: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 5: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 6: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 7: - message.validator_index = reader.int32(); + message.validatorIndex = reader.int32(); break; case 8: message.signature = reader.bytes(); @@ -962,146 +763,65 @@ export const Vote = { }, fromJSON(object: any): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = Number(object.validator_index); - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + validatorIndex: isSet(object.validatorIndex) ? Number(object.validatorIndex) : 0, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Vote): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.validator_index !== undefined && - (obj.validator_index = message.validator_index); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.validatorIndex !== undefined && (obj.validatorIndex = Math.round(message.validatorIndex)); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Vote { - const message = { ...baseVote } as Vote; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validator_index = object.validator_index; - } else { - message.validator_index = 0; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Vote { + const message = createBaseVote(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.validatorIndex = object.validatorIndex ?? 0; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseCommit: object = { height: 0, round: 0 }; +function createBaseCommit(): Commit { + return { height: 0, round: 0, blockId: undefined, signatures: [] }; +} export const Commit = { - encode(message: Commit, writer: Writer = Writer.create()): Writer { + encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } if (message.round !== 0) { writer.uint32(16).int32(message.round); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(26).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); } for (const v of message.signatures) { CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); @@ -1109,11 +829,10 @@ export const Commit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Commit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommit } as Commit; - message.signatures = []; + const message = createBaseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1124,7 +843,7 @@ export const Commit = { message.round = reader.int32(); break; case 3: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 4: message.signatures.push(CommitSig.decode(reader, reader.uint32())); @@ -1138,91 +857,53 @@ export const Commit = { }, fromJSON(object: any): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromJSON(e)); - } - } - return message; + return { + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromJSON(e)) : [], + }; }, toJSON(message: Commit): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); if (message.signatures) { - obj.signatures = message.signatures.map((e) => - e ? CommitSig.toJSON(e) : undefined - ); + obj.signatures = message.signatures.map((e) => e ? CommitSig.toJSON(e) : undefined); } else { obj.signatures = []; } return obj; }, - fromPartial(object: DeepPartial): Commit { - const message = { ...baseCommit } as Commit; - message.signatures = []; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.signatures !== undefined && object.signatures !== null) { - for (const e of object.signatures) { - message.signatures.push(CommitSig.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Commit { + const message = createBaseCommit(); + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.signatures = object.signatures?.map((e) => CommitSig.fromPartial(e)) || []; return message; }, }; -const baseCommitSig: object = { block_id_flag: 0 }; +function createBaseCommitSig(): CommitSig { + return { blockIdFlag: 0, validatorAddress: new Uint8Array(), timestamp: undefined, signature: new Uint8Array() }; +} export const CommitSig = { - encode(message: CommitSig, writer: Writer = Writer.create()): Writer { - if (message.block_id_flag !== 0) { - writer.uint32(8).int32(message.block_id_flag); + encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); } - if (message.validator_address.length !== 0) { - writer.uint32(18).bytes(message.validator_address); + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(26).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(34).bytes(message.signature); @@ -1230,23 +911,21 @@ export const CommitSig = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCommitSig } as CommitSig; + const message = createBaseCommitSig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id_flag = reader.int32() as any; + message.blockIdFlag = reader.int32() as any; break; case 2: - message.validator_address = reader.bytes(); + message.validatorAddress = reader.bytes(); break; case 3: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 4: message.signature = reader.bytes(); @@ -1260,84 +939,51 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = blockIDFlagFromJSON(object.block_id_flag); - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: CommitSig): unknown { const obj: any = {}; - message.block_id_flag !== undefined && - (obj.block_id_flag = blockIDFlagToJSON(message.block_id_flag)); - message.validator_address !== undefined && - (obj.validator_address = base64FromBytes( - message.validator_address !== undefined - ? message.validator_address - : new Uint8Array() - )); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() + message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + message.validatorAddress !== undefined + && (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), )); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): CommitSig { - const message = { ...baseCommitSig } as CommitSig; - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.block_id_flag = object.block_id_flag; - } else { - message.block_id_flag = 0; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = new Uint8Array(); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): CommitSig { + const message = createBaseCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseProposal: object = { type: 0, height: 0, round: 0, pol_round: 0 }; +function createBaseProposal(): Proposal { + return { + type: 0, + height: 0, + round: 0, + polRound: 0, + blockId: undefined, + timestamp: undefined, + signature: new Uint8Array(), + }; +} export const Proposal = { - encode(message: Proposal, writer: Writer = Writer.create()): Writer { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -1347,17 +993,14 @@ export const Proposal = { if (message.round !== 0) { writer.uint32(24).int32(message.round); } - if (message.pol_round !== 0) { - writer.uint32(32).int32(message.pol_round); + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); } - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(42).fork()).ldelim(); + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); } if (message.timestamp !== undefined) { - Timestamp.encode( - toTimestamp(message.timestamp), - writer.uint32(50).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); } if (message.signature.length !== 0) { writer.uint32(58).bytes(message.signature); @@ -1365,10 +1008,10 @@ export const Proposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseProposal } as Proposal; + const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1382,15 +1025,13 @@ export const Proposal = { message.round = reader.int32(); break; case 4: - message.pol_round = reader.int32(); + message.polRound = reader.int32(); break; case 5: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 6: - message.timestamp = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: message.signature = reader.bytes(); @@ -1404,111 +1045,51 @@ export const Proposal = { }, fromJSON(object: any): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = signedMsgTypeFromJSON(object.type); - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = Number(object.round); - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = Number(object.pol_round); - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromJsonTimestamp(object.timestamp); - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + height: isSet(object.height) ? Number(object.height) : 0, + round: isSet(object.round) ? Number(object.round) : 0, + polRound: isSet(object.polRound) ? Number(object.polRound) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.type !== undefined && - (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = message.height); - message.round !== undefined && (obj.round = message.round); - message.pol_round !== undefined && (obj.pol_round = message.pol_round); - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.timestamp !== undefined && - (obj.timestamp = - message.timestamp !== undefined - ? message.timestamp.toISOString() - : null); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.round !== undefined && (obj.round = Math.round(message.round)); + message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Proposal { - const message = { ...baseProposal } as Proposal; - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 0; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } else { - message.round = 0; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.pol_round = object.pol_round; - } else { - message.pol_round = 0; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } else { - message.timestamp = undefined; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } + fromPartial, I>>(object: I): Proposal { + const message = createBaseProposal(); + message.type = object.type ?? 0; + message.height = object.height ?? 0; + message.round = object.round ?? 0; + message.polRound = object.polRound ?? 0; + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); return message; }, }; -const baseSignedHeader: object = {}; +function createBaseSignedHeader(): SignedHeader { + return { header: undefined, commit: undefined }; +} export const SignedHeader = { - encode(message: SignedHeader, writer: Writer = Writer.create()): Writer { + encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -1518,10 +1099,10 @@ export const SignedHeader = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSignedHeader } as SignedHeader; + const message = createBaseSignedHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1540,76 +1121,58 @@ export const SignedHeader = { }, fromJSON(object: any): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromJSON(object.commit); - } else { - message.commit = undefined; - } - return message; + return { + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + commit: isSet(object.commit) ? Commit.fromJSON(object.commit) : undefined, + }; }, toJSON(message: SignedHeader): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.commit !== undefined && - (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); return obj; }, - fromPartial(object: DeepPartial): SignedHeader { - const message = { ...baseSignedHeader } as SignedHeader; - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromPartial(object.commit); - } else { - message.commit = undefined; - } + fromPartial, I>>(object: I): SignedHeader { + const message = createBaseSignedHeader(); + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.commit = (object.commit !== undefined && object.commit !== null) + ? Commit.fromPartial(object.commit) + : undefined; return message; }, }; -const baseLightBlock: object = {}; +function createBaseLightBlock(): LightBlock { + return { signedHeader: undefined, validatorSet: undefined }; +} export const LightBlock = { - encode(message: LightBlock, writer: Writer = Writer.create()): Writer { - if (message.signed_header !== undefined) { - SignedHeader.encode( - message.signed_header, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.validator_set !== undefined) { - ValidatorSet.encode( - message.validator_set, - writer.uint32(18).fork() - ).ldelim(); + encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLightBlock } as LightBlock; + const message = createBaseLightBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signed_header = SignedHeader.decode(reader, reader.uint32()); + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); break; case 2: - message.validator_set = ValidatorSet.decode(reader, reader.uint32()); + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1620,86 +1183,72 @@ export const LightBlock = { }, fromJSON(object: any): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromJSON(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromJSON(object.validator_set); - } else { - message.validator_set = undefined; - } - return message; + return { + signedHeader: isSet(object.signedHeader) ? SignedHeader.fromJSON(object.signedHeader) : undefined, + validatorSet: isSet(object.validatorSet) ? ValidatorSet.fromJSON(object.validatorSet) : undefined, + }; }, toJSON(message: LightBlock): unknown { const obj: any = {}; - message.signed_header !== undefined && - (obj.signed_header = message.signed_header - ? SignedHeader.toJSON(message.signed_header) - : undefined); - message.validator_set !== undefined && - (obj.validator_set = message.validator_set - ? ValidatorSet.toJSON(message.validator_set) - : undefined); + message.signedHeader !== undefined + && (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined + && (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); return obj; }, - fromPartial(object: DeepPartial): LightBlock { - const message = { ...baseLightBlock } as LightBlock; - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signed_header = SignedHeader.fromPartial(object.signed_header); - } else { - message.signed_header = undefined; - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validator_set = ValidatorSet.fromPartial(object.validator_set); - } else { - message.validator_set = undefined; - } + fromPartial, I>>(object: I): LightBlock { + const message = createBaseLightBlock(); + message.signedHeader = (object.signedHeader !== undefined && object.signedHeader !== null) + ? SignedHeader.fromPartial(object.signedHeader) + : undefined; + message.validatorSet = (object.validatorSet !== undefined && object.validatorSet !== null) + ? ValidatorSet.fromPartial(object.validatorSet) + : undefined; return message; }, }; -const baseBlockMeta: object = { block_size: 0, num_txs: 0 }; +function createBaseBlockMeta(): BlockMeta { + return { blockId: undefined, blockSize: 0, header: undefined, numTxs: 0 }; +} export const BlockMeta = { - encode(message: BlockMeta, writer: Writer = Writer.create()): Writer { - if (message.block_id !== undefined) { - BlockID.encode(message.block_id, writer.uint32(10).fork()).ldelim(); + encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } - if (message.block_size !== 0) { - writer.uint32(16).int64(message.block_size); + if (message.blockSize !== 0) { + writer.uint32(16).int64(message.blockSize); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(26).fork()).ldelim(); } - if (message.num_txs !== 0) { - writer.uint32(32).int64(message.num_txs); + if (message.numTxs !== 0) { + writer.uint32(32).int64(message.numTxs); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBlockMeta } as BlockMeta; + const message = createBaseBlockMeta(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_id = BlockID.decode(reader, reader.uint32()); + message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.block_size = longToNumber(reader.int64() as Long); + message.blockSize = longToNumber(reader.int64() as Long); break; case 3: message.header = Header.decode(reader, reader.uint32()); break; case 4: - message.num_txs = longToNumber(reader.int64() as Long); + message.numTxs = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -1710,75 +1259,45 @@ export const BlockMeta = { }, fromJSON(object: any): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromJSON(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = Number(object.block_size); - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromJSON(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = Number(object.num_txs); - } else { - message.num_txs = 0; - } - return message; + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + blockSize: isSet(object.blockSize) ? Number(object.blockSize) : 0, + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + numTxs: isSet(object.numTxs) ? Number(object.numTxs) : 0, + }; }, toJSON(message: BlockMeta): unknown { const obj: any = {}; - message.block_id !== undefined && - (obj.block_id = message.block_id - ? BlockID.toJSON(message.block_id) - : undefined); - message.block_size !== undefined && (obj.block_size = message.block_size); - message.header !== undefined && - (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.num_txs !== undefined && (obj.num_txs = message.num_txs); + message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.blockSize !== undefined && (obj.blockSize = Math.round(message.blockSize)); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = Math.round(message.numTxs)); return obj; }, - fromPartial(object: DeepPartial): BlockMeta { - const message = { ...baseBlockMeta } as BlockMeta; - if (object.block_id !== undefined && object.block_id !== null) { - message.block_id = BlockID.fromPartial(object.block_id); - } else { - message.block_id = undefined; - } - if (object.block_size !== undefined && object.block_size !== null) { - message.block_size = object.block_size; - } else { - message.block_size = 0; - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromPartial(object.header); - } else { - message.header = undefined; - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.num_txs = object.num_txs; - } else { - message.num_txs = 0; - } + fromPartial, I>>(object: I): BlockMeta { + const message = createBaseBlockMeta(); + message.blockId = (object.blockId !== undefined && object.blockId !== null) + ? BlockID.fromPartial(object.blockId) + : undefined; + message.blockSize = object.blockSize ?? 0; + message.header = (object.header !== undefined && object.header !== null) + ? Header.fromPartial(object.header) + : undefined; + message.numTxs = object.numTxs ?? 0; return message; }, }; -const baseTxProof: object = {}; +function createBaseTxProof(): TxProof { + return { rootHash: new Uint8Array(), data: new Uint8Array(), proof: undefined }; +} export const TxProof = { - encode(message: TxProof, writer: Writer = Writer.create()): Writer { - if (message.root_hash.length !== 0) { - writer.uint32(10).bytes(message.root_hash); + encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -1789,15 +1308,15 @@ export const TxProof = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTxProof } as TxProof; + const message = createBaseTxProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.root_hash = reader.bytes(); + message.rootHash = reader.bytes(); break; case 2: message.data = reader.bytes(); @@ -1814,101 +1333,87 @@ export const TxProof = { }, fromJSON(object: any): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromJSON(object.proof); - } else { - message.proof = undefined; - } - return message; + return { + rootHash: isSet(object.rootHash) ? bytesFromBase64(object.rootHash) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : undefined, + }; }, toJSON(message: TxProof): unknown { const obj: any = {}; - message.root_hash !== undefined && - (obj.root_hash = base64FromBytes( - message.root_hash !== undefined ? message.root_hash : new Uint8Array() - )); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - message.proof !== undefined && - (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + message.rootHash !== undefined + && (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial(object: DeepPartial): TxProof { - const message = { ...baseTxProof } as TxProof; - if (object.root_hash !== undefined && object.root_hash !== null) { - message.root_hash = object.root_hash; - } else { - message.root_hash = new Uint8Array(); - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromPartial(object.proof); - } else { - message.proof = undefined; - } + fromPartial, I>>(object: I): TxProof { + const message = createBaseTxProof(); + message.rootHash = object.rootHash ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.proof = (object.proof !== undefined && object.proof !== null) ? Proof.fromPartial(object.proof) : undefined; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -1938,7 +1443,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/validator.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/validator.ts index d1375eb3f0..f7c906ca4c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/validator.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/types/validator.ts @@ -1,50 +1,51 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { PublicKey } from "../../tendermint/crypto/keys"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PublicKey } from "../crypto/keys"; export const protobufPackage = "tendermint.types"; export interface ValidatorSet { validators: Validator[]; proposer: Validator | undefined; - total_voting_power: number; + totalVotingPower: number; } export interface Validator { address: Uint8Array; - pub_key: PublicKey | undefined; - voting_power: number; - proposer_priority: number; + pubKey: PublicKey | undefined; + votingPower: number; + proposerPriority: number; } export interface SimpleValidator { - pub_key: PublicKey | undefined; - voting_power: number; + pubKey: PublicKey | undefined; + votingPower: number; } -const baseValidatorSet: object = { total_voting_power: 0 }; +function createBaseValidatorSet(): ValidatorSet { + return { validators: [], proposer: undefined, totalVotingPower: 0 }; +} export const ValidatorSet = { - encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer { + encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.proposer !== undefined) { Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); } - if (message.total_voting_power !== 0) { - writer.uint32(24).int64(message.total_voting_power); + if (message.totalVotingPower !== 0) { + writer.uint32(24).int64(message.totalVotingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; + const message = createBaseValidatorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -55,7 +56,7 @@ export const ValidatorSet = { message.proposer = Validator.decode(reader, reader.uint32()); break; case 3: - message.total_voting_power = longToNumber(reader.int64() as Long); + message.totalVotingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -66,95 +67,62 @@ export const ValidatorSet = { }, fromJSON(object: any): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromJSON(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromJSON(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = Number(object.total_voting_power); - } else { - message.total_voting_power = 0; - } - return message; + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [], + proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0, + }; }, toJSON(message: ValidatorSet): unknown { const obj: any = {}; if (message.validators) { - obj.validators = message.validators.map((e) => - e ? Validator.toJSON(e) : undefined - ); + obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined); } else { obj.validators = []; } - message.proposer !== undefined && - (obj.proposer = message.proposer - ? Validator.toJSON(message.proposer) - : undefined); - message.total_voting_power !== undefined && - (obj.total_voting_power = message.total_voting_power); + message.proposer !== undefined + && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower)); return obj; }, - fromPartial(object: DeepPartial): ValidatorSet { - const message = { ...baseValidatorSet } as ValidatorSet; - message.validators = []; - if (object.validators !== undefined && object.validators !== null) { - for (const e of object.validators) { - message.validators.push(Validator.fromPartial(e)); - } - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromPartial(object.proposer); - } else { - message.proposer = undefined; - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.total_voting_power = object.total_voting_power; - } else { - message.total_voting_power = 0; - } + fromPartial, I>>(object: I): ValidatorSet { + const message = createBaseValidatorSet(); + message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; + message.proposer = (object.proposer !== undefined && object.proposer !== null) + ? Validator.fromPartial(object.proposer) + : undefined; + message.totalVotingPower = object.totalVotingPower ?? 0; return message; }, }; -const baseValidator: object = { voting_power: 0, proposer_priority: 0 }; +function createBaseValidator(): Validator { + return { address: new Uint8Array(), pubKey: undefined, votingPower: 0, proposerPriority: 0 }; +} export const Validator = { - encode(message: Validator, writer: Writer = Writer.create()): Writer { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(24).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(24).int64(message.votingPower); } - if (message.proposer_priority !== 0) { - writer.uint32(32).int64(message.proposer_priority); + if (message.proposerPriority !== 0) { + writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseValidator } as Validator; + const message = createBaseValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -162,13 +130,13 @@ export const Validator = { message.address = reader.bytes(); break; case 2: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 3: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; case 4: - message.proposer_priority = longToNumber(reader.int64() as Long); + message.proposerPriority = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -179,102 +147,63 @@ export const Validator = { }, fromJSON(object: any): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = Number(object.proposer_priority); - } else { - message.proposer_priority = 0; - } - return message; + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0, + }; }, toJSON(message: Validator): unknown { const obj: any = {}; - message.address !== undefined && - (obj.address = base64FromBytes( - message.address !== undefined ? message.address : new Uint8Array() - )); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); - message.proposer_priority !== undefined && - (obj.proposer_priority = message.proposer_priority); + message.address !== undefined + && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); + message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority)); return obj; }, - fromPartial(object: DeepPartial): Validator { - const message = { ...baseValidator } as Validator; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = new Uint8Array(); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposer_priority = object.proposer_priority; - } else { - message.proposer_priority = 0; - } + fromPartial, I>>(object: I): Validator { + const message = createBaseValidator(); + message.address = object.address ?? new Uint8Array(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 0; + message.proposerPriority = object.proposerPriority ?? 0; return message; }, }; -const baseSimpleValidator: object = { voting_power: 0 }; +function createBaseSimpleValidator(): SimpleValidator { + return { pubKey: undefined, votingPower: 0 }; +} export const SimpleValidator = { - encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer { - if (message.pub_key !== undefined) { - PublicKey.encode(message.pub_key, writer.uint32(10).fork()).ldelim(); + encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (message.voting_power !== 0) { - writer.uint32(16).int64(message.voting_power); + if (message.votingPower !== 0) { + writer.uint32(16).int64(message.votingPower); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSimpleValidator } as SimpleValidator; + const message = createBaseSimpleValidator(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pub_key = PublicKey.decode(reader, reader.uint32()); + message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.voting_power = longToNumber(reader.int64() as Long); + message.votingPower = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -285,91 +214,84 @@ export const SimpleValidator = { }, fromJSON(object: any): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = Number(object.voting_power); - } else { - message.voting_power = 0; - } - return message; + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0, + }; }, toJSON(message: SimpleValidator): unknown { const obj: any = {}; - message.pub_key !== undefined && - (obj.pub_key = message.pub_key - ? PublicKey.toJSON(message.pub_key) - : undefined); - message.voting_power !== undefined && - (obj.voting_power = message.voting_power); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower)); return obj; }, - fromPartial(object: DeepPartial): SimpleValidator { - const message = { ...baseSimpleValidator } as SimpleValidator; - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = PublicKey.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.voting_power = object.voting_power; - } else { - message.voting_power = 0; - } + fromPartial, I>>(object: I): SimpleValidator { + const message = createBaseSimpleValidator(); + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? PublicKey.fromPartial(object.pubKey) + : undefined; + message.votingPower = object.votingPower ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -377,7 +299,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/version/types.ts b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/version/types.ts index e40744b8e8..501ddcdb86 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/version/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.tx.v1beta1/types/tendermint/version/types.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.version"; @@ -25,10 +25,12 @@ export interface Consensus { app: number; } -const baseApp: object = { protocol: 0, software: "" }; +function createBaseApp(): App { + return { protocol: 0, software: "" }; +} export const App = { - encode(message: App, writer: Writer = Writer.create()): Writer { + encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.protocol !== 0) { writer.uint32(8).uint64(message.protocol); } @@ -38,10 +40,10 @@ export const App = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): App { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): App { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseApp } as App; + const message = createBaseApp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -60,47 +62,33 @@ export const App = { }, fromJSON(object: any): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Number(object.protocol); - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = String(object.software); - } else { - message.software = ""; - } - return message; + return { + protocol: isSet(object.protocol) ? Number(object.protocol) : 0, + software: isSet(object.software) ? String(object.software) : "", + }; }, toJSON(message: App): unknown { const obj: any = {}; - message.protocol !== undefined && (obj.protocol = message.protocol); + message.protocol !== undefined && (obj.protocol = Math.round(message.protocol)); message.software !== undefined && (obj.software = message.software); return obj; }, - fromPartial(object: DeepPartial): App { - const message = { ...baseApp } as App; - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = object.protocol; - } else { - message.protocol = 0; - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } else { - message.software = ""; - } + fromPartial, I>>(object: I): App { + const message = createBaseApp(); + message.protocol = object.protocol ?? 0; + message.software = object.software ?? ""; return message; }, }; -const baseConsensus: object = { block: 0, app: 0 }; +function createBaseConsensus(): Consensus { + return { block: 0, app: 0 }; +} export const Consensus = { - encode(message: Consensus, writer: Writer = Writer.create()): Writer { + encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block !== 0) { writer.uint32(8).uint64(message.block); } @@ -110,10 +98,10 @@ export const Consensus = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConsensus } as Consensus; + const message = createBaseConsensus(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -132,64 +120,54 @@ export const Consensus = { }, fromJSON(object: any): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = Number(object.block); - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = Number(object.app); - } else { - message.app = 0; - } - return message; + return { block: isSet(object.block) ? Number(object.block) : 0, app: isSet(object.app) ? Number(object.app) : 0 }; }, toJSON(message: Consensus): unknown { const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - message.app !== undefined && (obj.app = message.app); + message.block !== undefined && (obj.block = Math.round(message.block)); + message.app !== undefined && (obj.app = Math.round(message.app)); return obj; }, - fromPartial(object: DeepPartial): Consensus { - const message = { ...baseConsensus } as Consensus; - if (object.block !== undefined && object.block !== null) { - message.block = object.block; - } else { - message.block = 0; - } - if (object.app !== undefined && object.app !== null) { - message.app = object.app; - } else { - message.app = 0; - } + fromPartial, I>>(object: I): Consensus { + const message = createBaseConsensus(); + message.block = object.block ?? 0; + message.app = object.app ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -197,7 +175,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/index.ts index 68fb15c4eb..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/index.ts @@ -1,58 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; - - -const types = [ - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/module.ts new file mode 100755 index 0000000000..5661bbfe61 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/module.ts @@ -0,0 +1,171 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; +import { MsgSoftwareUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; + +import { Plan as typePlan} from "./types" +import { SoftwareUpgradeProposal as typeSoftwareUpgradeProposal} from "./types" +import { CancelSoftwareUpgradeProposal as typeCancelSoftwareUpgradeProposal} from "./types" +import { ModuleVersion as typeModuleVersion} from "./types" + +export { MsgCancelUpgrade, MsgSoftwareUpgrade }; + +type sendMsgCancelUpgradeParams = { + value: MsgCancelUpgrade, + fee?: StdFee, + memo?: string +}; + +type sendMsgSoftwareUpgradeParams = { + value: MsgSoftwareUpgrade, + fee?: StdFee, + memo?: string +}; + + +type msgCancelUpgradeParams = { + value: MsgCancelUpgrade, +}; + +type msgSoftwareUpgradeParams = { + value: MsgSoftwareUpgrade, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgCancelUpgrade({ value, fee, memo }: sendMsgCancelUpgradeParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCancelUpgrade: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCancelUpgrade({ value: MsgCancelUpgrade.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCancelUpgrade: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgSoftwareUpgrade({ value, fee, memo }: sendMsgSoftwareUpgradeParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSoftwareUpgrade: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSoftwareUpgrade({ value: MsgSoftwareUpgrade.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSoftwareUpgrade: Could not broadcast Tx: '+ e.message) + } + }, + + + msgCancelUpgrade({ value }: msgCancelUpgradeParams): EncodeObject { + try { + return { typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", value: MsgCancelUpgrade.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCancelUpgrade: Could not create message: ' + e.message) + } + }, + + msgSoftwareUpgrade({ value }: msgSoftwareUpgradeParams): EncodeObject { + try { + return { typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", value: MsgSoftwareUpgrade.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSoftwareUpgrade: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Plan: getStructure(typePlan.fromPartial({})), + SoftwareUpgradeProposal: getStructure(typeSoftwareUpgradeProposal.fromPartial({})), + CancelSoftwareUpgradeProposal: getStructure(typeCancelSoftwareUpgradeProposal.fromPartial({})), + ModuleVersion: getStructure(typeModuleVersion.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosUpgradeV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/registry.ts new file mode 100755 index 0000000000..6443881615 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/registry.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; +import { MsgSoftwareUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade], + ["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/rest.ts index a49866eab6..9315ce66f5 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -140,12 +137,30 @@ export interface RpcStatus { Since: cosmos-sdk 0.43 */ export interface V1Beta1ModuleVersion { + /** name of the app module */ name?: string; - /** @format uint64 */ + /** + * consensus version of the app module + * @format uint64 + */ version?: string; } +/** +* MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + +Since: cosmos-sdk 0.46 +*/ +export type V1Beta1MsgCancelUpgradeResponse = object; + +/** +* MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + +Since: cosmos-sdk 0.46 +*/ +export type V1Beta1MsgSoftwareUpgradeResponse = object; + /** * Plan specifies information about a planned upgrade and when it should occur. */ @@ -171,10 +186,14 @@ export interface V1Beta1Plan { /** * The height at which the upgrade must be performed. - * Only used if Time is not set. * @format int64 */ height?: string; + + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ info?: string; /** @@ -197,6 +216,13 @@ export interface V1Beta1QueryAppliedPlanResponse { height?: string; } +/** + * Since: cosmos-sdk 0.46 + */ +export interface V1Beta1QueryAuthorityResponse { + address?: string; +} + /** * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC method. @@ -222,14 +248,18 @@ export interface V1Beta1QueryModuleVersionsResponse { RPC method. */ export interface V1Beta1QueryUpgradedConsensusStateResponse { - /** @format byte */ + /** + * Since: cosmos-sdk 0.43 + * @format byte + */ upgraded_consensus_state?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -239,30 +269,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -270,149 +291,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + body = this.createFormData(body as Record); + } + + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -438,6 +396,22 @@ export class Api extends HttpClient + this.request({ + path: `/cosmos/upgrade/v1beta1/authority`, + method: "GET", + format: "json", + ...params, + }); + /** * No description * @@ -484,9 +458,9 @@ This rpc is deprecated now that IBC has its own replacement (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) * @request GET:/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} */ - queryUpgradedConsensusState = (last_height: string, params: RequestParams = {}) => + queryUpgradedConsensusState = (lastHeight: string, params: RequestParams = {}) => this.request({ - path: `/cosmos/upgrade/v1beta1/upgraded_consensus_state/${last_height}`, + path: `/cosmos/upgrade/v1beta1/upgraded_consensus_state/${lastHeight}`, method: "GET", format: "json", ...params, diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types.ts new file mode 100755 index 0000000000..f5ce5af15b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { Plan } from "./types/cosmos/upgrade/v1beta1/upgrade" +import { SoftwareUpgradeProposal } from "./types/cosmos/upgrade/v1beta1/upgrade" +import { CancelSoftwareUpgradeProposal } from "./types/cosmos/upgrade/v1beta1/upgrade" +import { ModuleVersion } from "./types/cosmos/upgrade/v1beta1/upgrade" + + +export { + Plan, + SoftwareUpgradeProposal, + CancelSoftwareUpgradeProposal, + ModuleVersion, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/query.ts index 5c40a4b11d..447418aa41 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/query.ts @@ -1,8 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Plan, ModuleVersion } from "../../../cosmos/upgrade/v1beta1/upgrade"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ModuleVersion, Plan } from "./upgrade"; export const protobufPackage = "cosmos.upgrade.v1beta1"; @@ -10,7 +10,8 @@ export const protobufPackage = "cosmos.upgrade.v1beta1"; * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. */ -export interface QueryCurrentPlanRequest {} +export interface QueryCurrentPlanRequest { +} /** * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC @@ -50,7 +51,7 @@ export interface QueryUpgradedConsensusStateRequest { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - last_height: number; + lastHeight: number; } /** @@ -61,7 +62,7 @@ export interface QueryUpgradedConsensusStateRequest { */ export interface QueryUpgradedConsensusStateResponse { /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state: Uint8Array; + upgradedConsensusState: Uint8Array; } /** @@ -76,7 +77,7 @@ export interface QueryModuleVersionsRequest { * consensus version from state. Leaving this empty will * fetch the full list of module versions from state */ - module_name: string; + moduleName: string; } /** @@ -87,22 +88,39 @@ export interface QueryModuleVersionsRequest { */ export interface QueryModuleVersionsResponse { /** module_versions is a list of module names with their consensus versions. */ - module_versions: ModuleVersion[]; + moduleVersions: ModuleVersion[]; +} + +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequest { +} + +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponse { + address: string; } -const baseQueryCurrentPlanRequest: object = {}; +function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { + return {}; +} export const QueryCurrentPlanRequest = { - encode(_: QueryCurrentPlanRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryCurrentPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; + const message = createBaseQueryCurrentPlanRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -115,10 +133,7 @@ export const QueryCurrentPlanRequest = { }, fromJSON(_: any): QueryCurrentPlanRequest { - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; - return message; + return {}; }, toJSON(_: QueryCurrentPlanRequest): unknown { @@ -126,38 +141,28 @@ export const QueryCurrentPlanRequest = { return obj; }, - fromPartial( - _: DeepPartial - ): QueryCurrentPlanRequest { - const message = { - ...baseQueryCurrentPlanRequest, - } as QueryCurrentPlanRequest; + fromPartial, I>>(_: I): QueryCurrentPlanRequest { + const message = createBaseQueryCurrentPlanRequest(); return message; }, }; -const baseQueryCurrentPlanResponse: object = {}; +function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { + return { plan: undefined }; +} export const QueryCurrentPlanResponse = { - encode( - message: QueryCurrentPlanResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryCurrentPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.plan !== undefined) { Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryCurrentPlanResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; + const message = createBaseQueryCurrentPlanResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -173,58 +178,38 @@ export const QueryCurrentPlanResponse = { }, fromJSON(object: any): QueryCurrentPlanResponse { - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; + return { plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined }; }, toJSON(message: QueryCurrentPlanResponse): unknown { const obj: any = {}; - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryCurrentPlanResponse { - const message = { - ...baseQueryCurrentPlanResponse, - } as QueryCurrentPlanResponse; - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } + fromPartial, I>>(object: I): QueryCurrentPlanResponse { + const message = createBaseQueryCurrentPlanResponse(); + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; return message; }, }; -const baseQueryAppliedPlanRequest: object = { name: "" }; +function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { + return { name: "" }; +} export const QueryAppliedPlanRequest = { - encode( - message: QueryAppliedPlanRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAppliedPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; + const message = createBaseQueryAppliedPlanRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -240,15 +225,7 @@ export const QueryAppliedPlanRequest = { }, fromJSON(object: any): QueryAppliedPlanRequest { - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - return message; + return { name: isSet(object.name) ? String(object.name) : "" }; }, toJSON(message: QueryAppliedPlanRequest): unknown { @@ -257,43 +234,29 @@ export const QueryAppliedPlanRequest = { return obj; }, - fromPartial( - object: DeepPartial - ): QueryAppliedPlanRequest { - const message = { - ...baseQueryAppliedPlanRequest, - } as QueryAppliedPlanRequest; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } + fromPartial, I>>(object: I): QueryAppliedPlanRequest { + const message = createBaseQueryAppliedPlanRequest(); + message.name = object.name ?? ""; return message; }, }; -const baseQueryAppliedPlanResponse: object = { height: 0 }; +function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { + return { height: 0 }; +} export const QueryAppliedPlanResponse = { - encode( - message: QueryAppliedPlanResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAppliedPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.height !== 0) { writer.uint32(8).int64(message.height); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAppliedPlanResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; + const message = createBaseQueryAppliedPlanResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -309,65 +272,43 @@ export const QueryAppliedPlanResponse = { }, fromJSON(object: any): QueryAppliedPlanResponse { - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - return message; + return { height: isSet(object.height) ? Number(object.height) : 0 }; }, toJSON(message: QueryAppliedPlanResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = message.height); + message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAppliedPlanResponse { - const message = { - ...baseQueryAppliedPlanResponse, - } as QueryAppliedPlanResponse; - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } + fromPartial, I>>(object: I): QueryAppliedPlanResponse { + const message = createBaseQueryAppliedPlanResponse(); + message.height = object.height ?? 0; return message; }, }; -const baseQueryUpgradedConsensusStateRequest: object = { last_height: 0 }; +function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { + return { lastHeight: 0 }; +} export const QueryUpgradedConsensusStateRequest = { - encode( - message: QueryUpgradedConsensusStateRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.last_height !== 0) { - writer.uint32(8).int64(message.last_height); + encode(message: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.lastHeight !== 0) { + writer.uint32(8).int64(message.lastHeight); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; + const message = createBaseQueryUpgradedConsensusStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.last_height = longToNumber(reader.int64() as Long); + message.lastHeight = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -378,66 +319,45 @@ export const QueryUpgradedConsensusStateRequest = { }, fromJSON(object: any): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - if (object.last_height !== undefined && object.last_height !== null) { - message.last_height = Number(object.last_height); - } else { - message.last_height = 0; - } - return message; + return { lastHeight: isSet(object.lastHeight) ? Number(object.lastHeight) : 0 }; }, toJSON(message: QueryUpgradedConsensusStateRequest): unknown { const obj: any = {}; - message.last_height !== undefined && - (obj.last_height = message.last_height); + message.lastHeight !== undefined && (obj.lastHeight = Math.round(message.lastHeight)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryUpgradedConsensusStateRequest { - const message = { - ...baseQueryUpgradedConsensusStateRequest, - } as QueryUpgradedConsensusStateRequest; - if (object.last_height !== undefined && object.last_height !== null) { - message.last_height = object.last_height; - } else { - message.last_height = 0; - } + const message = createBaseQueryUpgradedConsensusStateRequest(); + message.lastHeight = object.lastHeight ?? 0; return message; }, }; -const baseQueryUpgradedConsensusStateResponse: object = {}; +function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { + return { upgradedConsensusState: new Uint8Array() }; +} export const QueryUpgradedConsensusStateResponse = { - encode( - message: QueryUpgradedConsensusStateResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.upgraded_consensus_state.length !== 0) { - writer.uint32(18).bytes(message.upgraded_consensus_state); + encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.upgradedConsensusState.length !== 0) { + writer.uint32(18).bytes(message.upgradedConsensusState); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryUpgradedConsensusStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; + const message = createBaseQueryUpgradedConsensusStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.upgraded_consensus_state = reader.bytes(); + message.upgradedConsensusState = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -448,76 +368,52 @@ export const QueryUpgradedConsensusStateResponse = { }, fromJSON(object: any): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = bytesFromBase64( - object.upgraded_consensus_state - ); - } - return message; + return { + upgradedConsensusState: isSet(object.upgradedConsensusState) + ? bytesFromBase64(object.upgradedConsensusState) + : new Uint8Array(), + }; }, toJSON(message: QueryUpgradedConsensusStateResponse): unknown { const obj: any = {}; - message.upgraded_consensus_state !== undefined && - (obj.upgraded_consensus_state = base64FromBytes( - message.upgraded_consensus_state !== undefined - ? message.upgraded_consensus_state - : new Uint8Array() + message.upgradedConsensusState !== undefined + && (obj.upgradedConsensusState = base64FromBytes( + message.upgradedConsensusState !== undefined ? message.upgradedConsensusState : new Uint8Array(), )); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryUpgradedConsensusStateResponse { - const message = { - ...baseQueryUpgradedConsensusStateResponse, - } as QueryUpgradedConsensusStateResponse; - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgraded_consensus_state = object.upgraded_consensus_state; - } else { - message.upgraded_consensus_state = new Uint8Array(); - } + const message = createBaseQueryUpgradedConsensusStateResponse(); + message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array(); return message; }, }; -const baseQueryModuleVersionsRequest: object = { module_name: "" }; +function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { + return { moduleName: "" }; +} export const QueryModuleVersionsRequest = { - encode( - message: QueryModuleVersionsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.module_name !== "") { - writer.uint32(10).string(message.module_name); + encode(message: QueryModuleVersionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryModuleVersionsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; + const message = createBaseQueryModuleVersionsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.module_name = reader.string(); + message.moduleName = reader.string(); break; default: reader.skipType(tag & 7); @@ -528,69 +424,43 @@ export const QueryModuleVersionsRequest = { }, fromJSON(object: any): QueryModuleVersionsRequest { - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; - if (object.module_name !== undefined && object.module_name !== null) { - message.module_name = String(object.module_name); - } else { - message.module_name = ""; - } - return message; + return { moduleName: isSet(object.moduleName) ? String(object.moduleName) : "" }; }, toJSON(message: QueryModuleVersionsRequest): unknown { const obj: any = {}; - message.module_name !== undefined && - (obj.module_name = message.module_name); + message.moduleName !== undefined && (obj.moduleName = message.moduleName); return obj; }, - fromPartial( - object: DeepPartial - ): QueryModuleVersionsRequest { - const message = { - ...baseQueryModuleVersionsRequest, - } as QueryModuleVersionsRequest; - if (object.module_name !== undefined && object.module_name !== null) { - message.module_name = object.module_name; - } else { - message.module_name = ""; - } + fromPartial, I>>(object: I): QueryModuleVersionsRequest { + const message = createBaseQueryModuleVersionsRequest(); + message.moduleName = object.moduleName ?? ""; return message; }, }; -const baseQueryModuleVersionsResponse: object = {}; +function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { + return { moduleVersions: [] }; +} export const QueryModuleVersionsResponse = { - encode( - message: QueryModuleVersionsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.module_versions) { + encode(message: QueryModuleVersionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.moduleVersions) { ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryModuleVersionsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; + const message = createBaseQueryModuleVersionsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.module_versions.push( - ModuleVersion.decode(reader, reader.uint32()) - ); + message.moduleVersions.push(ModuleVersion.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -601,62 +471,122 @@ export const QueryModuleVersionsResponse = { }, fromJSON(object: any): QueryModuleVersionsResponse { - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; - if ( - object.module_versions !== undefined && - object.module_versions !== null - ) { - for (const e of object.module_versions) { - message.module_versions.push(ModuleVersion.fromJSON(e)); - } - } - return message; + return { + moduleVersions: Array.isArray(object?.moduleVersions) + ? object.moduleVersions.map((e: any) => ModuleVersion.fromJSON(e)) + : [], + }; }, toJSON(message: QueryModuleVersionsResponse): unknown { const obj: any = {}; - if (message.module_versions) { - obj.module_versions = message.module_versions.map((e) => - e ? ModuleVersion.toJSON(e) : undefined - ); + if (message.moduleVersions) { + obj.moduleVersions = message.moduleVersions.map((e) => e ? ModuleVersion.toJSON(e) : undefined); } else { - obj.module_versions = []; + obj.moduleVersions = []; } return obj; }, - fromPartial( - object: DeepPartial - ): QueryModuleVersionsResponse { - const message = { - ...baseQueryModuleVersionsResponse, - } as QueryModuleVersionsResponse; - message.module_versions = []; - if ( - object.module_versions !== undefined && - object.module_versions !== null - ) { - for (const e of object.module_versions) { - message.module_versions.push(ModuleVersion.fromPartial(e)); + fromPartial, I>>(object: I): QueryModuleVersionsResponse { + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.moduleVersions?.map((e) => ModuleVersion.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { + return {}; +} + +export const QueryAuthorityRequest = { + encode(_: QueryAuthorityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } } return message; }, + + fromJSON(_: any): QueryAuthorityRequest { + return {}; + }, + + toJSON(_: QueryAuthorityRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, +}; + +function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { + return { address: "" }; +} + +export const QueryAuthorityResponse = { + encode(message: QueryAuthorityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAuthorityResponse { + return { address: isSet(object.address) ? String(object.address) : "" }; + }, + + toJSON(message: QueryAuthorityResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial, I>>(object: I): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + message.address = object.address ?? ""; + return message; + }, }; /** Query defines the gRPC upgrade querier service. */ export interface Query { /** CurrentPlan queries the current upgrade plan. */ - CurrentPlan( - request: QueryCurrentPlanRequest - ): Promise; + CurrentPlan(request: QueryCurrentPlanRequest): Promise; /** AppliedPlan queries a previously applied upgrade plan by its name. */ - AppliedPlan( - request: QueryAppliedPlanRequest - ): Promise; + AppliedPlan(request: QueryAppliedPlanRequest): Promise; /** * UpgradedConsensusState queries the consensus state that will serve * as a trusted kernel for the next version of this chain. It will only be @@ -667,133 +597,121 @@ export interface Query { * * @deprecated */ - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise; + UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise; /** * ModuleVersions queries the list of module versions from state. * * Since: cosmos-sdk 0.43 */ - ModuleVersions( - request: QueryModuleVersionsRequest - ): Promise; + ModuleVersions(request: QueryModuleVersionsRequest): Promise; + /** + * Returns the account with authority to conduct upgrades + * + * Since: cosmos-sdk 0.46 + */ + Authority(request: QueryAuthorityRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.CurrentPlan = this.CurrentPlan.bind(this); + this.AppliedPlan = this.AppliedPlan.bind(this); + this.UpgradedConsensusState = this.UpgradedConsensusState.bind(this); + this.ModuleVersions = this.ModuleVersions.bind(this); + this.Authority = this.Authority.bind(this); } - CurrentPlan( - request: QueryCurrentPlanRequest - ): Promise { + CurrentPlan(request: QueryCurrentPlanRequest): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "CurrentPlan", - data - ); - return promise.then((data) => - QueryCurrentPlanResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); + return promise.then((data) => QueryCurrentPlanResponse.decode(new _m0.Reader(data))); } - AppliedPlan( - request: QueryAppliedPlanRequest - ): Promise { + AppliedPlan(request: QueryAppliedPlanRequest): Promise { const data = QueryAppliedPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "AppliedPlan", - data - ); - return promise.then((data) => - QueryAppliedPlanResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); + return promise.then((data) => QueryAppliedPlanResponse.decode(new _m0.Reader(data))); } - UpgradedConsensusState( - request: QueryUpgradedConsensusStateRequest - ): Promise { + UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "UpgradedConsensusState", - data - ); - return promise.then((data) => - QueryUpgradedConsensusStateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); + return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); } - ModuleVersions( - request: QueryModuleVersionsRequest - ): Promise { + ModuleVersions(request: QueryModuleVersionsRequest): Promise { const data = QueryModuleVersionsRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.upgrade.v1beta1.Query", - "ModuleVersions", - data - ); - return promise.then((data) => - QueryModuleVersionsResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); + return promise.then((data) => QueryModuleVersionsResponse.decode(new _m0.Reader(data))); + } + + Authority(request: QueryAuthorityRequest): Promise { + const data = QueryAuthorityRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); + return promise.then((data) => QueryAuthorityResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -801,7 +719,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 0000000000..169c28509b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,285 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Plan } from "./upgrade"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Since: cosmos-sdk 0.46 */ + +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan | undefined; +} + +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse { +} + +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; +} + +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse { +} + +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { authority: "", plan: undefined }; +} + +export const MsgSoftwareUpgrade = { + encode(message: MsgSoftwareUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSoftwareUpgrade { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; + }, + + toJSON(message: MsgSoftwareUpgrade): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + return message; + }, +}; + +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} + +export const MsgSoftwareUpgradeResponse = { + encode(_: MsgSoftwareUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSoftwareUpgradeResponse { + return {}; + }, + + toJSON(_: MsgSoftwareUpgradeResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, +}; + +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { authority: "" }; +} + +export const MsgCancelUpgrade = { + encode(message: MsgCancelUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCancelUpgrade { + return { authority: isSet(object.authority) ? String(object.authority) : "" }; + }, + + toJSON(message: MsgCancelUpgrade): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + + fromPartial, I>>(object: I): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ""; + return message; + }, +}; + +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} + +export const MsgCancelUpgradeResponse = { + encode(_: MsgCancelUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCancelUpgradeResponse { + return {}; + }, + + toJSON(_: MsgCancelUpgradeResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, +}; + +/** Msg defines the upgrade Msg service. */ +export interface Msg { + /** + * SoftwareUpgrade is a governance operation for initiating a software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + SoftwareUpgrade(request: MsgSoftwareUpgrade): Promise; + /** + * CancelUpgrade is a governance operation for cancelling a previously + * approved software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + CancelUpgrade(request: MsgCancelUpgrade): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SoftwareUpgrade = this.SoftwareUpgrade.bind(this); + this.CancelUpgrade = this.CancelUpgrade.bind(this); + } + SoftwareUpgrade(request: MsgSoftwareUpgrade): Promise { + const data = MsgSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); + return promise.then((data) => MsgSoftwareUpgradeResponse.decode(new _m0.Reader(data))); + } + + CancelUpgrade(request: MsgCancelUpgrade): Promise { + const data = MsgCancelUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); + return promise.then((data) => MsgCancelUpgradeResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts index 39d4f7cf83..4b2ecab4a4 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,9 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; export const protobufPackage = "cosmos.upgrade.v1beta1"; @@ -26,11 +26,10 @@ export interface Plan { * * @deprecated */ - time: Date | undefined; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ + time: + | Date + | undefined; + /** The height at which the upgrade must be performed. */ height: number; /** * Any application specific upgrade info to be included on-chain @@ -44,25 +43,38 @@ export interface Plan { * * @deprecated */ - upgraded_client_state: Any | undefined; + upgradedClientState: Any | undefined; } /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + * + * @deprecated */ export interface SoftwareUpgradeProposal { + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; + /** plan of the proposal */ plan: Plan | undefined; } /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + * + * @deprecated */ export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; } @@ -78,18 +90,17 @@ export interface ModuleVersion { version: number; } -const basePlan: object = { name: "", height: 0, info: "" }; +function createBasePlan(): Plan { + return { name: "", time: undefined, height: 0, info: "", upgradedClientState: undefined }; +} export const Plan = { - encode(message: Plan, writer: Writer = Writer.create()): Writer { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } if (message.time !== undefined) { - Timestamp.encode( - toTimestamp(message.time), - writer.uint32(18).fork() - ).ldelim(); + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); } if (message.height !== 0) { writer.uint32(24).int64(message.height); @@ -97,19 +108,16 @@ export const Plan = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (message.upgraded_client_state !== undefined) { - Any.encode( - message.upgraded_client_state, - writer.uint32(42).fork() - ).ldelim(); + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePlan } as Plan; + const message = createBasePlan(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -117,9 +125,7 @@ export const Plan = { message.name = reader.string(); break; case 2: - message.time = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 3: message.height = longToNumber(reader.int64() as Long); @@ -128,7 +134,7 @@ export const Plan = { message.info = reader.string(); break; case 5: - message.upgraded_client_state = Any.decode(reader, reader.uint32()); + message.upgradedClientState = Any.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -139,98 +145,45 @@ export const Plan = { }, fromJSON(object: any): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromJsonTimestamp(object.time); - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = Number(object.height); - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = String(object.info); - } else { - message.info = ""; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromJSON( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } - return message; + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; }, toJSON(message: Plan): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.time !== undefined && - (obj.time = - message.time !== undefined ? message.time.toISOString() : null); - message.height !== undefined && (obj.height = message.height); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.height !== undefined && (obj.height = Math.round(message.height)); message.info !== undefined && (obj.info = message.info); - message.upgraded_client_state !== undefined && - (obj.upgraded_client_state = message.upgraded_client_state - ? Any.toJSON(message.upgraded_client_state) - : undefined); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); return obj; }, - fromPartial(object: DeepPartial): Plan { - const message = { ...basePlan } as Plan; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = undefined; - } - if (object.height !== undefined && object.height !== null) { - message.height = object.height; - } else { - message.height = 0; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } else { - message.info = ""; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgraded_client_state = Any.fromPartial( - object.upgraded_client_state - ); - } else { - message.upgraded_client_state = undefined; - } + fromPartial, I>>(object: I): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height ?? 0; + message.info = object.info ?? ""; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; return message; }, }; -const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { title: "", description: "", plan: undefined }; +} export const SoftwareUpgradeProposal = { - encode( - message: SoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -243,12 +196,10 @@ export const SoftwareUpgradeProposal = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; + const message = createBaseSoftwareUpgradeProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -270,72 +221,36 @@ export const SoftwareUpgradeProposal = { }, fromJSON(object: any): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromJSON(object.plan); - } else { - message.plan = undefined; - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; }, toJSON(message: SoftwareUpgradeProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.plan !== undefined && - (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): SoftwareUpgradeProposal { - const message = { - ...baseSoftwareUpgradeProposal, - } as SoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromPartial(object.plan); - } else { - message.plan = undefined; - } + fromPartial, I>>(object: I): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; return message; }, }; -const baseCancelSoftwareUpgradeProposal: object = { - title: "", - description: "", -}; +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { title: "", description: "" }; +} export const CancelSoftwareUpgradeProposal = { - encode( - message: CancelSoftwareUpgradeProposal, - writer: Writer = Writer.create() - ): Writer { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -345,15 +260,10 @@ export const CancelSoftwareUpgradeProposal = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): CancelSoftwareUpgradeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; + const message = createBaseCancelSoftwareUpgradeProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -372,54 +282,35 @@ export const CancelSoftwareUpgradeProposal = { }, fromJSON(object: any): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - return message; + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; }, toJSON(message: CancelSoftwareUpgradeProposal): unknown { const obj: any = {}; message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); + message.description !== undefined && (obj.description = message.description); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): CancelSoftwareUpgradeProposal { - const message = { - ...baseCancelSoftwareUpgradeProposal, - } as CancelSoftwareUpgradeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; return message; }, }; -const baseModuleVersion: object = { name: "", version: 0 }; +function createBaseModuleVersion(): ModuleVersion { + return { name: "", version: 0 }; +} export const ModuleVersion = { - encode(message: ModuleVersion, writer: Writer = Writer.create()): Writer { + encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -429,10 +320,10 @@ export const ModuleVersion = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModuleVersion { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleVersion } as ModuleVersion; + const message = createBaseModuleVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -451,64 +342,57 @@ export const ModuleVersion = { }, fromJSON(object: any): ModuleVersion { - const message = { ...baseModuleVersion } as ModuleVersion; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = Number(object.version); - } else { - message.version = 0; - } - return message; + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? Number(object.version) : 0, + }; }, toJSON(message: ModuleVersion): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = message.version); + message.version !== undefined && (obj.version = Math.round(message.version)); return obj; }, - fromPartial(object: DeepPartial): ModuleVersion { - const message = { ...baseModuleVersion } as ModuleVersion; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } else { - message.version = 0; - } + fromPartial, I>>(object: I): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function toTimestamp(date: Date): Timestamp { const seconds = date.getTime() / 1_000; const nanos = (date.getTime() % 1_000) * 1_000_000; @@ -538,7 +422,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/timestamp.ts index 4db4e37597..93776d9496 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/timestamp.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.upgrade.v1beta1/types/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -56,7 +56,6 @@ export const protobufPackage = "google.protobuf"; * 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(); @@ -65,7 +64,6 @@ export const protobufPackage = "google.protobuf"; * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) * .setNanos(now.getNano()).build(); * - * * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() @@ -114,10 +112,12 @@ export interface Timestamp { nanos: number; } -const baseTimestamp: object = { seconds: 0, nanos: 0 }; +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} export const Timestamp = { - encode(message: Timestamp, writer: Writer = Writer.create()): Writer { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } @@ -127,10 +127,10 @@ export const Timestamp = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseTimestamp } as Timestamp; + const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -149,64 +149,57 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Number(object.seconds); - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = Number(object.nanos); - } else { - message.nanos = 0; - } - return message; + return { + seconds: isSet(object.seconds) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = message.seconds); - message.nanos !== undefined && (obj.nanos = message.nanos); + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial(object: DeepPartial): Timestamp { - const message = { ...baseTimestamp } as Timestamp; - if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = object.seconds; - } else { - message.seconds = 0; - } - if (object.nanos !== undefined && object.nanos !== null) { - message.nanos = object.nanos; - } else { - message.nanos = 0; - } + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -214,7 +207,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/index.ts index af1189ee9f..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/index.ts @@ -1,61 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgCreateVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; - - -const types = [ - ["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCreateVestingAccount: (data: MsgCreateVestingAccount): EncodeObject => ({ typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value: MsgCreateVestingAccount.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/module.ts new file mode 100755 index 0000000000..53386ee7c3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/module.ts @@ -0,0 +1,208 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgCreateVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; +import { MsgCreatePermanentLockedAccount } from "./types/cosmos/vesting/v1beta1/tx"; +import { MsgCreatePeriodicVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; + +import { BaseVestingAccount as typeBaseVestingAccount} from "./types" +import { ContinuousVestingAccount as typeContinuousVestingAccount} from "./types" +import { DelayedVestingAccount as typeDelayedVestingAccount} from "./types" +import { Period as typePeriod} from "./types" +import { PeriodicVestingAccount as typePeriodicVestingAccount} from "./types" +import { PermanentLockedAccount as typePermanentLockedAccount} from "./types" + +export { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount }; + +type sendMsgCreateVestingAccountParams = { + value: MsgCreateVestingAccount, + fee?: StdFee, + memo?: string +}; + +type sendMsgCreatePermanentLockedAccountParams = { + value: MsgCreatePermanentLockedAccount, + fee?: StdFee, + memo?: string +}; + +type sendMsgCreatePeriodicVestingAccountParams = { + value: MsgCreatePeriodicVestingAccount, + fee?: StdFee, + memo?: string +}; + + +type msgCreateVestingAccountParams = { + value: MsgCreateVestingAccount, +}; + +type msgCreatePermanentLockedAccountParams = { + value: MsgCreatePermanentLockedAccount, +}; + +type msgCreatePeriodicVestingAccountParams = { + value: MsgCreatePeriodicVestingAccount, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgCreateVestingAccount({ value, fee, memo }: sendMsgCreateVestingAccountParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreateVestingAccount: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreateVestingAccount({ value: MsgCreateVestingAccount.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreateVestingAccount: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCreatePermanentLockedAccount({ value, fee, memo }: sendMsgCreatePermanentLockedAccountParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreatePermanentLockedAccount: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreatePermanentLockedAccount({ value: MsgCreatePermanentLockedAccount.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreatePermanentLockedAccount: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCreatePeriodicVestingAccount({ value, fee, memo }: sendMsgCreatePeriodicVestingAccountParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreatePeriodicVestingAccount: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreatePeriodicVestingAccount({ value: MsgCreatePeriodicVestingAccount.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreatePeriodicVestingAccount: Could not broadcast Tx: '+ e.message) + } + }, + + + msgCreateVestingAccount({ value }: msgCreateVestingAccountParams): EncodeObject { + try { + return { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value: MsgCreateVestingAccount.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreateVestingAccount: Could not create message: ' + e.message) + } + }, + + msgCreatePermanentLockedAccount({ value }: msgCreatePermanentLockedAccountParams): EncodeObject { + try { + return { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", value: MsgCreatePermanentLockedAccount.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreatePermanentLockedAccount: Could not create message: ' + e.message) + } + }, + + msgCreatePeriodicVestingAccount({ value }: msgCreatePeriodicVestingAccountParams): EncodeObject { + try { + return { typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", value: MsgCreatePeriodicVestingAccount.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreatePeriodicVestingAccount: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + BaseVestingAccount: getStructure(typeBaseVestingAccount.fromPartial({})), + ContinuousVestingAccount: getStructure(typeContinuousVestingAccount.fromPartial({})), + DelayedVestingAccount: getStructure(typeDelayedVestingAccount.fromPartial({})), + Period: getStructure(typePeriod.fromPartial({})), + PeriodicVestingAccount: getStructure(typePeriodicVestingAccount.fromPartial({})), + PermanentLockedAccount: getStructure(typePermanentLockedAccount.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmosVestingV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/registry.ts new file mode 100755 index 0000000000..48f71f74b5 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/registry.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgCreateVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; +import { MsgCreatePermanentLockedAccount } from "./types/cosmos/vesting/v1beta1/tx"; +import { MsgCreatePeriodicVestingAccount } from "./types/cosmos/vesting/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], + ["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", MsgCreatePermanentLockedAccount], + ["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", MsgCreatePeriodicVestingAccount], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/rest.ts index a55b330350..96f937e415 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -145,15 +142,43 @@ export interface V1Beta1Coin { amount?: string; } +/** +* MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +response type. + +Since: cosmos-sdk 0.46 +*/ +export type V1Beta1MsgCreatePeriodicVestingAccountResponse = object; + +/** +* MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + +Since: cosmos-sdk 0.46 +*/ +export type V1Beta1MsgCreatePermanentLockedAccountResponse = object; + /** * MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ export type V1Beta1MsgCreateVestingAccountResponse = object; +/** + * Period defines a length of time and amount of coins that will vest. + */ +export interface V1Beta1Period { + /** + * Period duration in seconds. + * @format int64 + */ + length?: string; + amount?: V1Beta1Coin[]; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -163,30 +188,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -194,149 +210,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types.ts new file mode 100755 index 0000000000..96d50c809e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types.ts @@ -0,0 +1,18 @@ +//@ts-nocheck +import { BaseVestingAccount } from "./types/cosmos/vesting/v1beta1/vesting" +import { ContinuousVestingAccount } from "./types/cosmos/vesting/v1beta1/vesting" +import { DelayedVestingAccount } from "./types/cosmos/vesting/v1beta1/vesting" +import { Period } from "./types/cosmos/vesting/v1beta1/vesting" +import { PeriodicVestingAccount } from "./types/cosmos/vesting/v1beta1/vesting" +import { PermanentLockedAccount } from "./types/cosmos/vesting/v1beta1/vesting" + + +export { + BaseVestingAccount, + ContinuousVestingAccount, + DelayedVestingAccount, + Period, + PeriodicVestingAccount, + PermanentLockedAccount, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts index 482a7856ae..ac3ae19a1d 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; export const protobufPackage = "cosmos.auth.v1beta1"; @@ -13,39 +13,56 @@ export const protobufPackage = "cosmos.auth.v1beta1"; */ export interface BaseAccount { address: string; - pub_key: Any | undefined; - account_number: number; + pubKey: Any | undefined; + accountNumber: number; sequence: number; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - base_account: BaseAccount | undefined; + baseAccount: BaseAccount | undefined; name: string; permissions: string[]; } +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} + /** Params defines the parameters for the auth module. */ export interface Params { - max_memo_characters: number; - tx_sig_limit: number; - tx_size_cost_per_byte: number; - sig_verify_cost_ed25519: number; - sig_verify_cost_secp256k1: number; + maxMemoCharacters: number; + txSigLimit: number; + txSizeCostPerByte: number; + sigVerifyCostEd25519: number; + sigVerifyCostSecp256k1: number; } -const baseBaseAccount: object = { address: "", account_number: 0, sequence: 0 }; +function createBaseBaseAccount(): BaseAccount { + return { address: "", pubKey: undefined, accountNumber: 0, sequence: 0 }; +} export const BaseAccount = { - encode(message: BaseAccount, writer: Writer = Writer.create()): Writer { + encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.pub_key !== undefined) { - Any.encode(message.pub_key, writer.uint32(18).fork()).ldelim(); + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (message.account_number !== 0) { - writer.uint32(24).uint64(message.account_number); + if (message.accountNumber !== 0) { + writer.uint32(24).uint64(message.accountNumber); } if (message.sequence !== 0) { writer.uint32(32).uint64(message.sequence); @@ -53,10 +70,10 @@ export const BaseAccount = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseAccount } as BaseAccount; + const message = createBaseBaseAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -64,10 +81,10 @@ export const BaseAccount = { message.address = reader.string(); break; case 2: - message.pub_key = Any.decode(reader, reader.uint32()); + message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.account_number = longToNumber(reader.uint64() as Long); + message.accountNumber = longToNumber(reader.uint64() as Long); break; case 4: message.sequence = longToNumber(reader.uint64() as Long); @@ -81,76 +98,43 @@ export const BaseAccount = { }, fromJSON(object: any): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromJSON(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = Number(object.account_number); - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, + accountNumber: isSet(object.accountNumber) ? Number(object.accountNumber) : 0, + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; }, toJSON(message: BaseAccount): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pub_key !== undefined && - (obj.pub_key = message.pub_key ? Any.toJSON(message.pub_key) : undefined); - message.account_number !== undefined && - (obj.account_number = message.account_number); - message.sequence !== undefined && (obj.sequence = message.sequence); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.accountNumber !== undefined && (obj.accountNumber = Math.round(message.accountNumber)); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); return obj; }, - fromPartial(object: DeepPartial): BaseAccount { - const message = { ...baseBaseAccount } as BaseAccount; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pub_key = Any.fromPartial(object.pub_key); - } else { - message.pub_key = undefined; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.account_number = object.account_number; - } else { - message.account_number = 0; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } + fromPartial, I>>(object: I): BaseAccount { + const message = createBaseBaseAccount(); + message.address = object.address ?? ""; + message.pubKey = (object.pubKey !== undefined && object.pubKey !== null) + ? Any.fromPartial(object.pubKey) + : undefined; + message.accountNumber = object.accountNumber ?? 0; + message.sequence = object.sequence ?? 0; return message; }, }; -const baseModuleAccount: object = { name: "", permissions: "" }; +function createBaseModuleAccount(): ModuleAccount { + return { baseAccount: undefined, name: "", permissions: [] }; +} export const ModuleAccount = { - encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } if (message.name !== "") { writer.uint32(18).string(message.name); @@ -161,16 +145,15 @@ export const ModuleAccount = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; + const message = createBaseModuleAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); break; case 2: message.name = reader.string(); @@ -187,32 +170,17 @@ export const ModuleAccount = { }, fromJSON(object: any): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(String(e)); - } - } - return message; + return { + baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + name: isSet(object.name) ? String(object.name) : "", + permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => String(e)) : [], + }; }, toJSON(message: ModuleAccount): unknown { const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); + message.baseAccount !== undefined + && (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); message.name !== undefined && (obj.name = message.name); if (message.permissions) { obj.permissions = message.permissions.map((e) => e); @@ -222,81 +190,132 @@ export const ModuleAccount = { return obj; }, - fromPartial(object: DeepPartial): ModuleAccount { - const message = { ...baseModuleAccount } as ModuleAccount; - message.permissions = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; + fromPartial, I>>(object: I): ModuleAccount { + const message = createBaseModuleAccount(); + message.baseAccount = (object.baseAccount !== undefined && object.baseAccount !== null) + ? BaseAccount.fromPartial(object.baseAccount) + : undefined; + message.name = object.name ?? ""; + message.permissions = object.permissions?.map((e) => e) || []; + return message; + }, +}; + +function createBaseModuleCredential(): ModuleCredential { + return { moduleName: "", derivationKeys: [] }; +} + +export const ModuleCredential = { + encode(message: ModuleCredential, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); } - if (object.permissions !== undefined && object.permissions !== null) { - for (const e of object.permissions) { - message.permissions.push(e); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, -}; -const baseParams: object = { - max_memo_characters: 0, - tx_sig_limit: 0, - tx_size_cost_per_byte: 0, - sig_verify_cost_ed25519: 0, - sig_verify_cost_secp256k1: 0, + fromJSON(object: any): ModuleCredential { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + derivationKeys: Array.isArray(object?.derivationKeys) + ? object.derivationKeys.map((e: any) => bytesFromBase64(e)) + : [], + }; + }, + + toJSON(message: ModuleCredential): unknown { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + if (message.derivationKeys) { + obj.derivationKeys = message.derivationKeys.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.derivationKeys = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ""; + message.derivationKeys = object.derivationKeys?.map((e) => e) || []; + return message; + }, }; +function createBaseParams(): Params { + return { + maxMemoCharacters: 0, + txSigLimit: 0, + txSizeCostPerByte: 0, + sigVerifyCostEd25519: 0, + sigVerifyCostSecp256k1: 0, + }; +} + export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.max_memo_characters !== 0) { - writer.uint32(8).uint64(message.max_memo_characters); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxMemoCharacters !== 0) { + writer.uint32(8).uint64(message.maxMemoCharacters); } - if (message.tx_sig_limit !== 0) { - writer.uint32(16).uint64(message.tx_sig_limit); + if (message.txSigLimit !== 0) { + writer.uint32(16).uint64(message.txSigLimit); } - if (message.tx_size_cost_per_byte !== 0) { - writer.uint32(24).uint64(message.tx_size_cost_per_byte); + if (message.txSizeCostPerByte !== 0) { + writer.uint32(24).uint64(message.txSizeCostPerByte); } - if (message.sig_verify_cost_ed25519 !== 0) { - writer.uint32(32).uint64(message.sig_verify_cost_ed25519); + if (message.sigVerifyCostEd25519 !== 0) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); } - if (message.sig_verify_cost_secp256k1 !== 0) { - writer.uint32(40).uint64(message.sig_verify_cost_secp256k1); + if (message.sigVerifyCostSecp256k1 !== 0) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.max_memo_characters = longToNumber(reader.uint64() as Long); + message.maxMemoCharacters = longToNumber(reader.uint64() as Long); break; case 2: - message.tx_sig_limit = longToNumber(reader.uint64() as Long); + message.txSigLimit = longToNumber(reader.uint64() as Long); break; case 3: - message.tx_size_cost_per_byte = longToNumber(reader.uint64() as Long); + message.txSizeCostPerByte = longToNumber(reader.uint64() as Long); break; case 4: - message.sig_verify_cost_ed25519 = longToNumber( - reader.uint64() as Long - ); + message.sigVerifyCostEd25519 = longToNumber(reader.uint64() as Long); break; case 5: - message.sig_verify_cost_secp256k1 = longToNumber( - reader.uint64() as Long - ); + message.sigVerifyCostSecp256k1 = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -307,128 +326,92 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = Number(object.max_memo_characters); - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = Number(object.tx_sig_limit); - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = Number(object.tx_size_cost_per_byte); - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = Number(object.sig_verify_cost_ed25519); - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = Number( - object.sig_verify_cost_secp256k1 - ); - } else { - message.sig_verify_cost_secp256k1 = 0; - } - return message; + return { + maxMemoCharacters: isSet(object.maxMemoCharacters) ? Number(object.maxMemoCharacters) : 0, + txSigLimit: isSet(object.txSigLimit) ? Number(object.txSigLimit) : 0, + txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? Number(object.txSizeCostPerByte) : 0, + sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? Number(object.sigVerifyCostEd25519) : 0, + sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? Number(object.sigVerifyCostSecp256k1) : 0, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.max_memo_characters !== undefined && - (obj.max_memo_characters = message.max_memo_characters); - message.tx_sig_limit !== undefined && - (obj.tx_sig_limit = message.tx_sig_limit); - message.tx_size_cost_per_byte !== undefined && - (obj.tx_size_cost_per_byte = message.tx_size_cost_per_byte); - message.sig_verify_cost_ed25519 !== undefined && - (obj.sig_verify_cost_ed25519 = message.sig_verify_cost_ed25519); - message.sig_verify_cost_secp256k1 !== undefined && - (obj.sig_verify_cost_secp256k1 = message.sig_verify_cost_secp256k1); + message.maxMemoCharacters !== undefined && (obj.maxMemoCharacters = Math.round(message.maxMemoCharacters)); + message.txSigLimit !== undefined && (obj.txSigLimit = Math.round(message.txSigLimit)); + message.txSizeCostPerByte !== undefined && (obj.txSizeCostPerByte = Math.round(message.txSizeCostPerByte)); + message.sigVerifyCostEd25519 !== undefined && (obj.sigVerifyCostEd25519 = Math.round(message.sigVerifyCostEd25519)); + message.sigVerifyCostSecp256k1 !== undefined + && (obj.sigVerifyCostSecp256k1 = Math.round(message.sigVerifyCostSecp256k1)); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.max_memo_characters = object.max_memo_characters; - } else { - message.max_memo_characters = 0; - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.tx_sig_limit = object.tx_sig_limit; - } else { - message.tx_sig_limit = 0; - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - } else { - message.tx_size_cost_per_byte = 0; - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - } else { - message.sig_verify_cost_ed25519 = 0; - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - } else { - message.sig_verify_cost_secp256k1 = 0; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.maxMemoCharacters = object.maxMemoCharacters ?? 0; + message.txSigLimit = object.txSigLimit ?? 0; + message.txSizeCostPerByte = object.txSizeCostPerByte ?? 0; + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 ?? 0; + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +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 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -436,7 +419,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts index c6c4bdedb0..7177fb770c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts @@ -1,8 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; +import { Period } from "./vesting"; export const protobufPackage = "cosmos.vesting.v1beta1"; @@ -11,39 +12,78 @@ export const protobufPackage = "cosmos.vesting.v1beta1"; * account. */ export interface MsgCreateVestingAccount { - from_address: string; - to_address: string; + fromAddress: string; + toAddress: string; amount: Coin[]; - end_time: number; + /** end of vesting as unix time (in seconds). */ + endTime: number; delayed: boolean; } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ -export interface MsgCreateVestingAccountResponse {} +export interface MsgCreateVestingAccountResponse { +} -const baseMsgCreateVestingAccount: object = { - from_address: "", - to_address: "", - end_time: 0, - delayed: false, -}; +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} + +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountResponse { +} + +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccount { + fromAddress: string; + toAddress: string; + /** start of vesting as unix time (in seconds). */ + startTime: number; + vestingPeriods: Period[]; +} + +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountResponse { +} + +function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { + return { fromAddress: "", toAddress: "", amount: [], endTime: 0, delayed: false }; +} export const MsgCreateVestingAccount = { - encode( - message: MsgCreateVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.from_address !== "") { - writer.uint32(10).string(message.from_address); + encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); } - if (message.to_address !== "") { - writer.uint32(18).string(message.to_address); + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); } for (const v of message.amount) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.end_time !== 0) { - writer.uint32(32).int64(message.end_time); + if (message.endTime !== 0) { + writer.uint32(32).int64(message.endTime); } if (message.delayed === true) { writer.uint32(40).bool(message.delayed); @@ -51,27 +91,24 @@ export const MsgCreateVestingAccount = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgCreateVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; + const message = createBaseMsgCreateVestingAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.from_address = reader.string(); + message.fromAddress = reader.string(); break; case 2: - message.to_address = reader.string(); + message.toAddress = reader.string(); break; case 3: message.amount.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.end_time = longToNumber(reader.int64() as Long); + message.endTime = longToNumber(reader.int64() as Long); break; case 5: message.delayed = reader.bool(); @@ -85,108 +122,290 @@ export const MsgCreateVestingAccount = { }, fromJSON(object: any): MsgCreateVestingAccount { - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = String(object.from_address); - } else { - message.from_address = ""; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = String(object.to_address); + return { + fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", + toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + endTime: isSet(object.endTime) ? Number(object.endTime) : 0, + delayed: isSet(object.delayed) ? Boolean(object.delayed) : false, + }; + }, + + toJSON(message: MsgCreateVestingAccount): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { - message.to_address = ""; + obj.amount = []; } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); + message.endTime !== undefined && (obj.endTime = Math.round(message.endTime)); + message.delayed !== undefined && (obj.delayed = message.delayed); + return obj; + }, + + fromPartial, I>>(object: I): MsgCreateVestingAccount { + const message = createBaseMsgCreateVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + message.endTime = object.endTime ?? 0; + message.delayed = object.delayed ?? false; + return message; + }, +}; + +function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountResponse { + return {}; +} + +export const MsgCreateVestingAccountResponse = { + encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = Number(object.end_time); - } else { - message.end_time = 0; + return message; + }, + + fromJSON(_: any): MsgCreateVestingAccountResponse { + return {}; + }, + + toJSON(_: MsgCreateVestingAccountResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgCreateVestingAccountResponse { + const message = createBaseMsgCreateVestingAccountResponse(); + return message; + }, +}; + +function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAccount { + return { fromAddress: "", toAddress: "", amount: [] }; +} + +export const MsgCreatePermanentLockedAccount = { + encode(message: MsgCreatePermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); } - if (object.delayed !== undefined && object.delayed !== null) { - message.delayed = Boolean(object.delayed); - } else { - message.delayed = false; + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: MsgCreateVestingAccount): unknown { + fromJSON(object: any): MsgCreatePermanentLockedAccount { + return { + fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", + toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: MsgCreatePermanentLockedAccount): unknown { const obj: any = {}; - message.from_address !== undefined && - (obj.from_address = message.from_address); - message.to_address !== undefined && (obj.to_address = message.to_address); + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } - message.end_time !== undefined && (obj.end_time = message.end_time); - message.delayed !== undefined && (obj.delayed = message.delayed); return obj; }, - fromPartial( - object: DeepPartial - ): MsgCreateVestingAccount { - const message = { - ...baseMsgCreateVestingAccount, - } as MsgCreateVestingAccount; - message.amount = []; - if (object.from_address !== undefined && object.from_address !== null) { - message.from_address = object.from_address; - } else { - message.from_address = ""; + fromPartial, I>>( + object: I, + ): MsgCreatePermanentLockedAccount { + const message = createBaseMsgCreatePermanentLockedAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanentLockedAccountResponse { + return {}; +} + +export const MsgCreatePermanentLockedAccountResponse = { + encode(_: MsgCreatePermanentLockedAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - if (object.to_address !== undefined && object.to_address !== null) { - message.to_address = object.to_address; - } else { - message.to_address = ""; + return message; + }, + + fromJSON(_: any): MsgCreatePermanentLockedAccountResponse { + return {}; + }, + + toJSON(_: MsgCreatePermanentLockedAccountResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgCreatePermanentLockedAccountResponse { + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; + }, +}; + +function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAccount { + return { fromAddress: "", toAddress: "", startTime: 0, vestingPeriods: [] }; +} + +export const MsgCreatePeriodicVestingAccount = { + encode(message: MsgCreatePeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = object.end_time; - } else { - message.end_time = 0; + if (message.startTime !== 0) { + writer.uint32(24).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (object.delayed !== undefined && object.delayed !== null) { - message.delayed = object.delayed; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.startTime = longToNumber(reader.int64() as Long); + break; + case 4: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreatePeriodicVestingAccount { + return { + fromAddress: isSet(object.fromAddress) ? String(object.fromAddress) : "", + toAddress: isSet(object.toAddress) ? String(object.toAddress) : "", + startTime: isSet(object.startTime) ? Number(object.startTime) : 0, + vestingPeriods: Array.isArray(object?.vestingPeriods) + ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MsgCreatePeriodicVestingAccount): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + message.startTime !== undefined && (obj.startTime = Math.round(message.startTime)); + if (message.vestingPeriods) { + obj.vestingPeriods = message.vestingPeriods.map((e) => e ? Period.toJSON(e) : undefined); } else { - message.delayed = false; + obj.vestingPeriods = []; } + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgCreatePeriodicVestingAccount { + const message = createBaseMsgCreatePeriodicVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.startTime = object.startTime ?? 0; + message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || []; return message; }, }; -const baseMsgCreateVestingAccountResponse: object = {}; +function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicVestingAccountResponse { + return {}; +} -export const MsgCreateVestingAccountResponse = { - encode( - _: MsgCreateVestingAccountResponse, - writer: Writer = Writer.create() - ): Writer { +export const MsgCreatePeriodicVestingAccountResponse = { + encode(_: MsgCreatePeriodicVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgCreateVestingAccountResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -198,24 +417,19 @@ export const MsgCreateVestingAccountResponse = { return message; }, - fromJSON(_: any): MsgCreateVestingAccountResponse { - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; - return message; + fromJSON(_: any): MsgCreatePeriodicVestingAccountResponse { + return {}; }, - toJSON(_: MsgCreateVestingAccountResponse): unknown { + toJSON(_: MsgCreatePeriodicVestingAccountResponse): unknown { const obj: any = {}; return obj; }, - fromPartial( - _: DeepPartial - ): MsgCreateVestingAccountResponse { - const message = { - ...baseMsgCreateVestingAccountResponse, - } as MsgCreateVestingAccountResponse; + fromPartial, I>>( + _: I, + ): MsgCreatePeriodicVestingAccountResponse { + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); return message; }, }; @@ -226,60 +440,92 @@ export interface Msg { * CreateVestingAccount defines a method that enables creating a vesting * account. */ - CreateVestingAccount( - request: MsgCreateVestingAccount - ): Promise; + CreateVestingAccount(request: MsgCreateVestingAccount): Promise; + /** + * CreatePermanentLockedAccount defines a method that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ + CreatePermanentLockedAccount( + request: MsgCreatePermanentLockedAccount, + ): Promise; + /** + * CreatePeriodicVestingAccount defines a method that enables creating a + * periodic vesting account. + * + * Since: cosmos-sdk 0.46 + */ + CreatePeriodicVestingAccount( + request: MsgCreatePeriodicVestingAccount, + ): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.CreateVestingAccount = this.CreateVestingAccount.bind(this); + this.CreatePermanentLockedAccount = this.CreatePermanentLockedAccount.bind(this); + this.CreatePeriodicVestingAccount = this.CreatePeriodicVestingAccount.bind(this); } - CreateVestingAccount( - request: MsgCreateVestingAccount - ): Promise { + CreateVestingAccount(request: MsgCreateVestingAccount): Promise { const data = MsgCreateVestingAccount.encode(request).finish(); - const promise = this.rpc.request( - "cosmos.vesting.v1beta1.Msg", - "CreateVestingAccount", - data - ); - return promise.then((data) => - MsgCreateVestingAccountResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); + return promise.then((data) => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); + } + + CreatePermanentLockedAccount( + request: MsgCreatePermanentLockedAccount, + ): Promise { + const data = MsgCreatePermanentLockedAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePermanentLockedAccount", data); + return promise.then((data) => MsgCreatePermanentLockedAccountResponse.decode(new _m0.Reader(data))); + } + + CreatePeriodicVestingAccount( + request: MsgCreatePeriodicVestingAccount, + ): Promise { + const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePeriodicVestingAccount", data); + return promise.then((data) => MsgCreatePeriodicVestingAccountResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -287,7 +533,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts index bfb1123e97..ad8d31247e 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts @@ -1,9 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { BaseAccount } from "../../../cosmos/auth/v1beta1/auth"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { BaseAccount } from "../../auth/v1beta1/auth"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.vesting.v1beta1"; @@ -12,11 +12,12 @@ export const protobufPackage = "cosmos.vesting.v1beta1"; * the necessary fields needed for any vesting account implementation. */ export interface BaseVestingAccount { - base_account: BaseAccount | undefined; - original_vesting: Coin[]; - delegated_free: Coin[]; - delegated_vesting: Coin[]; - end_time: number; + baseAccount: BaseAccount | undefined; + originalVesting: Coin[]; + delegatedFree: Coin[]; + delegatedVesting: Coin[]; + /** Vesting end time, as unix timestamp (in seconds). */ + endTime: number; } /** @@ -24,8 +25,11 @@ export interface BaseVestingAccount { * continuously vests by unlocking coins linearly with respect to time. */ export interface ContinuousVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; - start_time: number; + baseVestingAccount: + | BaseVestingAccount + | undefined; + /** Vesting start time, as unix timestamp (in seconds). */ + startTime: number; } /** @@ -34,11 +38,12 @@ export interface ContinuousVestingAccount { * locked until a specified time. */ export interface DelayedVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; + baseVestingAccount: BaseVestingAccount | undefined; } /** Period defines a length of time and amount of coins that will vest. */ export interface Period { + /** Period duration in seconds. */ length: number; amount: Coin[]; } @@ -48,9 +53,9 @@ export interface Period { * periodically vests by unlocking coins during each specified period. */ export interface PeriodicVestingAccount { - base_vesting_account: BaseVestingAccount | undefined; - start_time: number; - vesting_periods: Period[]; + baseVestingAccount: BaseVestingAccount | undefined; + startTime: number; + vestingPeriods: Period[]; } /** @@ -61,61 +66,54 @@ export interface PeriodicVestingAccount { * Since: cosmos-sdk 0.43 */ export interface PermanentLockedAccount { - base_vesting_account: BaseVestingAccount | undefined; + baseVestingAccount: BaseVestingAccount | undefined; } -const baseBaseVestingAccount: object = { end_time: 0 }; +function createBaseBaseVestingAccount(): BaseVestingAccount { + return { baseAccount: undefined, originalVesting: [], delegatedFree: [], delegatedVesting: [], endTime: 0 }; +} export const BaseVestingAccount = { - encode( - message: BaseVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_account !== undefined) { - BaseAccount.encode( - message.base_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: BaseVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } - for (const v of message.original_vesting) { + for (const v of message.originalVesting) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } - for (const v of message.delegated_free) { + for (const v of message.delegatedFree) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.delegated_vesting) { + for (const v of message.delegatedVesting) { Coin.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.end_time !== 0) { - writer.uint32(40).int64(message.end_time); + if (message.endTime !== 0) { + writer.uint32(40).int64(message.endTime); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): BaseVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; + const message = createBaseBaseVestingAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_account = BaseAccount.decode(reader, reader.uint32()); + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); break; case 2: - message.original_vesting.push(Coin.decode(reader, reader.uint32())); + message.originalVesting.push(Coin.decode(reader, reader.uint32())); break; case 3: - message.delegated_free.push(Coin.decode(reader, reader.uint32())); + message.delegatedFree.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.delegated_vesting.push(Coin.decode(reader, reader.uint32())); + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); break; case 5: - message.end_time = longToNumber(reader.int64() as Long); + message.endTime = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -126,154 +124,82 @@ export const BaseVestingAccount = { }, fromJSON(object: any): BaseVestingAccount { - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromJSON(object.base_account); - } else { - message.base_account = undefined; - } - if ( - object.original_vesting !== undefined && - object.original_vesting !== null - ) { - for (const e of object.original_vesting) { - message.original_vesting.push(Coin.fromJSON(e)); - } - } - if (object.delegated_free !== undefined && object.delegated_free !== null) { - for (const e of object.delegated_free) { - message.delegated_free.push(Coin.fromJSON(e)); - } - } - if ( - object.delegated_vesting !== undefined && - object.delegated_vesting !== null - ) { - for (const e of object.delegated_vesting) { - message.delegated_vesting.push(Coin.fromJSON(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = Number(object.end_time); - } else { - message.end_time = 0; - } - return message; + return { + baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + originalVesting: Array.isArray(object?.originalVesting) + ? object.originalVesting.map((e: any) => Coin.fromJSON(e)) + : [], + delegatedFree: Array.isArray(object?.delegatedFree) ? object.delegatedFree.map((e: any) => Coin.fromJSON(e)) : [], + delegatedVesting: Array.isArray(object?.delegatedVesting) + ? object.delegatedVesting.map((e: any) => Coin.fromJSON(e)) + : [], + endTime: isSet(object.endTime) ? Number(object.endTime) : 0, + }; }, toJSON(message: BaseVestingAccount): unknown { const obj: any = {}; - message.base_account !== undefined && - (obj.base_account = message.base_account - ? BaseAccount.toJSON(message.base_account) - : undefined); - if (message.original_vesting) { - obj.original_vesting = message.original_vesting.map((e) => - e ? Coin.toJSON(e) : undefined - ); + message.baseAccount !== undefined + && (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + if (message.originalVesting) { + obj.originalVesting = message.originalVesting.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.original_vesting = []; + obj.originalVesting = []; } - if (message.delegated_free) { - obj.delegated_free = message.delegated_free.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.delegatedFree) { + obj.delegatedFree = message.delegatedFree.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.delegated_free = []; + obj.delegatedFree = []; } - if (message.delegated_vesting) { - obj.delegated_vesting = message.delegated_vesting.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.delegatedVesting) { + obj.delegatedVesting = message.delegatedVesting.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.delegated_vesting = []; + obj.delegatedVesting = []; } - message.end_time !== undefined && (obj.end_time = message.end_time); + message.endTime !== undefined && (obj.endTime = Math.round(message.endTime)); return obj; }, - fromPartial(object: DeepPartial): BaseVestingAccount { - const message = { ...baseBaseVestingAccount } as BaseVestingAccount; - message.original_vesting = []; - message.delegated_free = []; - message.delegated_vesting = []; - if (object.base_account !== undefined && object.base_account !== null) { - message.base_account = BaseAccount.fromPartial(object.base_account); - } else { - message.base_account = undefined; - } - if ( - object.original_vesting !== undefined && - object.original_vesting !== null - ) { - for (const e of object.original_vesting) { - message.original_vesting.push(Coin.fromPartial(e)); - } - } - if (object.delegated_free !== undefined && object.delegated_free !== null) { - for (const e of object.delegated_free) { - message.delegated_free.push(Coin.fromPartial(e)); - } - } - if ( - object.delegated_vesting !== undefined && - object.delegated_vesting !== null - ) { - for (const e of object.delegated_vesting) { - message.delegated_vesting.push(Coin.fromPartial(e)); - } - } - if (object.end_time !== undefined && object.end_time !== null) { - message.end_time = object.end_time; - } else { - message.end_time = 0; - } + fromPartial, I>>(object: I): BaseVestingAccount { + const message = createBaseBaseVestingAccount(); + message.baseAccount = (object.baseAccount !== undefined && object.baseAccount !== null) + ? BaseAccount.fromPartial(object.baseAccount) + : undefined; + message.originalVesting = object.originalVesting?.map((e) => Coin.fromPartial(e)) || []; + message.delegatedFree = object.delegatedFree?.map((e) => Coin.fromPartial(e)) || []; + message.delegatedVesting = object.delegatedVesting?.map((e) => Coin.fromPartial(e)) || []; + message.endTime = object.endTime ?? 0; return message; }, }; -const baseContinuousVestingAccount: object = { start_time: 0 }; +function createBaseContinuousVestingAccount(): ContinuousVestingAccount { + return { baseVestingAccount: undefined, startTime: 0 }; +} export const ContinuousVestingAccount = { - encode( - message: ContinuousVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: ContinuousVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (message.start_time !== 0) { - writer.uint32(16).int64(message.start_time); + if (message.startTime !== 0) { + writer.uint32(16).int64(message.startTime); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ContinuousVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; + const message = createBaseContinuousVestingAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.start_time = longToNumber(reader.int64() as Long); + message.startTime = longToNumber(reader.int64() as Long); break; default: reader.skipType(tag & 7); @@ -284,90 +210,54 @@ export const ContinuousVestingAccount = { }, fromJSON(object: any): ContinuousVestingAccount { - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = Number(object.start_time); - } else { - message.start_time = 0; - } - return message; + return { + baseVestingAccount: isSet(object.baseVestingAccount) + ? BaseVestingAccount.fromJSON(object.baseVestingAccount) + : undefined, + startTime: isSet(object.startTime) ? Number(object.startTime) : 0, + }; }, toJSON(message: ContinuousVestingAccount): unknown { const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - message.start_time !== undefined && (obj.start_time = message.start_time); + message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + message.startTime !== undefined && (obj.startTime = Math.round(message.startTime)); return obj; }, - fromPartial( - object: DeepPartial - ): ContinuousVestingAccount { - const message = { - ...baseContinuousVestingAccount, - } as ContinuousVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = object.start_time; - } else { - message.start_time = 0; - } + fromPartial, I>>(object: I): ContinuousVestingAccount { + const message = createBaseContinuousVestingAccount(); + message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined; + message.startTime = object.startTime ?? 0; return message; }, }; -const baseDelayedVestingAccount: object = {}; +function createBaseDelayedVestingAccount(): DelayedVestingAccount { + return { baseVestingAccount: undefined }; +} export const DelayedVestingAccount = { - encode( - message: DelayedVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: DelayedVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DelayedVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; + const message = createBaseDelayedVestingAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -378,51 +268,36 @@ export const DelayedVestingAccount = { }, fromJSON(object: any): DelayedVestingAccount { - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; + return { + baseVestingAccount: isSet(object.baseVestingAccount) + ? BaseVestingAccount.fromJSON(object.baseVestingAccount) + : undefined, + }; }, toJSON(message: DelayedVestingAccount): unknown { const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); + message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): DelayedVestingAccount { - const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } + fromPartial, I>>(object: I): DelayedVestingAccount { + const message = createBaseDelayedVestingAccount(); + message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined; return message; }, }; -const basePeriod: object = { length: 0 }; +function createBasePeriod(): Period { + return { length: 0, amount: [] }; +} export const Period = { - encode(message: Period, writer: Writer = Writer.create()): Writer { + encode(message: Period, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.length !== 0) { writer.uint32(8).int64(message.length); } @@ -432,11 +307,10 @@ export const Period = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Period { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Period { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriod } as Period; - message.amount = []; + const message = createBasePeriod(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -455,90 +329,64 @@ export const Period = { }, fromJSON(object: any): Period { - const message = { ...basePeriod } as Period; - message.amount = []; - if (object.length !== undefined && object.length !== null) { - message.length = Number(object.length); - } else { - message.length = 0; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromJSON(e)); - } - } - return message; + return { + length: isSet(object.length) ? Number(object.length) : 0, + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Period): unknown { const obj: any = {}; - message.length !== undefined && (obj.length = message.length); + message.length !== undefined && (obj.length = Math.round(message.length)); if (message.amount) { - obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.amount = message.amount.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amount = []; } return obj; }, - fromPartial(object: DeepPartial): Period { - const message = { ...basePeriod } as Period; - message.amount = []; - if (object.length !== undefined && object.length !== null) { - message.length = object.length; - } else { - message.length = 0; - } - if (object.amount !== undefined && object.amount !== null) { - for (const e of object.amount) { - message.amount.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Period { + const message = createBasePeriod(); + message.length = object.length ?? 0; + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const basePeriodicVestingAccount: object = { start_time: 0 }; +function createBasePeriodicVestingAccount(): PeriodicVestingAccount { + return { baseVestingAccount: undefined, startTime: 0, vestingPeriods: [] }; +} export const PeriodicVestingAccount = { - encode( - message: PeriodicVestingAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: PeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (message.start_time !== 0) { - writer.uint32(16).int64(message.start_time); + if (message.startTime !== 0) { + writer.uint32(16).int64(message.startTime); } - for (const v of message.vesting_periods) { + for (const v of message.vestingPeriods) { Period.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): PeriodicVestingAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; + const message = createBasePeriodicVestingAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.start_time = longToNumber(reader.int64() as Long); + message.startTime = longToNumber(reader.int64() as Long); break; case 3: - message.vesting_periods.push(Period.decode(reader, reader.uint32())); + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -549,111 +397,63 @@ export const PeriodicVestingAccount = { }, fromJSON(object: any): PeriodicVestingAccount { - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = Number(object.start_time); - } else { - message.start_time = 0; - } - if ( - object.vesting_periods !== undefined && - object.vesting_periods !== null - ) { - for (const e of object.vesting_periods) { - message.vesting_periods.push(Period.fromJSON(e)); - } - } - return message; + return { + baseVestingAccount: isSet(object.baseVestingAccount) + ? BaseVestingAccount.fromJSON(object.baseVestingAccount) + : undefined, + startTime: isSet(object.startTime) ? Number(object.startTime) : 0, + vestingPeriods: Array.isArray(object?.vestingPeriods) + ? object.vestingPeriods.map((e: any) => Period.fromJSON(e)) + : [], + }; }, toJSON(message: PeriodicVestingAccount): unknown { const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); - message.start_time !== undefined && (obj.start_time = message.start_time); - if (message.vesting_periods) { - obj.vesting_periods = message.vesting_periods.map((e) => - e ? Period.toJSON(e) : undefined - ); + message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + message.startTime !== undefined && (obj.startTime = Math.round(message.startTime)); + if (message.vestingPeriods) { + obj.vestingPeriods = message.vestingPeriods.map((e) => e ? Period.toJSON(e) : undefined); } else { - obj.vesting_periods = []; + obj.vestingPeriods = []; } return obj; }, - fromPartial( - object: DeepPartial - ): PeriodicVestingAccount { - const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; - message.vesting_periods = []; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.start_time = object.start_time; - } else { - message.start_time = 0; - } - if ( - object.vesting_periods !== undefined && - object.vesting_periods !== null - ) { - for (const e of object.vesting_periods) { - message.vesting_periods.push(Period.fromPartial(e)); - } - } + fromPartial, I>>(object: I): PeriodicVestingAccount { + const message = createBasePeriodicVestingAccount(); + message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined; + message.startTime = object.startTime ?? 0; + message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || []; return message; }, }; -const basePermanentLockedAccount: object = {}; +function createBasePermanentLockedAccount(): PermanentLockedAccount { + return { baseVestingAccount: undefined }; +} export const PermanentLockedAccount = { - encode( - message: PermanentLockedAccount, - writer: Writer = Writer.create() - ): Writer { - if (message.base_vesting_account !== undefined) { - BaseVestingAccount.encode( - message.base_vesting_account, - writer.uint32(10).fork() - ).ldelim(); + encode(message: PermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): PermanentLockedAccount { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; + const message = createBasePermanentLockedAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.base_vesting_account = BaseVestingAccount.decode( - reader, - reader.uint32() - ); + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -664,68 +464,60 @@ export const PermanentLockedAccount = { }, fromJSON(object: any): PermanentLockedAccount { - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromJSON( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } - return message; + return { + baseVestingAccount: isSet(object.baseVestingAccount) + ? BaseVestingAccount.fromJSON(object.baseVestingAccount) + : undefined, + }; }, toJSON(message: PermanentLockedAccount): unknown { const obj: any = {}; - message.base_vesting_account !== undefined && - (obj.base_vesting_account = message.base_vesting_account - ? BaseVestingAccount.toJSON(message.base_vesting_account) - : undefined); + message.baseVestingAccount !== undefined && (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): PermanentLockedAccount { - const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.base_vesting_account = BaseVestingAccount.fromPartial( - object.base_vesting_account - ); - } else { - message.base_vesting_account = undefined; - } + fromPartial, I>>(object: I): PermanentLockedAccount { + const message = createBasePermanentLockedAccount(); + message.baseVestingAccount = (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) + ? BaseVestingAccount.fromPartial(object.baseVestingAccount) + : undefined; 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -733,7 +525,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmos.vesting.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/index.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/index.ts index 8fe760484b..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/index.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/index.ts @@ -1,85 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgInstantiateContract } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgUpdateAdmin } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgInstantiateContract2 } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgIBCCloseChannel } from "./types/cosmwasm/wasm/v1/ibc"; -import { MsgMigrateContract } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgStoreCode } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgExecuteContract } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgClearAdmin } from "./types/cosmwasm/wasm/v1/tx"; -import { MsgIBCSend } from "./types/cosmwasm/wasm/v1/ibc"; - - -const types = [ - ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], - ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], - ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], - ["/cosmwasm.wasm.v1.MsgIBCCloseChannel", MsgIBCCloseChannel], - ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], - ["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], - ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], - ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], - ["/cosmwasm.wasm.v1.MsgIBCSend", MsgIBCSend], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgInstantiateContract: (data: MsgInstantiateContract): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", value: MsgInstantiateContract.fromPartial( data ) }), - msgUpdateAdmin: (data: MsgUpdateAdmin): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", value: MsgUpdateAdmin.fromPartial( data ) }), - msgInstantiateContract2: (data: MsgInstantiateContract2): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", value: MsgInstantiateContract2.fromPartial( data ) }), - msgIBCCloseChannel: (data: MsgIBCCloseChannel): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel", value: MsgIBCCloseChannel.fromPartial( data ) }), - msgMigrateContract: (data: MsgMigrateContract): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", value: MsgMigrateContract.fromPartial( data ) }), - msgStoreCode: (data: MsgStoreCode): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", value: MsgStoreCode.fromPartial( data ) }), - msgExecuteContract: (data: MsgExecuteContract): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial( data ) }), - msgClearAdmin: (data: MsgClearAdmin): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", value: MsgClearAdmin.fromPartial( data ) }), - msgIBCSend: (data: MsgIBCSend): EncodeObject => ({ typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend", value: MsgIBCSend.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/module.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/module.ts new file mode 100755 index 0000000000..3d7e5c8910 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/module.ts @@ -0,0 +1,765 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgMigrateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreAndMigrateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgInstantiateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgPinCodes } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgClearAdmin } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgIBCSend } from "./types/cosmwasm/wasm/v1/ibc"; +import { MsgSudoContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgExecuteContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgAddCodeUploadParamsAddresses } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreCode } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgInstantiateContract2 } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgIBCCloseChannel } from "./types/cosmwasm/wasm/v1/ibc"; +import { MsgUpdateParams } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgRemoveCodeUploadParamsAddresses } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUnpinCodes } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUpdateInstantiateConfig } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUpdateAdmin } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreAndInstantiateContract } from "./types/cosmwasm/wasm/v1/tx"; + +import { StoreCodeAuthorization as typeStoreCodeAuthorization} from "./types" +import { ContractExecutionAuthorization as typeContractExecutionAuthorization} from "./types" +import { ContractMigrationAuthorization as typeContractMigrationAuthorization} from "./types" +import { CodeGrant as typeCodeGrant} from "./types" +import { ContractGrant as typeContractGrant} from "./types" +import { MaxCallsLimit as typeMaxCallsLimit} from "./types" +import { MaxFundsLimit as typeMaxFundsLimit} from "./types" +import { CombinedLimit as typeCombinedLimit} from "./types" +import { AllowAllMessagesFilter as typeAllowAllMessagesFilter} from "./types" +import { AcceptedMessageKeysFilter as typeAcceptedMessageKeysFilter} from "./types" +import { AcceptedMessagesFilter as typeAcceptedMessagesFilter} from "./types" +import { Code as typeCode} from "./types" +import { Contract as typeContract} from "./types" +import { Sequence as typeSequence} from "./types" +import { MsgIBCSendResponse as typeMsgIBCSendResponse} from "./types" +import { StoreCodeProposal as typeStoreCodeProposal} from "./types" +import { InstantiateContractProposal as typeInstantiateContractProposal} from "./types" +import { InstantiateContract2Proposal as typeInstantiateContract2Proposal} from "./types" +import { MigrateContractProposal as typeMigrateContractProposal} from "./types" +import { SudoContractProposal as typeSudoContractProposal} from "./types" +import { ExecuteContractProposal as typeExecuteContractProposal} from "./types" +import { UpdateAdminProposal as typeUpdateAdminProposal} from "./types" +import { ClearAdminProposal as typeClearAdminProposal} from "./types" +import { PinCodesProposal as typePinCodesProposal} from "./types" +import { UnpinCodesProposal as typeUnpinCodesProposal} from "./types" +import { AccessConfigUpdate as typeAccessConfigUpdate} from "./types" +import { UpdateInstantiateConfigProposal as typeUpdateInstantiateConfigProposal} from "./types" +import { StoreAndInstantiateContractProposal as typeStoreAndInstantiateContractProposal} from "./types" +import { CodeInfoResponse as typeCodeInfoResponse} from "./types" +import { AccessTypeParam as typeAccessTypeParam} from "./types" +import { AccessConfig as typeAccessConfig} from "./types" +import { Params as typeParams} from "./types" +import { CodeInfo as typeCodeInfo} from "./types" +import { ContractInfo as typeContractInfo} from "./types" +import { ContractCodeHistoryEntry as typeContractCodeHistoryEntry} from "./types" +import { AbsoluteTxPosition as typeAbsoluteTxPosition} from "./types" +import { Model as typeModel} from "./types" + +export { MsgMigrateContract, MsgStoreAndMigrateContract, MsgInstantiateContract, MsgPinCodes, MsgClearAdmin, MsgIBCSend, MsgSudoContract, MsgExecuteContract, MsgAddCodeUploadParamsAddresses, MsgStoreCode, MsgInstantiateContract2, MsgIBCCloseChannel, MsgUpdateParams, MsgRemoveCodeUploadParamsAddresses, MsgUnpinCodes, MsgUpdateInstantiateConfig, MsgUpdateAdmin, MsgStoreAndInstantiateContract }; + +type sendMsgMigrateContractParams = { + value: MsgMigrateContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgStoreAndMigrateContractParams = { + value: MsgStoreAndMigrateContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgInstantiateContractParams = { + value: MsgInstantiateContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgPinCodesParams = { + value: MsgPinCodes, + fee?: StdFee, + memo?: string +}; + +type sendMsgClearAdminParams = { + value: MsgClearAdmin, + fee?: StdFee, + memo?: string +}; + +type sendMsgIBCSendParams = { + value: MsgIBCSend, + fee?: StdFee, + memo?: string +}; + +type sendMsgSudoContractParams = { + value: MsgSudoContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgExecuteContractParams = { + value: MsgExecuteContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgAddCodeUploadParamsAddressesParams = { + value: MsgAddCodeUploadParamsAddresses, + fee?: StdFee, + memo?: string +}; + +type sendMsgStoreCodeParams = { + value: MsgStoreCode, + fee?: StdFee, + memo?: string +}; + +type sendMsgInstantiateContract2Params = { + value: MsgInstantiateContract2, + fee?: StdFee, + memo?: string +}; + +type sendMsgIBCCloseChannelParams = { + value: MsgIBCCloseChannel, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateParamsParams = { + value: MsgUpdateParams, + fee?: StdFee, + memo?: string +}; + +type sendMsgRemoveCodeUploadParamsAddressesParams = { + value: MsgRemoveCodeUploadParamsAddresses, + fee?: StdFee, + memo?: string +}; + +type sendMsgUnpinCodesParams = { + value: MsgUnpinCodes, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateInstantiateConfigParams = { + value: MsgUpdateInstantiateConfig, + fee?: StdFee, + memo?: string +}; + +type sendMsgUpdateAdminParams = { + value: MsgUpdateAdmin, + fee?: StdFee, + memo?: string +}; + +type sendMsgStoreAndInstantiateContractParams = { + value: MsgStoreAndInstantiateContract, + fee?: StdFee, + memo?: string +}; + + +type msgMigrateContractParams = { + value: MsgMigrateContract, +}; + +type msgStoreAndMigrateContractParams = { + value: MsgStoreAndMigrateContract, +}; + +type msgInstantiateContractParams = { + value: MsgInstantiateContract, +}; + +type msgPinCodesParams = { + value: MsgPinCodes, +}; + +type msgClearAdminParams = { + value: MsgClearAdmin, +}; + +type msgIBCSendParams = { + value: MsgIBCSend, +}; + +type msgSudoContractParams = { + value: MsgSudoContract, +}; + +type msgExecuteContractParams = { + value: MsgExecuteContract, +}; + +type msgAddCodeUploadParamsAddressesParams = { + value: MsgAddCodeUploadParamsAddresses, +}; + +type msgStoreCodeParams = { + value: MsgStoreCode, +}; + +type msgInstantiateContract2Params = { + value: MsgInstantiateContract2, +}; + +type msgIBCCloseChannelParams = { + value: MsgIBCCloseChannel, +}; + +type msgUpdateParamsParams = { + value: MsgUpdateParams, +}; + +type msgRemoveCodeUploadParamsAddressesParams = { + value: MsgRemoveCodeUploadParamsAddresses, +}; + +type msgUnpinCodesParams = { + value: MsgUnpinCodes, +}; + +type msgUpdateInstantiateConfigParams = { + value: MsgUpdateInstantiateConfig, +}; + +type msgUpdateAdminParams = { + value: MsgUpdateAdmin, +}; + +type msgStoreAndInstantiateContractParams = { + value: MsgStoreAndInstantiateContract, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgMigrateContract({ value, fee, memo }: sendMsgMigrateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgMigrateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgMigrateContract({ value: MsgMigrateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgMigrateContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgStoreAndMigrateContract({ value, fee, memo }: sendMsgStoreAndMigrateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgStoreAndMigrateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgStoreAndMigrateContract({ value: MsgStoreAndMigrateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgStoreAndMigrateContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgInstantiateContract({ value, fee, memo }: sendMsgInstantiateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgInstantiateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgInstantiateContract({ value: MsgInstantiateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgInstantiateContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgPinCodes({ value, fee, memo }: sendMsgPinCodesParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgPinCodes: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgPinCodes({ value: MsgPinCodes.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgPinCodes: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgClearAdmin({ value, fee, memo }: sendMsgClearAdminParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgClearAdmin: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgClearAdmin({ value: MsgClearAdmin.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgClearAdmin: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgIBCSend({ value, fee, memo }: sendMsgIBCSendParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgIBCSend: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgIBCSend({ value: MsgIBCSend.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgIBCSend: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgSudoContract({ value, fee, memo }: sendMsgSudoContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSudoContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSudoContract({ value: MsgSudoContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSudoContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgExecuteContract({ value, fee, memo }: sendMsgExecuteContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgExecuteContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgExecuteContract({ value: MsgExecuteContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgExecuteContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgAddCodeUploadParamsAddresses({ value, fee, memo }: sendMsgAddCodeUploadParamsAddressesParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgAddCodeUploadParamsAddresses: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgAddCodeUploadParamsAddresses({ value: MsgAddCodeUploadParamsAddresses.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgAddCodeUploadParamsAddresses: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgStoreCode({ value, fee, memo }: sendMsgStoreCodeParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgStoreCode: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgStoreCode({ value: MsgStoreCode.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgStoreCode: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgInstantiateContract2({ value, fee, memo }: sendMsgInstantiateContract2Params): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgInstantiateContract2: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgInstantiateContract2({ value: MsgInstantiateContract2.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgInstantiateContract2: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgIBCCloseChannel({ value, fee, memo }: sendMsgIBCCloseChannelParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgIBCCloseChannel: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgIBCCloseChannel({ value: MsgIBCCloseChannel.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgIBCCloseChannel: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgRemoveCodeUploadParamsAddresses({ value, fee, memo }: sendMsgRemoveCodeUploadParamsAddressesParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgRemoveCodeUploadParamsAddresses: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgRemoveCodeUploadParamsAddresses({ value: MsgRemoveCodeUploadParamsAddresses.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgRemoveCodeUploadParamsAddresses: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUnpinCodes({ value, fee, memo }: sendMsgUnpinCodesParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUnpinCodes: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUnpinCodes({ value: MsgUnpinCodes.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUnpinCodes: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateInstantiateConfig({ value, fee, memo }: sendMsgUpdateInstantiateConfigParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateInstantiateConfig: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateInstantiateConfig({ value: MsgUpdateInstantiateConfig.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateInstantiateConfig: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgUpdateAdmin({ value, fee, memo }: sendMsgUpdateAdminParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgUpdateAdmin: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgUpdateAdmin({ value: MsgUpdateAdmin.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgUpdateAdmin: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgStoreAndInstantiateContract({ value, fee, memo }: sendMsgStoreAndInstantiateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgStoreAndInstantiateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgStoreAndInstantiateContract({ value: MsgStoreAndInstantiateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgStoreAndInstantiateContract: Could not broadcast Tx: '+ e.message) + } + }, + + + msgMigrateContract({ value }: msgMigrateContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", value: MsgMigrateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgMigrateContract: Could not create message: ' + e.message) + } + }, + + msgStoreAndMigrateContract({ value }: msgStoreAndMigrateContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", value: MsgStoreAndMigrateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgStoreAndMigrateContract: Could not create message: ' + e.message) + } + }, + + msgInstantiateContract({ value }: msgInstantiateContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", value: MsgInstantiateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgInstantiateContract: Could not create message: ' + e.message) + } + }, + + msgPinCodes({ value }: msgPinCodesParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", value: MsgPinCodes.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgPinCodes: Could not create message: ' + e.message) + } + }, + + msgClearAdmin({ value }: msgClearAdminParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", value: MsgClearAdmin.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgClearAdmin: Could not create message: ' + e.message) + } + }, + + msgIBCSend({ value }: msgIBCSendParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend", value: MsgIBCSend.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgIBCSend: Could not create message: ' + e.message) + } + }, + + msgSudoContract({ value }: msgSudoContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", value: MsgSudoContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSudoContract: Could not create message: ' + e.message) + } + }, + + msgExecuteContract({ value }: msgExecuteContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgExecuteContract: Could not create message: ' + e.message) + } + }, + + msgAddCodeUploadParamsAddresses({ value }: msgAddCodeUploadParamsAddressesParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", value: MsgAddCodeUploadParamsAddresses.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgAddCodeUploadParamsAddresses: Could not create message: ' + e.message) + } + }, + + msgStoreCode({ value }: msgStoreCodeParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", value: MsgStoreCode.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgStoreCode: Could not create message: ' + e.message) + } + }, + + msgInstantiateContract2({ value }: msgInstantiateContract2Params): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", value: MsgInstantiateContract2.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgInstantiateContract2: Could not create message: ' + e.message) + } + }, + + msgIBCCloseChannel({ value }: msgIBCCloseChannelParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel", value: MsgIBCCloseChannel.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgIBCCloseChannel: Could not create message: ' + e.message) + } + }, + + msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message) + } + }, + + msgRemoveCodeUploadParamsAddresses({ value }: msgRemoveCodeUploadParamsAddressesParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", value: MsgRemoveCodeUploadParamsAddresses.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgRemoveCodeUploadParamsAddresses: Could not create message: ' + e.message) + } + }, + + msgUnpinCodes({ value }: msgUnpinCodesParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", value: MsgUnpinCodes.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUnpinCodes: Could not create message: ' + e.message) + } + }, + + msgUpdateInstantiateConfig({ value }: msgUpdateInstantiateConfigParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateInstantiateConfig: Could not create message: ' + e.message) + } + }, + + msgUpdateAdmin({ value }: msgUpdateAdminParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", value: MsgUpdateAdmin.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgUpdateAdmin: Could not create message: ' + e.message) + } + }, + + msgStoreAndInstantiateContract({ value }: msgStoreAndInstantiateContractParams): EncodeObject { + try { + return { typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", value: MsgStoreAndInstantiateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgStoreAndInstantiateContract: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + StoreCodeAuthorization: getStructure(typeStoreCodeAuthorization.fromPartial({})), + ContractExecutionAuthorization: getStructure(typeContractExecutionAuthorization.fromPartial({})), + ContractMigrationAuthorization: getStructure(typeContractMigrationAuthorization.fromPartial({})), + CodeGrant: getStructure(typeCodeGrant.fromPartial({})), + ContractGrant: getStructure(typeContractGrant.fromPartial({})), + MaxCallsLimit: getStructure(typeMaxCallsLimit.fromPartial({})), + MaxFundsLimit: getStructure(typeMaxFundsLimit.fromPartial({})), + CombinedLimit: getStructure(typeCombinedLimit.fromPartial({})), + AllowAllMessagesFilter: getStructure(typeAllowAllMessagesFilter.fromPartial({})), + AcceptedMessageKeysFilter: getStructure(typeAcceptedMessageKeysFilter.fromPartial({})), + AcceptedMessagesFilter: getStructure(typeAcceptedMessagesFilter.fromPartial({})), + Code: getStructure(typeCode.fromPartial({})), + Contract: getStructure(typeContract.fromPartial({})), + Sequence: getStructure(typeSequence.fromPartial({})), + MsgIBCSendResponse: getStructure(typeMsgIBCSendResponse.fromPartial({})), + StoreCodeProposal: getStructure(typeStoreCodeProposal.fromPartial({})), + InstantiateContractProposal: getStructure(typeInstantiateContractProposal.fromPartial({})), + InstantiateContract2Proposal: getStructure(typeInstantiateContract2Proposal.fromPartial({})), + MigrateContractProposal: getStructure(typeMigrateContractProposal.fromPartial({})), + SudoContractProposal: getStructure(typeSudoContractProposal.fromPartial({})), + ExecuteContractProposal: getStructure(typeExecuteContractProposal.fromPartial({})), + UpdateAdminProposal: getStructure(typeUpdateAdminProposal.fromPartial({})), + ClearAdminProposal: getStructure(typeClearAdminProposal.fromPartial({})), + PinCodesProposal: getStructure(typePinCodesProposal.fromPartial({})), + UnpinCodesProposal: getStructure(typeUnpinCodesProposal.fromPartial({})), + AccessConfigUpdate: getStructure(typeAccessConfigUpdate.fromPartial({})), + UpdateInstantiateConfigProposal: getStructure(typeUpdateInstantiateConfigProposal.fromPartial({})), + StoreAndInstantiateContractProposal: getStructure(typeStoreAndInstantiateContractProposal.fromPartial({})), + CodeInfoResponse: getStructure(typeCodeInfoResponse.fromPartial({})), + AccessTypeParam: getStructure(typeAccessTypeParam.fromPartial({})), + AccessConfig: getStructure(typeAccessConfig.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + CodeInfo: getStructure(typeCodeInfo.fromPartial({})), + ContractInfo: getStructure(typeContractInfo.fromPartial({})), + ContractCodeHistoryEntry: getStructure(typeContractCodeHistoryEntry.fromPartial({})), + AbsoluteTxPosition: getStructure(typeAbsoluteTxPosition.fromPartial({})), + Model: getStructure(typeModel.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + CosmwasmWasmV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/registry.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/registry.ts new file mode 100755 index 0000000000..c1b60f10a3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/registry.ts @@ -0,0 +1,44 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgMigrateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreAndMigrateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgInstantiateContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgPinCodes } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgClearAdmin } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgIBCSend } from "./types/cosmwasm/wasm/v1/ibc"; +import { MsgSudoContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgExecuteContract } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgAddCodeUploadParamsAddresses } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreCode } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgInstantiateContract2 } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgIBCCloseChannel } from "./types/cosmwasm/wasm/v1/ibc"; +import { MsgUpdateParams } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgRemoveCodeUploadParamsAddresses } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUnpinCodes } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUpdateInstantiateConfig } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgUpdateAdmin } from "./types/cosmwasm/wasm/v1/tx"; +import { MsgStoreAndInstantiateContract } from "./types/cosmwasm/wasm/v1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], + ["/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", MsgStoreAndMigrateContract], + ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], + ["/cosmwasm.wasm.v1.MsgPinCodes", MsgPinCodes], + ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], + ["/cosmwasm.wasm.v1.MsgIBCSend", MsgIBCSend], + ["/cosmwasm.wasm.v1.MsgSudoContract", MsgSudoContract], + ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], + ["/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", MsgAddCodeUploadParamsAddresses], + ["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], + ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], + ["/cosmwasm.wasm.v1.MsgIBCCloseChannel", MsgIBCCloseChannel], + ["/cosmwasm.wasm.v1.MsgUpdateParams", MsgUpdateParams], + ["/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", MsgRemoveCodeUploadParamsAddresses], + ["/cosmwasm.wasm.v1.MsgUnpinCodes", MsgUnpinCodes], + ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig], + ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], + ["/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", MsgStoreAndInstantiateContract], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/rest.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/rest.ts index a523055f98..bb009ab794 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/rest.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/rest.ts @@ -107,7 +107,6 @@ export interface ProtobufAny { * expect it to use in the context of Any. However, for URLs which use the * scheme `http`, `https`, or no scheme, one can optionally set up a type * server that maps type URLs to message definitions as follows: - * * * If no scheme is provided, `https` is assumed. * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. @@ -116,11 +115,9 @@ export interface ProtobufAny { * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with * type.googleapis.com. - * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ @@ -139,10 +136,17 @@ export interface RpcStatus { ordering of transactions. */ export interface V1AbsoluteTxPosition { - /** @format uint64 */ + /** + * BlockHeight is the block the contract was created at + * @format uint64 + */ block_height?: string; - /** @format uint64 */ + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + * @format uint64 + */ tx_index?: string; } @@ -153,34 +157,31 @@ export interface V1AccessConfig { /** * - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value * - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - * - ACCESS_TYPE_ONLY_ADDRESS: AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead * - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted * - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses */ permission?: V1AccessType; - address?: string; addresses?: string[]; } /** * - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - - ACCESS_TYPE_ONLY_ADDRESS: AccessTypeOnlyAddress restricted to a single address -Deprecated: use AccessTypeAnyOfAddresses instead - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses */ export enum V1AccessType { ACCESS_TYPE_UNSPECIFIED = "ACCESS_TYPE_UNSPECIFIED", ACCESS_TYPE_NOBODY = "ACCESS_TYPE_NOBODY", - ACCESS_TYPE_ONLY_ADDRESS = "ACCESS_TYPE_ONLY_ADDRESS", ACCESS_TYPE_EVERYBODY = "ACCESS_TYPE_EVERYBODY", ACCESS_TYPE_ANY_OF_ADDRESSES = "ACCESS_TYPE_ANY_OF_ADDRESSES", } export interface V1CodeInfoResponse { - /** @format uint64 */ + /** + * id for legacy support + * @format uint64 + */ code_id?: string; creator?: string; @@ -203,7 +204,10 @@ export interface V1ContractCodeHistoryEntry { */ operation?: V1ContractCodeHistoryOperationType; - /** @format uint64 */ + /** + * CodeID is the reference to the stored WASM code + * @format uint64 + */ code_id?: string; /** Updated Tx position when the operation was executed. */ @@ -226,41 +230,36 @@ export enum V1ContractCodeHistoryOperationType { CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS", } -export interface V1ContractInfo { - /** @format uint64 */ - code_id?: string; - creator?: string; - admin?: string; - - /** Label is optional metadata to be stored with a contract instance. */ - label?: string; - - /** Created Tx position when the contract was instantiated. */ - created?: V1AbsoluteTxPosition; - ibc_port_id?: string; - +export interface V1Model { /** - * Extension is an extension point to store custom metadata within the - * persistence model. + * hex-encode key to read it better (this is often ascii) + * @format byte */ - extension?: ProtobufAny; -} - -export interface V1Model { - /** @format byte */ key?: string; - /** @format byte */ + /** + * base64-encode raw value + * @format byte + */ value?: string; } +/** +* MsgAddCodeUploadParamsAddressesResponse defines the response +structure for executing a MsgAddCodeUploadParamsAddresses message. +*/ +export type V1MsgAddCodeUploadParamsAddressesResponse = object; + export type V1MsgClearAdminResponse = object; /** * MsgExecuteContractResponse returns execution result data. */ export interface V1MsgExecuteContractResponse { - /** @format byte */ + /** + * Data contains bytes to returned from the contract + * @format byte + */ data?: string; } @@ -268,7 +267,10 @@ export interface V1MsgInstantiateContract2Response { /** Address is the bech32 address of the new contract instance. */ address?: string; - /** @format byte */ + /** + * Data contains bytes to returned from the contract + * @format byte + */ data?: string; } @@ -276,7 +278,10 @@ export interface V1MsgInstantiateContractResponse { /** Address is the bech32 address of the new contract instance. */ address?: string; - /** @format byte */ + /** + * Data contains bytes to returned from the contract + * @format byte + */ data?: string; } @@ -284,7 +289,68 @@ export interface V1MsgInstantiateContractResponse { * MsgMigrateContractResponse returns contract migration result data. */ export interface V1MsgMigrateContractResponse { - /** @format byte */ + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + * @format byte + */ + data?: string; +} + +/** +* MsgPinCodesResponse defines the response structure for executing a +MsgPinCodes message. + +Since: 0.40 +*/ +export type V1MsgPinCodesResponse = object; + +/** +* MsgRemoveCodeUploadParamsAddressesResponse defines the response +structure for executing a MsgRemoveCodeUploadParamsAddresses message. +*/ +export type V1MsgRemoveCodeUploadParamsAddressesResponse = object; + +/** +* MsgStoreAndInstantiateContractResponse defines the response structure +for executing a MsgStoreAndInstantiateContract message. + +Since: 0.40 +*/ +export interface V1MsgStoreAndInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + + /** + * Data contains bytes to returned from the contract + * @format byte + */ + data?: string; +} + +/** +* MsgStoreAndMigrateContractResponse defines the response structure +for executing a MsgStoreAndMigrateContract message. + +Since: 0.42 +*/ +export interface V1MsgStoreAndMigrateContractResponse { + /** + * CodeID is the reference to the stored WASM code + * @format uint64 + */ + code_id?: string; + + /** + * Checksum is the sha256 hash of the stored code + * @format byte + */ + checksum?: string; + + /** + * Data contains bytes to returned from the contract + * @format byte + */ data?: string; } @@ -292,33 +358,55 @@ export interface V1MsgMigrateContractResponse { * MsgStoreCodeResponse returns store result data. */ export interface V1MsgStoreCodeResponse { - /** @format uint64 */ + /** + * CodeID is the reference to the stored WASM code + * @format uint64 + */ code_id?: string; - /** @format byte */ + /** + * Checksum is the sha256 hash of the stored code + * @format byte + */ checksum?: string; } -export type V1MsgUpdateAdminResponse = object; - /** - * Params defines the set of wasm parameters. - */ -export interface V1Params { - /** AccessConfig access control type. */ - code_upload_access?: V1AccessConfig; +* MsgSudoContractResponse defines the response structure for executing a +MsgSudoContract message. +Since: 0.40 +*/ +export interface V1MsgSudoContractResponse { /** - * - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value - * - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden - * - ACCESS_TYPE_ONLY_ADDRESS: AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead - * - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted - * - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + * Data contains bytes to returned from the contract + * @format byte */ - instantiate_default_permission?: V1AccessType; + data?: string; } +/** +* MsgUnpinCodesResponse defines the response structure for executing a +MsgUnpinCodes message. + +Since: 0.40 +*/ +export type V1MsgUnpinCodesResponse = object; + +export type V1MsgUpdateAdminResponse = object; + +export type V1MsgUpdateContractLabelResponse = object; + +export type V1MsgUpdateInstantiateConfigResponse = object; + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: 0.40 +*/ +export type V1MsgUpdateParamsResponse = object; + export interface V1QueryAllContractStateResponse { models?: V1Model[]; @@ -348,11 +436,13 @@ export interface V1QueryContractHistoryResponse { } export interface V1QueryContractInfoResponse { + /** address is the address of the contract */ address?: string; - contract_info?: V1ContractInfo; + contract_info?: Wasmv1ContractInfo; } export interface V1QueryContractsByCodeResponse { + /** contracts are a set of contract addresses */ contracts?: string[]; /** pagination defines the pagination in the response. */ @@ -364,6 +454,7 @@ export interface V1QueryContractsByCodeResponse { Query/ContractsByCreator RPC method. */ export interface V1QueryContractsByCreatorResponse { + /** ContractAddresses result set */ contract_addresses?: string[]; /** Pagination defines the pagination in the response. */ @@ -375,7 +466,7 @@ export interface V1QueryContractsByCreatorResponse { */ export interface V1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: V1Params; + params?: Wasmv1Params; } export interface V1QueryPinnedCodesResponse { @@ -386,12 +477,18 @@ export interface V1QueryPinnedCodesResponse { } export interface V1QueryRawContractStateResponse { - /** @format byte */ + /** + * Data contains the raw store data + * @format byte + */ data?: string; } export interface V1QuerySmartContractStateResponse { - /** @format byte */ + /** + * Data contains the json data returned from the smart contract + * @format byte + */ data?: string; } @@ -443,6 +540,13 @@ export interface V1Beta1PageRequest { * is set. */ count_total?: boolean; + + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse?: boolean; } /** @@ -455,17 +559,70 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } +export interface Wasmv1ContractInfo { + /** + * CodeID is the reference to the stored Wasm code + * @format uint64 + */ + code_id?: string; + + /** Creator address who initially instantiated the contract */ + creator?: string; + + /** Admin is an optional address that can execute migrations */ + admin?: string; + + /** Label is optional metadata to be stored with a contract instance. */ + label?: string; + + /** Created Tx position when the contract was instantiated. */ + created?: V1AbsoluteTxPosition; + ibc_port_id?: string; + + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: ProtobufAny; +} + +/** + * Params defines the set of wasm parameters. + */ +export interface Wasmv1Params { + /** AccessConfig access control type. */ + code_upload_access?: V1AccessConfig; + + /** + * - ACCESS_TYPE_UNSPECIFIED: AccessTypeUnspecified placeholder for empty value + * - ACCESS_TYPE_NOBODY: AccessTypeNobody forbidden + * - ACCESS_TYPE_EVERYBODY: AccessTypeEverybody unrestricted + * - ACCESS_TYPE_ANY_OF_ADDRESSES: AccessTypeAnyOfAddresses allow any of the addresses + */ + instantiate_default_permission?: V1AccessType; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -475,30 +632,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -506,149 +654,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } @@ -672,6 +757,7 @@ export class Api extends HttpClient @@ -691,9 +777,9 @@ export class Api extends HttpClient + queryCode = (codeId: string, params: RequestParams = {}) => this.request({ - path: `/cosmwasm/wasm/v1/code/${code_id}`, + path: `/cosmwasm/wasm/v1/code/${codeId}`, method: "GET", format: "json", ...params, @@ -708,17 +794,18 @@ export class Api extends HttpClient this.request({ - path: `/cosmwasm/wasm/v1/code/${code_id}/contracts`, + path: `/cosmwasm/wasm/v1/code/${codeId}/contracts`, method: "GET", query: query, format: "json", @@ -755,6 +842,7 @@ export class Api extends HttpClient @@ -797,6 +885,7 @@ export class Api extends HttpClient @@ -816,9 +905,9 @@ export class Api extends HttpClient + queryRawContractState = (address: string, queryData: string, params: RequestParams = {}) => this.request({ - path: `/cosmwasm/wasm/v1/contract/${address}/raw/${query_data}`, + path: `/cosmwasm/wasm/v1/contract/${address}/raw/${queryData}`, method: "GET", format: "json", ...params, @@ -832,9 +921,9 @@ export class Api extends HttpClient + querySmartContractState = (address: string, queryData: string, params: RequestParams = {}) => this.request({ - path: `/cosmwasm/wasm/v1/contract/${address}/smart/${query_data}`, + path: `/cosmwasm/wasm/v1/contract/${address}/smart/${queryData}`, method: "GET", format: "json", ...params, @@ -855,6 +944,7 @@ export class Api extends HttpClient @@ -875,17 +965,18 @@ export class Api extends HttpClient this.request({ - path: `/cosmwasm/wasm/v1/contracts/creator/${creator_address}`, + path: `/cosmwasm/wasm/v1/contracts/creator/${creatorAddress}`, method: "GET", query: query, format: "json", diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types.ts new file mode 100755 index 0000000000..0dae9a994f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types.ts @@ -0,0 +1,80 @@ +//@ts-nocheck +import { StoreCodeAuthorization } from "./types/cosmwasm/wasm/v1/authz" +import { ContractExecutionAuthorization } from "./types/cosmwasm/wasm/v1/authz" +import { ContractMigrationAuthorization } from "./types/cosmwasm/wasm/v1/authz" +import { CodeGrant } from "./types/cosmwasm/wasm/v1/authz" +import { ContractGrant } from "./types/cosmwasm/wasm/v1/authz" +import { MaxCallsLimit } from "./types/cosmwasm/wasm/v1/authz" +import { MaxFundsLimit } from "./types/cosmwasm/wasm/v1/authz" +import { CombinedLimit } from "./types/cosmwasm/wasm/v1/authz" +import { AllowAllMessagesFilter } from "./types/cosmwasm/wasm/v1/authz" +import { AcceptedMessageKeysFilter } from "./types/cosmwasm/wasm/v1/authz" +import { AcceptedMessagesFilter } from "./types/cosmwasm/wasm/v1/authz" +import { Code } from "./types/cosmwasm/wasm/v1/genesis" +import { Contract } from "./types/cosmwasm/wasm/v1/genesis" +import { Sequence } from "./types/cosmwasm/wasm/v1/genesis" +import { MsgIBCSendResponse } from "./types/cosmwasm/wasm/v1/ibc" +import { StoreCodeProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { InstantiateContractProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { InstantiateContract2Proposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { MigrateContractProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { SudoContractProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { ExecuteContractProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { UpdateAdminProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { ClearAdminProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { PinCodesProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { UnpinCodesProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { AccessConfigUpdate } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { UpdateInstantiateConfigProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { StoreAndInstantiateContractProposal } from "./types/cosmwasm/wasm/v1/proposal_legacy" +import { CodeInfoResponse } from "./types/cosmwasm/wasm/v1/query" +import { AccessTypeParam } from "./types/cosmwasm/wasm/v1/types" +import { AccessConfig } from "./types/cosmwasm/wasm/v1/types" +import { Params } from "./types/cosmwasm/wasm/v1/types" +import { CodeInfo } from "./types/cosmwasm/wasm/v1/types" +import { ContractInfo } from "./types/cosmwasm/wasm/v1/types" +import { ContractCodeHistoryEntry } from "./types/cosmwasm/wasm/v1/types" +import { AbsoluteTxPosition } from "./types/cosmwasm/wasm/v1/types" +import { Model } from "./types/cosmwasm/wasm/v1/types" + + +export { + StoreCodeAuthorization, + ContractExecutionAuthorization, + ContractMigrationAuthorization, + CodeGrant, + ContractGrant, + MaxCallsLimit, + MaxFundsLimit, + CombinedLimit, + AllowAllMessagesFilter, + AcceptedMessageKeysFilter, + AcceptedMessagesFilter, + Code, + Contract, + Sequence, + MsgIBCSendResponse, + StoreCodeProposal, + InstantiateContractProposal, + InstantiateContract2Proposal, + MigrateContractProposal, + SudoContractProposal, + ExecuteContractProposal, + UpdateAdminProposal, + ClearAdminProposal, + PinCodesProposal, + UnpinCodesProposal, + AccessConfigUpdate, + UpdateInstantiateConfigProposal, + StoreAndInstantiateContractProposal, + CodeInfoResponse, + AccessTypeParam, + AccessConfig, + Params, + CodeInfo, + ContractInfo, + ContractCodeHistoryEntry, + AbsoluteTxPosition, + Model, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/query/v1beta1/pagination.ts index 34ef35951f..fb308b28f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/query/v1beta1/pagination.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -38,7 +38,13 @@ export interface PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - count_total: boolean; + countTotal: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; } /** @@ -53,9 +59,10 @@ export interface PageRequest { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + nextKey: Uint8Array; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise @@ -63,10 +70,12 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, countTotal: false, reverse: false }; +} export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -76,16 +85,19 @@ export const PageRequest = { if (message.limit !== 0) { writer.uint32(24).uint64(message.limit); } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageRequest } as PageRequest; + const message = createBasePageRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -99,7 +111,10 @@ export const PageRequest = { message.limit = longToNumber(reader.uint64() as Long); break; case 4: - message.count_total = reader.bool(); + message.countTotal = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); break; default: reader.skipType(tag & 7); @@ -110,73 +125,45 @@ export const PageRequest = { }, fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); + message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } + fromPartial, I>>(object: I): PageRequest { + const message = createBasePageRequest(); + message.key = object.key ?? new Uint8Array(); + message.offset = object.offset ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; return message; }, }; -const basePageResponse: object = { total: 0 }; +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); + 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 !== 0) { writer.uint32(16).uint64(message.total); @@ -184,15 +171,15 @@ export const PageResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...basePageResponse } as PageResponse; + const message = createBasePageResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.next_key = reader.bytes(); + message.nextKey = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -206,88 +193,83 @@ export const PageResponse = { }, fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? Number(object.total) : 0, + }; }, toJSON(message: PageResponse): unknown { const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); + message.nextKey !== undefined + && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = Math.round(message.total)); return obj; }, - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -295,7 +277,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/authz.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/authz.ts index 52f81025d4..aae2f6edb4 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/authz.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/authz.ts @@ -1,12 +1,22 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { Any } from "../../../google/protobuf/any"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Any } from "../../../google/protobuf/any"; +import { AccessConfig } from "./types"; export const protobufPackage = "cosmwasm.wasm.v1"; +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorization { + /** Grants for code upload */ + grants: CodeGrant[]; +} + /** * ContractExecutionAuthorization defines authorization for wasm execute. * Since: wasmd 0.30 @@ -25,6 +35,21 @@ export interface ContractMigrationAuthorization { grants: ContractGrant[]; } +/** CodeGrant a granted permission for a single code */ +export interface CodeGrant { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + codeHash: Uint8Array; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiatePermission: AccessConfig | undefined; +} + /** * ContractGrant a granted permission for a single contract * Since: wasmd 0.30 @@ -36,7 +61,9 @@ export interface ContractGrant { * Limit defines execution limits that are enforced and updated when the grant * is applied. When the limit lapsed the grant is removed. */ - limit: Any | undefined; + limit: + | Any + | undefined; /** * Filter define more fine-grained control on the message payload passed * to the contract in the operation. When no filter applies on execution, the @@ -70,7 +97,7 @@ export interface MaxFundsLimit { */ export interface CombinedLimit { /** Remaining number that is decremented on each execution */ - calls_remaining: number; + callsRemaining: number; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: Coin[]; } @@ -80,7 +107,8 @@ export interface CombinedLimit { * message. * Since: wasmd 0.30 */ -export interface AllowAllMessagesFilter {} +export interface AllowAllMessagesFilter { +} /** * AcceptedMessageKeysFilter accept only the specific contract message keys in @@ -102,29 +130,73 @@ export interface AcceptedMessagesFilter { messages: Uint8Array[]; } -const baseContractExecutionAuthorization: object = {}; +function createBaseStoreCodeAuthorization(): StoreCodeAuthorization { + return { grants: [] }; +} + +export const StoreCodeAuthorization = { + encode(message: StoreCodeAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.grants) { + CodeGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StoreCodeAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(CodeGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StoreCodeAuthorization { + return { grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => CodeGrant.fromJSON(e)) : [] }; + }, + + toJSON(message: StoreCodeAuthorization): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map((e) => e ? CodeGrant.toJSON(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, + + fromPartial, I>>(object: I): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map((e) => CodeGrant.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseContractExecutionAuthorization(): ContractExecutionAuthorization { + return { grants: [] }; +} export const ContractExecutionAuthorization = { - encode( - message: ContractExecutionAuthorization, - writer: Writer = Writer.create() - ): Writer { + encode(message: ContractExecutionAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ContractExecutionAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContractExecutionAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseContractExecutionAuthorization, - } as ContractExecutionAuthorization; - message.grants = []; + const message = createBaseContractExecutionAuthorization(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -140,69 +212,44 @@ export const ContractExecutionAuthorization = { }, fromJSON(object: any): ContractExecutionAuthorization { - const message = { - ...baseContractExecutionAuthorization, - } as ContractExecutionAuthorization; - message.grants = []; - if (object.grants !== undefined && object.grants !== null) { - for (const e of object.grants) { - message.grants.push(ContractGrant.fromJSON(e)); - } - } - return message; + return { grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromJSON(e)) : [] }; }, toJSON(message: ContractExecutionAuthorization): unknown { const obj: any = {}; if (message.grants) { - obj.grants = message.grants.map((e) => - e ? ContractGrant.toJSON(e) : undefined - ); + obj.grants = message.grants.map((e) => e ? ContractGrant.toJSON(e) : undefined); } else { obj.grants = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ContractExecutionAuthorization { - const message = { - ...baseContractExecutionAuthorization, - } as ContractExecutionAuthorization; - message.grants = []; - if (object.grants !== undefined && object.grants !== null) { - for (const e of object.grants) { - message.grants.push(ContractGrant.fromPartial(e)); - } - } + const message = createBaseContractExecutionAuthorization(); + message.grants = object.grants?.map((e) => ContractGrant.fromPartial(e)) || []; return message; }, }; -const baseContractMigrationAuthorization: object = {}; +function createBaseContractMigrationAuthorization(): ContractMigrationAuthorization { + return { grants: [] }; +} export const ContractMigrationAuthorization = { - encode( - message: ContractMigrationAuthorization, - writer: Writer = Writer.create() - ): Writer { + encode(message: ContractMigrationAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ContractMigrationAuthorization { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContractMigrationAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseContractMigrationAuthorization, - } as ContractMigrationAuthorization; - message.grants = []; + const message = createBaseContractMigrationAuthorization(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -218,50 +265,100 @@ export const ContractMigrationAuthorization = { }, fromJSON(object: any): ContractMigrationAuthorization { - const message = { - ...baseContractMigrationAuthorization, - } as ContractMigrationAuthorization; - message.grants = []; - if (object.grants !== undefined && object.grants !== null) { - for (const e of object.grants) { - message.grants.push(ContractGrant.fromJSON(e)); - } - } - return message; + return { grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromJSON(e)) : [] }; }, toJSON(message: ContractMigrationAuthorization): unknown { const obj: any = {}; if (message.grants) { - obj.grants = message.grants.map((e) => - e ? ContractGrant.toJSON(e) : undefined - ); + obj.grants = message.grants.map((e) => e ? ContractGrant.toJSON(e) : undefined); } else { obj.grants = []; } return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): ContractMigrationAuthorization { - const message = { - ...baseContractMigrationAuthorization, - } as ContractMigrationAuthorization; - message.grants = []; - if (object.grants !== undefined && object.grants !== null) { - for (const e of object.grants) { - message.grants.push(ContractGrant.fromPartial(e)); + const message = createBaseContractMigrationAuthorization(); + message.grants = object.grants?.map((e) => ContractGrant.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCodeGrant(): CodeGrant { + return { codeHash: new Uint8Array(), instantiatePermission: undefined }; +} + +export const CodeGrant = { + encode(message: CodeGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CodeGrant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, + + fromJSON(object: any): CodeGrant { + return { + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + }; + }, + + toJSON(message: CodeGrant): unknown { + const obj: any = {}; + message.codeHash !== undefined + && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): CodeGrant { + const message = createBaseCodeGrant(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + return message; + }, }; -const baseContractGrant: object = { contract: "" }; +function createBaseContractGrant(): ContractGrant { + return { contract: "", limit: undefined, filter: undefined }; +} export const ContractGrant = { - encode(message: ContractGrant, writer: Writer = Writer.create()): Writer { + encode(message: ContractGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.contract !== "") { writer.uint32(10).string(message.contract); } @@ -274,10 +371,10 @@ export const ContractGrant = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ContractGrant { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContractGrant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContractGrant } as ContractGrant; + const message = createBaseContractGrant(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -299,70 +396,48 @@ export const ContractGrant = { }, fromJSON(object: any): ContractGrant { - const message = { ...baseContractGrant } as ContractGrant; - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Any.fromJSON(object.limit); - } else { - message.limit = undefined; - } - if (object.filter !== undefined && object.filter !== null) { - message.filter = Any.fromJSON(object.filter); - } else { - message.filter = undefined; - } - return message; + return { + contract: isSet(object.contract) ? String(object.contract) : "", + limit: isSet(object.limit) ? Any.fromJSON(object.limit) : undefined, + filter: isSet(object.filter) ? Any.fromJSON(object.filter) : undefined, + }; }, toJSON(message: ContractGrant): unknown { const obj: any = {}; message.contract !== undefined && (obj.contract = message.contract); - message.limit !== undefined && - (obj.limit = message.limit ? Any.toJSON(message.limit) : undefined); - message.filter !== undefined && - (obj.filter = message.filter ? Any.toJSON(message.filter) : undefined); + message.limit !== undefined && (obj.limit = message.limit ? Any.toJSON(message.limit) : undefined); + message.filter !== undefined && (obj.filter = message.filter ? Any.toJSON(message.filter) : undefined); return obj; }, - fromPartial(object: DeepPartial): ContractGrant { - const message = { ...baseContractGrant } as ContractGrant; - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Any.fromPartial(object.limit); - } else { - message.limit = undefined; - } - if (object.filter !== undefined && object.filter !== null) { - message.filter = Any.fromPartial(object.filter); - } else { - message.filter = undefined; - } + fromPartial, I>>(object: I): ContractGrant { + const message = createBaseContractGrant(); + message.contract = object.contract ?? ""; + message.limit = (object.limit !== undefined && object.limit !== null) ? Any.fromPartial(object.limit) : undefined; + message.filter = (object.filter !== undefined && object.filter !== null) + ? Any.fromPartial(object.filter) + : undefined; return message; }, }; -const baseMaxCallsLimit: object = { remaining: 0 }; +function createBaseMaxCallsLimit(): MaxCallsLimit { + return { remaining: 0 }; +} export const MaxCallsLimit = { - encode(message: MaxCallsLimit, writer: Writer = Writer.create()): Writer { + encode(message: MaxCallsLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.remaining !== 0) { writer.uint32(8).uint64(message.remaining); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MaxCallsLimit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MaxCallsLimit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMaxCallsLimit } as MaxCallsLimit; + const message = createBaseMaxCallsLimit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -378,47 +453,38 @@ export const MaxCallsLimit = { }, fromJSON(object: any): MaxCallsLimit { - const message = { ...baseMaxCallsLimit } as MaxCallsLimit; - if (object.remaining !== undefined && object.remaining !== null) { - message.remaining = Number(object.remaining); - } else { - message.remaining = 0; - } - return message; + return { remaining: isSet(object.remaining) ? Number(object.remaining) : 0 }; }, toJSON(message: MaxCallsLimit): unknown { const obj: any = {}; - message.remaining !== undefined && (obj.remaining = message.remaining); + message.remaining !== undefined && (obj.remaining = Math.round(message.remaining)); return obj; }, - fromPartial(object: DeepPartial): MaxCallsLimit { - const message = { ...baseMaxCallsLimit } as MaxCallsLimit; - if (object.remaining !== undefined && object.remaining !== null) { - message.remaining = object.remaining; - } else { - message.remaining = 0; - } + fromPartial, I>>(object: I): MaxCallsLimit { + const message = createBaseMaxCallsLimit(); + message.remaining = object.remaining ?? 0; return message; }, }; -const baseMaxFundsLimit: object = {}; +function createBaseMaxFundsLimit(): MaxFundsLimit { + return { amounts: [] }; +} export const MaxFundsLimit = { - encode(message: MaxFundsLimit, writer: Writer = Writer.create()): Writer { + encode(message: MaxFundsLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.amounts) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MaxFundsLimit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MaxFundsLimit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMaxFundsLimit } as MaxFundsLimit; - message.amounts = []; + const message = createBaseMaxFundsLimit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -434,46 +500,34 @@ export const MaxFundsLimit = { }, fromJSON(object: any): MaxFundsLimit { - const message = { ...baseMaxFundsLimit } as MaxFundsLimit; - message.amounts = []; - if (object.amounts !== undefined && object.amounts !== null) { - for (const e of object.amounts) { - message.amounts.push(Coin.fromJSON(e)); - } - } - return message; + return { amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: MaxFundsLimit): unknown { const obj: any = {}; if (message.amounts) { - obj.amounts = message.amounts.map((e) => - e ? Coin.toJSON(e) : undefined - ); + obj.amounts = message.amounts.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amounts = []; } return obj; }, - fromPartial(object: DeepPartial): MaxFundsLimit { - const message = { ...baseMaxFundsLimit } as MaxFundsLimit; - message.amounts = []; - if (object.amounts !== undefined && object.amounts !== null) { - for (const e of object.amounts) { - message.amounts.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): MaxFundsLimit { + const message = createBaseMaxFundsLimit(); + message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseCombinedLimit: object = { calls_remaining: 0 }; +function createBaseCombinedLimit(): CombinedLimit { + return { callsRemaining: 0, amounts: [] }; +} export const CombinedLimit = { - encode(message: CombinedLimit, writer: Writer = Writer.create()): Writer { - if (message.calls_remaining !== 0) { - writer.uint32(8).uint64(message.calls_remaining); + encode(message: CombinedLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.callsRemaining !== 0) { + writer.uint32(8).uint64(message.callsRemaining); } for (const v of message.amounts) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -481,16 +535,15 @@ export const CombinedLimit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CombinedLimit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CombinedLimit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCombinedLimit } as CombinedLimit; - message.amounts = []; + const message = createBaseCombinedLimit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.calls_remaining = longToNumber(reader.uint64() as Long); + message.callsRemaining = longToNumber(reader.uint64() as Long); break; case 2: message.amounts.push(Coin.decode(reader, reader.uint32())); @@ -504,69 +557,44 @@ export const CombinedLimit = { }, fromJSON(object: any): CombinedLimit { - const message = { ...baseCombinedLimit } as CombinedLimit; - message.amounts = []; - if ( - object.calls_remaining !== undefined && - object.calls_remaining !== null - ) { - message.calls_remaining = Number(object.calls_remaining); - } else { - message.calls_remaining = 0; - } - if (object.amounts !== undefined && object.amounts !== null) { - for (const e of object.amounts) { - message.amounts.push(Coin.fromJSON(e)); - } - } - return message; + return { + callsRemaining: isSet(object.callsRemaining) ? Number(object.callsRemaining) : 0, + amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: CombinedLimit): unknown { const obj: any = {}; - message.calls_remaining !== undefined && - (obj.calls_remaining = message.calls_remaining); + message.callsRemaining !== undefined && (obj.callsRemaining = Math.round(message.callsRemaining)); if (message.amounts) { - obj.amounts = message.amounts.map((e) => - e ? Coin.toJSON(e) : undefined - ); + obj.amounts = message.amounts.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.amounts = []; } return obj; }, - fromPartial(object: DeepPartial): CombinedLimit { - const message = { ...baseCombinedLimit } as CombinedLimit; - message.amounts = []; - if ( - object.calls_remaining !== undefined && - object.calls_remaining !== null - ) { - message.calls_remaining = object.calls_remaining; - } else { - message.calls_remaining = 0; - } - if (object.amounts !== undefined && object.amounts !== null) { - for (const e of object.amounts) { - message.amounts.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): CombinedLimit { + const message = createBaseCombinedLimit(); + message.callsRemaining = object.callsRemaining ?? 0; + message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseAllowAllMessagesFilter: object = {}; +function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { + return {}; +} export const AllowAllMessagesFilter = { - encode(_: AllowAllMessagesFilter, writer: Writer = Writer.create()): Writer { + encode(_: AllowAllMessagesFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): AllowAllMessagesFilter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AllowAllMessagesFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAllowAllMessagesFilter } as AllowAllMessagesFilter; + const message = createBaseAllowAllMessagesFilter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -579,8 +607,7 @@ export const AllowAllMessagesFilter = { }, fromJSON(_: any): AllowAllMessagesFilter { - const message = { ...baseAllowAllMessagesFilter } as AllowAllMessagesFilter; - return message; + return {}; }, toJSON(_: AllowAllMessagesFilter): unknown { @@ -588,35 +615,28 @@ export const AllowAllMessagesFilter = { return obj; }, - fromPartial(_: DeepPartial): AllowAllMessagesFilter { - const message = { ...baseAllowAllMessagesFilter } as AllowAllMessagesFilter; + fromPartial, I>>(_: I): AllowAllMessagesFilter { + const message = createBaseAllowAllMessagesFilter(); return message; }, }; -const baseAcceptedMessageKeysFilter: object = { keys: "" }; +function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { + return { keys: [] }; +} export const AcceptedMessageKeysFilter = { - encode( - message: AcceptedMessageKeysFilter, - writer: Writer = Writer.create() - ): Writer { + encode(message: AcceptedMessageKeysFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.keys) { writer.uint32(10).string(v!); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): AcceptedMessageKeysFilter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AcceptedMessageKeysFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseAcceptedMessageKeysFilter, - } as AcceptedMessageKeysFilter; - message.keys = []; + const message = createBaseAcceptedMessageKeysFilter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -632,16 +652,7 @@ export const AcceptedMessageKeysFilter = { }, fromJSON(object: any): AcceptedMessageKeysFilter { - const message = { - ...baseAcceptedMessageKeysFilter, - } as AcceptedMessageKeysFilter; - message.keys = []; - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(String(e)); - } - } - return message; + return { keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] }; }, toJSON(message: AcceptedMessageKeysFilter): unknown { @@ -654,40 +665,29 @@ export const AcceptedMessageKeysFilter = { return obj; }, - fromPartial( - object: DeepPartial - ): AcceptedMessageKeysFilter { - const message = { - ...baseAcceptedMessageKeysFilter, - } as AcceptedMessageKeysFilter; - message.keys = []; - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(e); - } - } + fromPartial, I>>(object: I): AcceptedMessageKeysFilter { + const message = createBaseAcceptedMessageKeysFilter(); + message.keys = object.keys?.map((e) => e) || []; return message; }, }; -const baseAcceptedMessagesFilter: object = {}; +function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { + return { messages: [] }; +} export const AcceptedMessagesFilter = { - encode( - message: AcceptedMessagesFilter, - writer: Writer = Writer.create() - ): Writer { + encode(message: AcceptedMessagesFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.messages) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AcceptedMessagesFilter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AcceptedMessagesFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAcceptedMessagesFilter } as AcceptedMessagesFilter; - message.messages = []; + const message = createBaseAcceptedMessagesFilter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -703,86 +703,81 @@ export const AcceptedMessagesFilter = { }, fromJSON(object: any): AcceptedMessagesFilter { - const message = { ...baseAcceptedMessagesFilter } as AcceptedMessagesFilter; - message.messages = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(bytesFromBase64(e)); - } - } - return message; + return { messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => bytesFromBase64(e)) : [] }; }, toJSON(message: AcceptedMessagesFilter): unknown { const obj: any = {}; if (message.messages) { - obj.messages = message.messages.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); + obj.messages = message.messages.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.messages = []; } return obj; }, - fromPartial( - object: DeepPartial - ): AcceptedMessagesFilter { - const message = { ...baseAcceptedMessagesFilter } as AcceptedMessagesFilter; - message.messages = []; - if (object.messages !== undefined && object.messages !== null) { - for (const e of object.messages) { - message.messages.push(e); - } - } + fromPartial, I>>(object: I): AcceptedMessagesFilter { + const message = createBaseAcceptedMessagesFilter(); + message.messages = object.messages?.map((e) => e) || []; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -790,7 +785,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/genesis.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/genesis.ts index ada3d37533..386de19548 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/genesis.ts @@ -1,19 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { - Params, - CodeInfo, - ContractInfo, - Model, - ContractCodeHistoryEntry, -} from "../../../cosmwasm/wasm/v1/types"; -import { - MsgStoreCode, - MsgInstantiateContract, - MsgExecuteContract, -} from "../../../cosmwasm/wasm/v1/tx"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { CodeInfo, ContractCodeHistoryEntry, ContractInfo, Model, Params } from "./types"; export const protobufPackage = "cosmwasm.wasm.v1"; @@ -23,50 +12,37 @@ export interface GenesisState { codes: Code[]; contracts: Contract[]; sequences: Sequence[]; - gen_msgs: GenesisState_GenMsgs[]; -} - -/** - * GenMsgs define the messages that can be executed during genesis phase in - * order. The intention is to have more human readable data that is auditable. - */ -export interface GenesisState_GenMsgs { - store_code: MsgStoreCode | undefined; - instantiate_contract: MsgInstantiateContract | undefined; - /** - * MsgInstantiateContract2 intentionally not supported - * see https://github.com/CosmWasm/wasmd/issues/987 - */ - execute_contract: MsgExecuteContract | undefined; } /** Code struct encompasses CodeInfo and CodeBytes */ export interface Code { - code_id: number; - code_info: CodeInfo | undefined; - code_bytes: Uint8Array; + codeId: number; + codeInfo: CodeInfo | undefined; + codeBytes: Uint8Array; /** Pinned to wasmvm cache */ pinned: boolean; } /** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ export interface Contract { - contract_address: string; - contract_info: ContractInfo | undefined; - contract_state: Model[]; - contract_code_history: ContractCodeHistoryEntry[]; + contractAddress: string; + contractInfo: ContractInfo | undefined; + contractState: Model[]; + contractCodeHistory: ContractCodeHistoryEntry[]; } /** Sequence key and value of an id generation counter */ export interface Sequence { - id_key: Uint8Array; + idKey: Uint8Array; value: number; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { params: undefined, codes: [], contracts: [], sequences: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -79,20 +55,13 @@ export const GenesisState = { for (const v of message.sequences) { Sequence.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.gen_msgs) { - GenesisState_GenMsgs.encode(v!, writer.uint32(42).fork()).ldelim(); - } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.codes = []; - message.contracts = []; - message.sequences = []; - message.gen_msgs = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -108,11 +77,6 @@ export const GenesisState = { case 4: message.sequences.push(Sequence.decode(reader, reader.uint32())); break; - case 5: - message.gen_msgs.push( - GenesisState_GenMsgs.decode(reader, reader.uint32()) - ); - break; default: reader.skipType(tag & 7); break; @@ -122,255 +86,61 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.codes = []; - message.contracts = []; - message.sequences = []; - message.gen_msgs = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.codes !== undefined && object.codes !== null) { - for (const e of object.codes) { - message.codes.push(Code.fromJSON(e)); - } - } - if (object.contracts !== undefined && object.contracts !== null) { - for (const e of object.contracts) { - message.contracts.push(Contract.fromJSON(e)); - } - } - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(Sequence.fromJSON(e)); - } - } - if (object.gen_msgs !== undefined && object.gen_msgs !== null) { - for (const e of object.gen_msgs) { - message.gen_msgs.push(GenesisState_GenMsgs.fromJSON(e)); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + codes: Array.isArray(object?.codes) ? object.codes.map((e: any) => Code.fromJSON(e)) : [], + contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => Contract.fromJSON(e)) : [], + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Sequence.fromJSON(e)) : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); if (message.codes) { - obj.codes = message.codes.map((e) => (e ? Code.toJSON(e) : undefined)); + obj.codes = message.codes.map((e) => e ? Code.toJSON(e) : undefined); } else { obj.codes = []; } if (message.contracts) { - obj.contracts = message.contracts.map((e) => - e ? Contract.toJSON(e) : undefined - ); + obj.contracts = message.contracts.map((e) => e ? Contract.toJSON(e) : undefined); } else { obj.contracts = []; } if (message.sequences) { - obj.sequences = message.sequences.map((e) => - e ? Sequence.toJSON(e) : undefined - ); + obj.sequences = message.sequences.map((e) => e ? Sequence.toJSON(e) : undefined); } else { obj.sequences = []; } - if (message.gen_msgs) { - obj.gen_msgs = message.gen_msgs.map((e) => - e ? GenesisState_GenMsgs.toJSON(e) : undefined - ); - } else { - obj.gen_msgs = []; - } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.codes = []; - message.contracts = []; - message.sequences = []; - message.gen_msgs = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.codes !== undefined && object.codes !== null) { - for (const e of object.codes) { - message.codes.push(Code.fromPartial(e)); - } - } - if (object.contracts !== undefined && object.contracts !== null) { - for (const e of object.contracts) { - message.contracts.push(Contract.fromPartial(e)); - } - } - if (object.sequences !== undefined && object.sequences !== null) { - for (const e of object.sequences) { - message.sequences.push(Sequence.fromPartial(e)); - } - } - if (object.gen_msgs !== undefined && object.gen_msgs !== null) { - for (const e of object.gen_msgs) { - message.gen_msgs.push(GenesisState_GenMsgs.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.codes = object.codes?.map((e) => Code.fromPartial(e)) || []; + message.contracts = object.contracts?.map((e) => Contract.fromPartial(e)) || []; + message.sequences = object.sequences?.map((e) => Sequence.fromPartial(e)) || []; return message; }, }; -const baseGenesisState_GenMsgs: object = {}; - -export const GenesisState_GenMsgs = { - encode( - message: GenesisState_GenMsgs, - writer: Writer = Writer.create() - ): Writer { - if (message.store_code !== undefined) { - MsgStoreCode.encode( - message.store_code, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.instantiate_contract !== undefined) { - MsgInstantiateContract.encode( - message.instantiate_contract, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.execute_contract !== undefined) { - MsgExecuteContract.encode( - message.execute_contract, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState_GenMsgs { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.store_code = MsgStoreCode.decode(reader, reader.uint32()); - break; - case 2: - message.instantiate_contract = MsgInstantiateContract.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.execute_contract = MsgExecuteContract.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState_GenMsgs { - const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; - if (object.store_code !== undefined && object.store_code !== null) { - message.store_code = MsgStoreCode.fromJSON(object.store_code); - } else { - message.store_code = undefined; - } - if ( - object.instantiate_contract !== undefined && - object.instantiate_contract !== null - ) { - message.instantiate_contract = MsgInstantiateContract.fromJSON( - object.instantiate_contract - ); - } else { - message.instantiate_contract = undefined; - } - if ( - object.execute_contract !== undefined && - object.execute_contract !== null - ) { - message.execute_contract = MsgExecuteContract.fromJSON( - object.execute_contract - ); - } else { - message.execute_contract = undefined; - } - return message; - }, - - toJSON(message: GenesisState_GenMsgs): unknown { - const obj: any = {}; - message.store_code !== undefined && - (obj.store_code = message.store_code - ? MsgStoreCode.toJSON(message.store_code) - : undefined); - message.instantiate_contract !== undefined && - (obj.instantiate_contract = message.instantiate_contract - ? MsgInstantiateContract.toJSON(message.instantiate_contract) - : undefined); - message.execute_contract !== undefined && - (obj.execute_contract = message.execute_contract - ? MsgExecuteContract.toJSON(message.execute_contract) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState_GenMsgs { - const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; - if (object.store_code !== undefined && object.store_code !== null) { - message.store_code = MsgStoreCode.fromPartial(object.store_code); - } else { - message.store_code = undefined; - } - if ( - object.instantiate_contract !== undefined && - object.instantiate_contract !== null - ) { - message.instantiate_contract = MsgInstantiateContract.fromPartial( - object.instantiate_contract - ); - } else { - message.instantiate_contract = undefined; - } - if ( - object.execute_contract !== undefined && - object.execute_contract !== null - ) { - message.execute_contract = MsgExecuteContract.fromPartial( - object.execute_contract - ); - } else { - message.execute_contract = undefined; - } - return message; - }, -}; - -const baseCode: object = { code_id: 0, pinned: false }; +function createBaseCode(): Code { + return { codeId: 0, codeInfo: undefined, codeBytes: new Uint8Array(), pinned: false }; +} export const Code = { - encode(message: Code, writer: Writer = Writer.create()): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: Code, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } - if (message.code_info !== undefined) { - CodeInfo.encode(message.code_info, writer.uint32(18).fork()).ldelim(); + if (message.codeInfo !== undefined) { + CodeInfo.encode(message.codeInfo, writer.uint32(18).fork()).ldelim(); } - if (message.code_bytes.length !== 0) { - writer.uint32(26).bytes(message.code_bytes); + if (message.codeBytes.length !== 0) { + writer.uint32(26).bytes(message.codeBytes); } if (message.pinned === true) { writer.uint32(32).bool(message.pinned); @@ -378,21 +148,21 @@ export const Code = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Code { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Code { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCode } as Code; + const message = createBaseCode(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 2: - message.code_info = CodeInfo.decode(reader, reader.uint32()); + message.codeInfo = CodeInfo.decode(reader, reader.uint32()); break; case 3: - message.code_bytes = reader.bytes(); + message.codeBytes = reader.bytes(); break; case 4: message.pinned = reader.bool(); @@ -406,113 +176,75 @@ export const Code = { }, fromJSON(object: any): Code { - const message = { ...baseCode } as Code; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.code_info !== undefined && object.code_info !== null) { - message.code_info = CodeInfo.fromJSON(object.code_info); - } else { - message.code_info = undefined; - } - if (object.code_bytes !== undefined && object.code_bytes !== null) { - message.code_bytes = bytesFromBase64(object.code_bytes); - } - if (object.pinned !== undefined && object.pinned !== null) { - message.pinned = Boolean(object.pinned); - } else { - message.pinned = false; - } - return message; + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + codeInfo: isSet(object.codeInfo) ? CodeInfo.fromJSON(object.codeInfo) : undefined, + codeBytes: isSet(object.codeBytes) ? bytesFromBase64(object.codeBytes) : new Uint8Array(), + pinned: isSet(object.pinned) ? Boolean(object.pinned) : false, + }; }, toJSON(message: Code): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); - message.code_info !== undefined && - (obj.code_info = message.code_info - ? CodeInfo.toJSON(message.code_info) - : undefined); - message.code_bytes !== undefined && - (obj.code_bytes = base64FromBytes( - message.code_bytes !== undefined ? message.code_bytes : new Uint8Array() - )); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.codeInfo !== undefined && (obj.codeInfo = message.codeInfo ? CodeInfo.toJSON(message.codeInfo) : undefined); + message.codeBytes !== undefined + && (obj.codeBytes = base64FromBytes(message.codeBytes !== undefined ? message.codeBytes : new Uint8Array())); message.pinned !== undefined && (obj.pinned = message.pinned); return obj; }, - fromPartial(object: DeepPartial): Code { - const message = { ...baseCode } as Code; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.code_info !== undefined && object.code_info !== null) { - message.code_info = CodeInfo.fromPartial(object.code_info); - } else { - message.code_info = undefined; - } - if (object.code_bytes !== undefined && object.code_bytes !== null) { - message.code_bytes = object.code_bytes; - } else { - message.code_bytes = new Uint8Array(); - } - if (object.pinned !== undefined && object.pinned !== null) { - message.pinned = object.pinned; - } else { - message.pinned = false; - } + fromPartial, I>>(object: I): Code { + const message = createBaseCode(); + message.codeId = object.codeId ?? 0; + message.codeInfo = (object.codeInfo !== undefined && object.codeInfo !== null) + ? CodeInfo.fromPartial(object.codeInfo) + : undefined; + message.codeBytes = object.codeBytes ?? new Uint8Array(); + message.pinned = object.pinned ?? false; return message; }, }; -const baseContract: object = { contract_address: "" }; +function createBaseContract(): Contract { + return { contractAddress: "", contractInfo: undefined, contractState: [], contractCodeHistory: [] }; +} export const Contract = { - encode(message: Contract, writer: Writer = Writer.create()): Writer { - if (message.contract_address !== "") { - writer.uint32(10).string(message.contract_address); + encode(message: Contract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); } - if (message.contract_info !== undefined) { - ContractInfo.encode( - message.contract_info, - writer.uint32(18).fork() - ).ldelim(); + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); } - for (const v of message.contract_state) { + for (const v of message.contractState) { Model.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.contract_code_history) { + for (const v of message.contractCodeHistory) { ContractCodeHistoryEntry.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Contract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Contract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContract } as Contract; - message.contract_state = []; - message.contract_code_history = []; + const message = createBaseContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.contract_address = reader.string(); + message.contractAddress = reader.string(); break; case 2: - message.contract_info = ContractInfo.decode(reader, reader.uint32()); + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); break; case 3: - message.contract_state.push(Model.decode(reader, reader.uint32())); + message.contractState.push(Model.decode(reader, reader.uint32())); break; case 4: - message.contract_code_history.push( - ContractCodeHistoryEntry.decode(reader, reader.uint32()) - ); + message.contractCodeHistory.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -523,107 +255,58 @@ export const Contract = { }, fromJSON(object: any): Contract { - const message = { ...baseContract } as Contract; - message.contract_state = []; - message.contract_code_history = []; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = String(object.contract_address); - } else { - message.contract_address = ""; - } - if (object.contract_info !== undefined && object.contract_info !== null) { - message.contract_info = ContractInfo.fromJSON(object.contract_info); - } else { - message.contract_info = undefined; - } - if (object.contract_state !== undefined && object.contract_state !== null) { - for (const e of object.contract_state) { - message.contract_state.push(Model.fromJSON(e)); - } - } - if ( - object.contract_code_history !== undefined && - object.contract_code_history !== null - ) { - for (const e of object.contract_code_history) { - message.contract_code_history.push( - ContractCodeHistoryEntry.fromJSON(e) - ); - } - } - return message; + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + contractInfo: isSet(object.contractInfo) ? ContractInfo.fromJSON(object.contractInfo) : undefined, + contractState: Array.isArray(object?.contractState) + ? object.contractState.map((e: any) => Model.fromJSON(e)) + : [], + contractCodeHistory: Array.isArray(object?.contractCodeHistory) + ? object.contractCodeHistory.map((e: any) => ContractCodeHistoryEntry.fromJSON(e)) + : [], + }; }, toJSON(message: Contract): unknown { const obj: any = {}; - message.contract_address !== undefined && - (obj.contract_address = message.contract_address); - message.contract_info !== undefined && - (obj.contract_info = message.contract_info - ? ContractInfo.toJSON(message.contract_info) - : undefined); - if (message.contract_state) { - obj.contract_state = message.contract_state.map((e) => - e ? Model.toJSON(e) : undefined - ); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.contractInfo !== undefined + && (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); + if (message.contractState) { + obj.contractState = message.contractState.map((e) => e ? Model.toJSON(e) : undefined); } else { - obj.contract_state = []; + obj.contractState = []; } - if (message.contract_code_history) { - obj.contract_code_history = message.contract_code_history.map((e) => + if (message.contractCodeHistory) { + obj.contractCodeHistory = message.contractCodeHistory.map((e) => e ? ContractCodeHistoryEntry.toJSON(e) : undefined ); } else { - obj.contract_code_history = []; + obj.contractCodeHistory = []; } return obj; }, - fromPartial(object: DeepPartial): Contract { - const message = { ...baseContract } as Contract; - message.contract_state = []; - message.contract_code_history = []; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = object.contract_address; - } else { - message.contract_address = ""; - } - if (object.contract_info !== undefined && object.contract_info !== null) { - message.contract_info = ContractInfo.fromPartial(object.contract_info); - } else { - message.contract_info = undefined; - } - if (object.contract_state !== undefined && object.contract_state !== null) { - for (const e of object.contract_state) { - message.contract_state.push(Model.fromPartial(e)); - } - } - if ( - object.contract_code_history !== undefined && - object.contract_code_history !== null - ) { - for (const e of object.contract_code_history) { - message.contract_code_history.push( - ContractCodeHistoryEntry.fromPartial(e) - ); - } - } + fromPartial, I>>(object: I): Contract { + const message = createBaseContract(); + message.contractAddress = object.contractAddress ?? ""; + message.contractInfo = (object.contractInfo !== undefined && object.contractInfo !== null) + ? ContractInfo.fromPartial(object.contractInfo) + : undefined; + message.contractState = object.contractState?.map((e) => Model.fromPartial(e)) || []; + message.contractCodeHistory = object.contractCodeHistory?.map((e) => ContractCodeHistoryEntry.fromPartial(e)) || []; return message; }, }; -const baseSequence: object = { value: 0 }; +function createBaseSequence(): Sequence { + return { idKey: new Uint8Array(), value: 0 }; +} export const Sequence = { - encode(message: Sequence, writer: Writer = Writer.create()): Writer { - if (message.id_key.length !== 0) { - writer.uint32(10).bytes(message.id_key); + encode(message: Sequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.idKey.length !== 0) { + writer.uint32(10).bytes(message.idKey); } if (message.value !== 0) { writer.uint32(16).uint64(message.value); @@ -631,15 +314,15 @@ export const Sequence = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Sequence { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Sequence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSequence } as Sequence; + const message = createBaseSequence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id_key = reader.bytes(); + message.idKey = reader.bytes(); break; case 2: message.value = longToNumber(reader.uint64() as Long); @@ -653,88 +336,83 @@ export const Sequence = { }, fromJSON(object: any): Sequence { - const message = { ...baseSequence } as Sequence; - if (object.id_key !== undefined && object.id_key !== null) { - message.id_key = bytesFromBase64(object.id_key); - } - if (object.value !== undefined && object.value !== null) { - message.value = Number(object.value); - } else { - message.value = 0; - } - return message; + return { + idKey: isSet(object.idKey) ? bytesFromBase64(object.idKey) : new Uint8Array(), + value: isSet(object.value) ? Number(object.value) : 0, + }; }, toJSON(message: Sequence): unknown { const obj: any = {}; - message.id_key !== undefined && - (obj.id_key = base64FromBytes( - message.id_key !== undefined ? message.id_key : new Uint8Array() - )); - message.value !== undefined && (obj.value = message.value); + message.idKey !== undefined + && (obj.idKey = base64FromBytes(message.idKey !== undefined ? message.idKey : new Uint8Array())); + message.value !== undefined && (obj.value = Math.round(message.value)); return obj; }, - fromPartial(object: DeepPartial): Sequence { - const message = { ...baseSequence } as Sequence; - if (object.id_key !== undefined && object.id_key !== null) { - message.id_key = object.id_key; - } else { - message.id_key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = 0; - } + fromPartial, I>>(object: I): Sequence { + const message = createBaseSequence(); + message.idKey = object.idKey ?? new Uint8Array(); + message.value = object.value ?? 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -742,7 +420,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/ibc.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/ibc.ts index a7ef60c62e..4898424fc3 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/ibc.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/ibc.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmwasm.wasm.v1"; @@ -13,12 +13,12 @@ export interface MsgIBCSend { * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height: number; + timeoutHeight: number; /** * Timeout timestamp (in nanoseconds) relative to the current block timestamp. * The timeout is disabled when set to 0. */ - timeout_timestamp: number; + timeoutTimestamp: number; /** * Data is the payload to transfer. We must not make assumption what format or * content is in here. @@ -26,27 +26,31 @@ export interface MsgIBCSend { data: Uint8Array; } +/** MsgIBCSendResponse */ +export interface MsgIBCSendResponse { + /** Sequence number of the IBC packet sent */ + sequence: number; +} + /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannel { channel: string; } -const baseMsgIBCSend: object = { - channel: "", - timeout_height: 0, - timeout_timestamp: 0, -}; +function createBaseMsgIBCSend(): MsgIBCSend { + return { channel: "", timeoutHeight: 0, timeoutTimestamp: 0, data: new Uint8Array() }; +} export const MsgIBCSend = { - encode(message: MsgIBCSend, writer: Writer = Writer.create()): Writer { + encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.channel !== "") { writer.uint32(18).string(message.channel); } - if (message.timeout_height !== 0) { - writer.uint32(32).uint64(message.timeout_height); + if (message.timeoutHeight !== 0) { + writer.uint32(32).uint64(message.timeoutHeight); } - if (message.timeout_timestamp !== 0) { - writer.uint32(40).uint64(message.timeout_timestamp); + if (message.timeoutTimestamp !== 0) { + writer.uint32(40).uint64(message.timeoutTimestamp); } if (message.data.length !== 0) { writer.uint32(50).bytes(message.data); @@ -54,10 +58,10 @@ export const MsgIBCSend = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgIBCSend { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgIBCSend } as MsgIBCSend; + const message = createBaseMsgIBCSend(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -65,10 +69,10 @@ export const MsgIBCSend = { message.channel = reader.string(); break; case 4: - message.timeout_height = longToNumber(reader.uint64() as Long); + message.timeoutHeight = longToNumber(reader.uint64() as Long); break; case 5: - message.timeout_timestamp = longToNumber(reader.uint64() as Long); + message.timeoutTimestamp = longToNumber(reader.uint64() as Long); break; case 6: message.data = reader.bytes(); @@ -82,91 +86,97 @@ export const MsgIBCSend = { }, fromJSON(object: any): MsgIBCSend { - const message = { ...baseMsgIBCSend } as MsgIBCSend; - if (object.channel !== undefined && object.channel !== null) { - message.channel = String(object.channel); - } else { - message.channel = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = Number(object.timeout_height); - } else { - message.timeout_height = 0; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = Number(object.timeout_timestamp); - } else { - message.timeout_timestamp = 0; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + channel: isSet(object.channel) ? String(object.channel) : "", + timeoutHeight: isSet(object.timeoutHeight) ? Number(object.timeoutHeight) : 0, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? Number(object.timeoutTimestamp) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: MsgIBCSend): unknown { const obj: any = {}; message.channel !== undefined && (obj.channel = message.channel); - message.timeout_height !== undefined && - (obj.timeout_height = message.timeout_height); - message.timeout_timestamp !== undefined && - (obj.timeout_timestamp = message.timeout_timestamp); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.timeoutHeight !== undefined && (obj.timeoutHeight = Math.round(message.timeoutHeight)); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = Math.round(message.timeoutTimestamp)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): MsgIBCSend { - const message = { ...baseMsgIBCSend } as MsgIBCSend; - if (object.channel !== undefined && object.channel !== null) { - message.channel = object.channel; - } else { - message.channel = ""; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeout_height = object.timeout_height; - } else { - message.timeout_height = 0; - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeout_timestamp = object.timeout_timestamp; - } else { - message.timeout_timestamp = 0; + fromPartial, I>>(object: I): MsgIBCSend { + const message = createBaseMsgIBCSend(); + message.channel = object.channel ?? ""; + message.timeoutHeight = object.timeoutHeight ?? 0; + message.timeoutTimestamp = object.timeoutTimestamp ?? 0; + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgIBCSendResponse(): MsgIBCSendResponse { + return { sequence: 0 }; +} + +export const MsgIBCSendResponse = { + encode(message: MsgIBCSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sequence !== 0) { + writer.uint32(8).uint64(message.sequence); } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): MsgIBCSendResponse { + return { sequence: isSet(object.sequence) ? Number(object.sequence) : 0 }; + }, + + toJSON(message: MsgIBCSendResponse): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): MsgIBCSendResponse { + const message = createBaseMsgIBCSendResponse(); + message.sequence = object.sequence ?? 0; + return message; + }, }; -const baseMsgIBCCloseChannel: object = { channel: "" }; +function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { + return { channel: "" }; +} export const MsgIBCCloseChannel = { - encode( - message: MsgIBCCloseChannel, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.channel !== "") { writer.uint32(18).string(message.channel); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgIBCCloseChannel { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; + const message = createBaseMsgIBCCloseChannel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -182,13 +192,7 @@ export const MsgIBCCloseChannel = { }, fromJSON(object: any): MsgIBCCloseChannel { - const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; - if (object.channel !== undefined && object.channel !== null) { - message.channel = String(object.channel); - } else { - message.channel = ""; - } - return message; + return { channel: isSet(object.channel) ? String(object.channel) : "" }; }, toJSON(message: MsgIBCCloseChannel): unknown { @@ -197,61 +201,68 @@ export const MsgIBCCloseChannel = { return obj; }, - fromPartial(object: DeepPartial): MsgIBCCloseChannel { - const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; - if (object.channel !== undefined && object.channel !== null) { - message.channel = object.channel; - } else { - message.channel = ""; - } + fromPartial, I>>(object: I): MsgIBCCloseChannel { + const message = createBaseMsgIBCCloseChannel(); + message.channel = object.channel ?? ""; 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -259,7 +270,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal.ts deleted file mode 100644 index 9fd31c0e3e..0000000000 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal.ts +++ /dev/null @@ -1,2091 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; -import { AccessConfig } from "../../../cosmwasm/wasm/v1/types"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; - -export const protobufPackage = "cosmwasm.wasm.v1"; - -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ -export interface StoreCodeProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; - /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: Uint8Array; - /** InstantiatePermission to apply on contract creation, optional */ - instantiate_permission: AccessConfig | undefined; - /** UnpinCode code on upload, optional */ - unpin_code: boolean; - /** Source is the URL where the code is hosted */ - source: string; - /** - * Builder is the docker image used to build the code deterministically, used - * for smart contract verification - */ - builder: string; - /** - * CodeHash is the SHA256 sum of the code outputted by builder, used for smart - * contract verification - */ - code_hash: Uint8Array; -} - -/** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. - */ -export interface InstantiateContractProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** CodeID is the reference to the stored WASM code */ - code_id: number; - /** Label is optional metadata to be stored with a constract instance. */ - label: string; - /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; - /** Funds coins that are transferred to the contract on instantiation */ - funds: Coin[]; -} - -/** MigrateContractProposal gov proposal content type to migrate a contract. */ -export interface MigrateContractProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** Contract is the address of the smart contract */ - contract: string; - /** CodeID references the new WASM code */ - code_id: number; - /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; -} - -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ -export interface SudoContractProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** Contract is the address of the smart contract */ - contract: string; - /** Msg json encoded message to be passed to the contract as sudo */ - msg: Uint8Array; -} - -/** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. - */ -export interface ExecuteContractProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; - /** Contract is the address of the smart contract */ - contract: string; - /** Msg json encoded message to be passed to the contract as execute */ - msg: Uint8Array; - /** Funds coins that are transferred to the contract on instantiation */ - funds: Coin[]; -} - -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ -export interface UpdateAdminProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** NewAdmin address to be set */ - new_admin: string; - /** Contract is the address of the smart contract */ - contract: string; -} - -/** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. - */ -export interface ClearAdminProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** Contract is the address of the smart contract */ - contract: string; -} - -/** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. - */ -export interface PinCodesProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** CodeIDs references the new WASM codes */ - code_ids: number[]; -} - -/** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. - */ -export interface UnpinCodesProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** CodeIDs references the WASM codes */ - code_ids: number[]; -} - -/** - * AccessConfigUpdate contains the code id and the access config to be - * applied. - */ -export interface AccessConfigUpdate { - /** CodeID is the reference to the stored WASM code to be updated */ - code_id: number; - /** InstantiatePermission to apply to the set of code ids */ - instantiate_permission: AccessConfig | undefined; -} - -/** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. - */ -export interface UpdateInstantiateConfigProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** - * AccessConfigUpdate contains the list of code ids and the access config - * to be applied. - */ - access_config_updates: AccessConfigUpdate[]; -} - -/** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. - */ -export interface StoreAndInstantiateContractProposal { - /** Title is a short summary */ - title: string; - /** Description is a human readable text */ - description: string; - /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; - /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: Uint8Array; - /** InstantiatePermission to apply on contract creation, optional */ - instantiate_permission: AccessConfig | undefined; - /** UnpinCode code on upload, optional */ - unpin_code: boolean; - /** Admin is an optional address that can execute migrations */ - admin: string; - /** Label is optional metadata to be stored with a constract instance. */ - label: string; - /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; - /** Funds coins that are transferred to the contract on instantiation */ - funds: Coin[]; - /** Source is the URL where the code is hosted */ - source: string; - /** - * Builder is the docker image used to build the code deterministically, used - * for smart contract verification - */ - builder: string; - /** - * CodeHash is the SHA256 sum of the code outputted by builder, used for smart - * contract verification - */ - code_hash: Uint8Array; -} - -const baseStoreCodeProposal: object = { - title: "", - description: "", - run_as: "", - unpin_code: false, - source: "", - builder: "", -}; - -export const StoreCodeProposal = { - encode(message: StoreCodeProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.run_as !== "") { - writer.uint32(26).string(message.run_as); - } - if (message.wasm_byte_code.length !== 0) { - writer.uint32(34).bytes(message.wasm_byte_code); - } - if (message.instantiate_permission !== undefined) { - AccessConfig.encode( - message.instantiate_permission, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.unpin_code === true) { - writer.uint32(64).bool(message.unpin_code); - } - if (message.source !== "") { - writer.uint32(74).string(message.source); - } - if (message.builder !== "") { - writer.uint32(82).string(message.builder); - } - if (message.code_hash.length !== 0) { - writer.uint32(90).bytes(message.code_hash); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): StoreCodeProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStoreCodeProposal } as StoreCodeProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.run_as = reader.string(); - break; - case 4: - message.wasm_byte_code = reader.bytes(); - break; - case 7: - message.instantiate_permission = AccessConfig.decode( - reader, - reader.uint32() - ); - break; - case 8: - message.unpin_code = reader.bool(); - break; - case 9: - message.source = reader.string(); - break; - case 10: - message.builder = reader.string(); - break; - case 11: - message.code_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): StoreCodeProposal { - const message = { ...baseStoreCodeProposal } as StoreCodeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = String(object.run_as); - } else { - message.run_as = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = bytesFromBase64(object.wasm_byte_code); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromJSON( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - if (object.unpin_code !== undefined && object.unpin_code !== null) { - message.unpin_code = Boolean(object.unpin_code); - } else { - message.unpin_code = false; - } - if (object.source !== undefined && object.source !== null) { - message.source = String(object.source); - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = String(object.builder); - } else { - message.builder = ""; - } - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = bytesFromBase64(object.code_hash); - } - return message; - }, - - toJSON(message: StoreCodeProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.run_as !== undefined && (obj.run_as = message.run_as); - message.wasm_byte_code !== undefined && - (obj.wasm_byte_code = base64FromBytes( - message.wasm_byte_code !== undefined - ? message.wasm_byte_code - : new Uint8Array() - )); - message.instantiate_permission !== undefined && - (obj.instantiate_permission = message.instantiate_permission - ? AccessConfig.toJSON(message.instantiate_permission) - : undefined); - message.unpin_code !== undefined && (obj.unpin_code = message.unpin_code); - message.source !== undefined && (obj.source = message.source); - message.builder !== undefined && (obj.builder = message.builder); - message.code_hash !== undefined && - (obj.code_hash = base64FromBytes( - message.code_hash !== undefined ? message.code_hash : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): StoreCodeProposal { - const message = { ...baseStoreCodeProposal } as StoreCodeProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = object.run_as; - } else { - message.run_as = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = object.wasm_byte_code; - } else { - message.wasm_byte_code = new Uint8Array(); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromPartial( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - if (object.unpin_code !== undefined && object.unpin_code !== null) { - message.unpin_code = object.unpin_code; - } else { - message.unpin_code = false; - } - if (object.source !== undefined && object.source !== null) { - message.source = object.source; - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = object.builder; - } else { - message.builder = ""; - } - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = object.code_hash; - } else { - message.code_hash = new Uint8Array(); - } - return message; - }, -}; - -const baseInstantiateContractProposal: object = { - title: "", - description: "", - run_as: "", - admin: "", - code_id: 0, - label: "", -}; - -export const InstantiateContractProposal = { - encode( - message: InstantiateContractProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.run_as !== "") { - writer.uint32(26).string(message.run_as); - } - if (message.admin !== "") { - writer.uint32(34).string(message.admin); - } - if (message.code_id !== 0) { - writer.uint32(40).uint64(message.code_id); - } - if (message.label !== "") { - writer.uint32(50).string(message.label); - } - if (message.msg.length !== 0) { - writer.uint32(58).bytes(message.msg); - } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(66).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): InstantiateContractProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseInstantiateContractProposal, - } as InstantiateContractProposal; - message.funds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.run_as = reader.string(); - break; - case 4: - message.admin = reader.string(); - break; - case 5: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 6: - message.label = reader.string(); - break; - case 7: - message.msg = reader.bytes(); - break; - case 8: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): InstantiateContractProposal { - const message = { - ...baseInstantiateContractProposal, - } as InstantiateContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = String(object.run_as); - } else { - message.run_as = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: InstantiateContractProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.run_as !== undefined && (obj.run_as = message.run_as); - message.admin !== undefined && (obj.admin = message.admin); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.label !== undefined && (obj.label = message.label); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.funds = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): InstantiateContractProposal { - const message = { - ...baseInstantiateContractProposal, - } as InstantiateContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = object.run_as; - } else { - message.run_as = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMigrateContractProposal: object = { - title: "", - description: "", - contract: "", - code_id: 0, -}; - -export const MigrateContractProposal = { - encode( - message: MigrateContractProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.contract !== "") { - writer.uint32(34).string(message.contract); - } - if (message.code_id !== 0) { - writer.uint32(40).uint64(message.code_id); - } - if (message.msg.length !== 0) { - writer.uint32(50).bytes(message.msg); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MigrateContractProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMigrateContractProposal, - } as MigrateContractProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 4: - message.contract = reader.string(); - break; - case 5: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 6: - message.msg = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MigrateContractProposal { - const message = { - ...baseMigrateContractProposal, - } as MigrateContractProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - return message; - }, - - toJSON(message: MigrateContractProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.contract !== undefined && (obj.contract = message.contract); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MigrateContractProposal { - const message = { - ...baseMigrateContractProposal, - } as MigrateContractProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - return message; - }, -}; - -const baseSudoContractProposal: object = { - title: "", - description: "", - contract: "", -}; - -export const SudoContractProposal = { - encode( - message: SudoContractProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.contract !== "") { - writer.uint32(26).string(message.contract); - } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SudoContractProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSudoContractProposal } as SudoContractProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.contract = reader.string(); - break; - case 4: - message.msg = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SudoContractProposal { - const message = { ...baseSudoContractProposal } as SudoContractProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - return message; - }, - - toJSON(message: SudoContractProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.contract !== undefined && (obj.contract = message.contract); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): SudoContractProposal { - const message = { ...baseSudoContractProposal } as SudoContractProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - return message; - }, -}; - -const baseExecuteContractProposal: object = { - title: "", - description: "", - run_as: "", - contract: "", -}; - -export const ExecuteContractProposal = { - encode( - message: ExecuteContractProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.run_as !== "") { - writer.uint32(26).string(message.run_as); - } - if (message.contract !== "") { - writer.uint32(34).string(message.contract); - } - if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); - } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExecuteContractProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseExecuteContractProposal, - } as ExecuteContractProposal; - message.funds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.run_as = reader.string(); - break; - case 4: - message.contract = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExecuteContractProposal { - const message = { - ...baseExecuteContractProposal, - } as ExecuteContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = String(object.run_as); - } else { - message.run_as = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExecuteContractProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.run_as !== undefined && (obj.run_as = message.run_as); - message.contract !== undefined && (obj.contract = message.contract); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.funds = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExecuteContractProposal { - const message = { - ...baseExecuteContractProposal, - } as ExecuteContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = object.run_as; - } else { - message.run_as = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUpdateAdminProposal: object = { - title: "", - description: "", - new_admin: "", - contract: "", -}; - -export const UpdateAdminProposal = { - encode( - message: UpdateAdminProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.new_admin !== "") { - writer.uint32(26).string(message.new_admin); - } - if (message.contract !== "") { - writer.uint32(34).string(message.contract); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UpdateAdminProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.new_admin = reader.string(); - break; - case 4: - message.contract = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpdateAdminProposal { - const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = String(object.new_admin); - } else { - message.new_admin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; - }, - - toJSON(message: UpdateAdminProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.new_admin !== undefined && (obj.new_admin = message.new_admin); - message.contract !== undefined && (obj.contract = message.contract); - return obj; - }, - - fromPartial(object: DeepPartial): UpdateAdminProposal { - const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = object.new_admin; - } else { - message.new_admin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - return message; - }, -}; - -const baseClearAdminProposal: object = { - title: "", - description: "", - contract: "", -}; - -export const ClearAdminProposal = { - encode( - message: ClearAdminProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.contract !== "") { - writer.uint32(26).string(message.contract); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ClearAdminProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseClearAdminProposal } as ClearAdminProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.contract = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ClearAdminProposal { - const message = { ...baseClearAdminProposal } as ClearAdminProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; - }, - - toJSON(message: ClearAdminProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.contract !== undefined && (obj.contract = message.contract); - return obj; - }, - - fromPartial(object: DeepPartial): ClearAdminProposal { - const message = { ...baseClearAdminProposal } as ClearAdminProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - return message; - }, -}; - -const basePinCodesProposal: object = { - title: "", - description: "", - code_ids: 0, -}; - -export const PinCodesProposal = { - encode(message: PinCodesProposal, writer: Writer = Writer.create()): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - writer.uint32(26).fork(); - for (const v of message.code_ids) { - writer.uint64(v); - } - writer.ldelim(); - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PinCodesProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePinCodesProposal } as PinCodesProposal; - message.code_ids = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.code_ids.push(longToNumber(reader.uint64() as Long)); - } - } else { - message.code_ids.push(longToNumber(reader.uint64() as Long)); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PinCodesProposal { - const message = { ...basePinCodesProposal } as PinCodesProposal; - message.code_ids = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(Number(e)); - } - } - return message; - }, - - toJSON(message: PinCodesProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - if (message.code_ids) { - obj.code_ids = message.code_ids.map((e) => e); - } else { - obj.code_ids = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): PinCodesProposal { - const message = { ...basePinCodesProposal } as PinCodesProposal; - message.code_ids = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(e); - } - } - return message; - }, -}; - -const baseUnpinCodesProposal: object = { - title: "", - description: "", - code_ids: 0, -}; - -export const UnpinCodesProposal = { - encode( - message: UnpinCodesProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - writer.uint32(26).fork(); - for (const v of message.code_ids) { - writer.uint64(v); - } - writer.ldelim(); - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UnpinCodesProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; - message.code_ids = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.code_ids.push(longToNumber(reader.uint64() as Long)); - } - } else { - message.code_ids.push(longToNumber(reader.uint64() as Long)); - } - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UnpinCodesProposal { - const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; - message.code_ids = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(Number(e)); - } - } - return message; - }, - - toJSON(message: UnpinCodesProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - if (message.code_ids) { - obj.code_ids = message.code_ids.map((e) => e); - } else { - obj.code_ids = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): UnpinCodesProposal { - const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; - message.code_ids = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(e); - } - } - return message; - }, -}; - -const baseAccessConfigUpdate: object = { code_id: 0 }; - -export const AccessConfigUpdate = { - encode( - message: AccessConfigUpdate, - writer: Writer = Writer.create() - ): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); - } - if (message.instantiate_permission !== undefined) { - AccessConfig.encode( - message.instantiate_permission, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): AccessConfigUpdate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAccessConfigUpdate } as AccessConfigUpdate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.instantiate_permission = AccessConfig.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): AccessConfigUpdate { - const message = { ...baseAccessConfigUpdate } as AccessConfigUpdate; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromJSON( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - return message; - }, - - toJSON(message: AccessConfigUpdate): unknown { - const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); - message.instantiate_permission !== undefined && - (obj.instantiate_permission = message.instantiate_permission - ? AccessConfig.toJSON(message.instantiate_permission) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): AccessConfigUpdate { - const message = { ...baseAccessConfigUpdate } as AccessConfigUpdate; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromPartial( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - return message; - }, -}; - -const baseUpdateInstantiateConfigProposal: object = { - title: "", - description: "", -}; - -export const UpdateInstantiateConfigProposal = { - encode( - message: UpdateInstantiateConfigProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - for (const v of message.access_config_updates) { - AccessConfigUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UpdateInstantiateConfigProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUpdateInstantiateConfigProposal, - } as UpdateInstantiateConfigProposal; - message.access_config_updates = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.access_config_updates.push( - AccessConfigUpdate.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpdateInstantiateConfigProposal { - const message = { - ...baseUpdateInstantiateConfigProposal, - } as UpdateInstantiateConfigProposal; - message.access_config_updates = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if ( - object.access_config_updates !== undefined && - object.access_config_updates !== null - ) { - for (const e of object.access_config_updates) { - message.access_config_updates.push(AccessConfigUpdate.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: UpdateInstantiateConfigProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - if (message.access_config_updates) { - obj.access_config_updates = message.access_config_updates.map((e) => - e ? AccessConfigUpdate.toJSON(e) : undefined - ); - } else { - obj.access_config_updates = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): UpdateInstantiateConfigProposal { - const message = { - ...baseUpdateInstantiateConfigProposal, - } as UpdateInstantiateConfigProposal; - message.access_config_updates = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if ( - object.access_config_updates !== undefined && - object.access_config_updates !== null - ) { - for (const e of object.access_config_updates) { - message.access_config_updates.push(AccessConfigUpdate.fromPartial(e)); - } - } - return message; - }, -}; - -const baseStoreAndInstantiateContractProposal: object = { - title: "", - description: "", - run_as: "", - unpin_code: false, - admin: "", - label: "", - source: "", - builder: "", -}; - -export const StoreAndInstantiateContractProposal = { - encode( - message: StoreAndInstantiateContractProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.run_as !== "") { - writer.uint32(26).string(message.run_as); - } - if (message.wasm_byte_code.length !== 0) { - writer.uint32(34).bytes(message.wasm_byte_code); - } - if (message.instantiate_permission !== undefined) { - AccessConfig.encode( - message.instantiate_permission, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.unpin_code === true) { - writer.uint32(48).bool(message.unpin_code); - } - if (message.admin !== "") { - writer.uint32(58).string(message.admin); - } - if (message.label !== "") { - writer.uint32(66).string(message.label); - } - if (message.msg.length !== 0) { - writer.uint32(74).bytes(message.msg); - } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(82).fork()).ldelim(); - } - if (message.source !== "") { - writer.uint32(90).string(message.source); - } - if (message.builder !== "") { - writer.uint32(98).string(message.builder); - } - if (message.code_hash.length !== 0) { - writer.uint32(106).bytes(message.code_hash); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): StoreAndInstantiateContractProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseStoreAndInstantiateContractProposal, - } as StoreAndInstantiateContractProposal; - message.funds = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.run_as = reader.string(); - break; - case 4: - message.wasm_byte_code = reader.bytes(); - break; - case 5: - message.instantiate_permission = AccessConfig.decode( - reader, - reader.uint32() - ); - break; - case 6: - message.unpin_code = reader.bool(); - break; - case 7: - message.admin = reader.string(); - break; - case 8: - message.label = reader.string(); - break; - case 9: - message.msg = reader.bytes(); - break; - case 10: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; - case 11: - message.source = reader.string(); - break; - case 12: - message.builder = reader.string(); - break; - case 13: - message.code_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): StoreAndInstantiateContractProposal { - const message = { - ...baseStoreAndInstantiateContractProposal, - } as StoreAndInstantiateContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = String(object.run_as); - } else { - message.run_as = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = bytesFromBase64(object.wasm_byte_code); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromJSON( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - if (object.unpin_code !== undefined && object.unpin_code !== null) { - message.unpin_code = Boolean(object.unpin_code); - } else { - message.unpin_code = false; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - if (object.source !== undefined && object.source !== null) { - message.source = String(object.source); - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = String(object.builder); - } else { - message.builder = ""; - } - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = bytesFromBase64(object.code_hash); - } - return message; - }, - - toJSON(message: StoreAndInstantiateContractProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.run_as !== undefined && (obj.run_as = message.run_as); - message.wasm_byte_code !== undefined && - (obj.wasm_byte_code = base64FromBytes( - message.wasm_byte_code !== undefined - ? message.wasm_byte_code - : new Uint8Array() - )); - message.instantiate_permission !== undefined && - (obj.instantiate_permission = message.instantiate_permission - ? AccessConfig.toJSON(message.instantiate_permission) - : undefined); - message.unpin_code !== undefined && (obj.unpin_code = message.unpin_code); - message.admin !== undefined && (obj.admin = message.admin); - message.label !== undefined && (obj.label = message.label); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); - } else { - obj.funds = []; - } - message.source !== undefined && (obj.source = message.source); - message.builder !== undefined && (obj.builder = message.builder); - message.code_hash !== undefined && - (obj.code_hash = base64FromBytes( - message.code_hash !== undefined ? message.code_hash : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): StoreAndInstantiateContractProposal { - const message = { - ...baseStoreAndInstantiateContractProposal, - } as StoreAndInstantiateContractProposal; - message.funds = []; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.run_as !== undefined && object.run_as !== null) { - message.run_as = object.run_as; - } else { - message.run_as = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = object.wasm_byte_code; - } else { - message.wasm_byte_code = new Uint8Array(); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromPartial( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - if (object.unpin_code !== undefined && object.unpin_code !== null) { - message.unpin_code = object.unpin_code; - } else { - message.unpin_code = false; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); - } - } - if (object.source !== undefined && object.source !== null) { - message.source = object.source; - } else { - message.source = ""; - } - if (object.builder !== undefined && object.builder !== null) { - message.builder = object.builder; - } else { - message.builder = ""; - } - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = object.code_hash; - } else { - message.code_hash = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal_legacy.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal_legacy.ts new file mode 100644 index 0000000000..512e7bdf20 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/proposal_legacy.ts @@ -0,0 +1,1686 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { AccessConfig } from "./types"; + +export const protobufPackage = "cosmwasm.wasm.v1"; + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface StoreCodeProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission: + | AccessConfig + | undefined; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface InstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: number; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface InstantiateContract2Proposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: number; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface MigrateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: number; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface SudoContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface ExecuteContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface UpdateAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface ClearAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface PinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the new WASM codes */ + codeIds: number[]; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + * + * @deprecated + */ +export interface UnpinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: number[]; +} + +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdate { + /** CodeID is the reference to the stored WASM code to be updated */ + codeId: number; + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfig | undefined; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + * + * @deprecated + */ +export interface UpdateInstantiateConfigProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + accessConfigUpdates: AccessConfigUpdate[]; +} + +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + * + * @deprecated + */ +export interface StoreAndInstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission: + | AccessConfig + | undefined; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} + +function createBaseStoreCodeProposal(): StoreCodeProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + source: "", + builder: "", + codeHash: new Uint8Array(), + }; +} + +export const StoreCodeProposal = { + encode(message: StoreCodeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(64).bool(message.unpinCode); + } + if (message.source !== "") { + writer.uint32(74).string(message.source); + } + if (message.builder !== "") { + writer.uint32(82).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(90).bytes(message.codeHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 7: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 8: + message.unpinCode = reader.bool(); + break; + case 9: + message.source = reader.string(); + break; + case 10: + message.builder = reader.string(); + break; + case 11: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StoreCodeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + }; + }, + + toJSON(message: StoreCodeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined + && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + message.unpinCode = object.unpinCode ?? false; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, +}; + +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { title: "", description: "", runAs: "", admin: "", codeId: 0, label: "", msg: new Uint8Array(), funds: [] }; +} + +export const InstantiateContractProposal = { + encode(message: InstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== 0) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InstantiateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: InstantiateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId ?? 0; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: 0, + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false, + }; +} + +export const InstantiateContract2Proposal = { + encode(message: InstantiateContract2Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== 0) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(74).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(80).bool(message.fixMsg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContract2Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContract2Proposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 9: + message.salt = reader.bytes(); + break; + case 10: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InstantiateContract2Proposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + salt: isSet(object.salt) ? bytesFromBase64(object.salt) : new Uint8Array(), + fixMsg: isSet(object.fixMsg) ? Boolean(object.fixMsg) : false, + }; + }, + + toJSON(message: InstantiateContract2Proposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.salt !== undefined + && (obj.salt = base64FromBytes(message.salt !== undefined ? message.salt : new Uint8Array())); + message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); + return obj; + }, + + fromPartial, I>>(object: I): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId ?? 0; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, +}; + +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { title: "", description: "", contract: "", codeId: 0, msg: new Uint8Array() }; +} + +export const MigrateContractProposal = { + encode(message: MigrateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.codeId !== 0) { + writer.uint32(40).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 6: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MigrateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; + }, + + toJSON(message: MigrateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId ?? 0; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, +}; + +function createBaseSudoContractProposal(): SudoContractProposal { + return { title: "", description: "", contract: "", msg: new Uint8Array() }; +} + +export const SudoContractProposal = { + encode(message: SudoContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SudoContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SudoContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; + }, + + toJSON(message: SudoContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): SudoContractProposal { + const message = createBaseSudoContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, +}; + +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { title: "", description: "", runAs: "", contract: "", msg: new Uint8Array(), funds: [] }; +} + +export const ExecuteContractProposal = { + encode(message: ExecuteContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExecuteContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecuteContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecuteContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: ExecuteContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { title: "", description: "", newAdmin: "", contract: "" }; +} + +export const UpdateAdminProposal = { + encode(message: UpdateAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAdminProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + }; + }, + + toJSON(message: UpdateAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial, I>>(object: I): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, +}; + +function createBaseClearAdminProposal(): ClearAdminProposal { + return { title: "", description: "", contract: "" }; +} + +export const ClearAdminProposal = { + encode(message: ClearAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClearAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClearAdminProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + }; + }, + + toJSON(message: ClearAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial, I>>(object: I): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + return message; + }, +}; + +function createBasePinCodesProposal(): PinCodesProposal { + return { title: "", description: "", codeIds: [] }; +} + +export const PinCodesProposal = { + encode(message: PinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PinCodesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => Number(e)) : [], + }; + }, + + toJSON(message: PinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => Math.round(e)); + } else { + obj.codeIds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): PinCodesProposal { + const message = createBasePinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map((e) => e) || []; + return message; + }, +}; + +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { title: "", description: "", codeIds: [] }; +} + +export const UnpinCodesProposal = { + encode(message: UnpinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UnpinCodesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => Number(e)) : [], + }; + }, + + toJSON(message: UnpinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => Math.round(e)); + } else { + obj.codeIds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map((e) => e) || []; + return message; + }, +}; + +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { codeId: 0, instantiatePermission: undefined }; +} + +export const AccessConfigUpdate = { + encode(message: AccessConfigUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfigUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfigUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AccessConfigUpdate { + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + }; + }, + + toJSON(message: AccessConfigUpdate): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate(); + message.codeId = object.codeId ?? 0; + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + return message; + }, +}; + +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { title: "", description: "", accessConfigUpdates: [] }; +} + +export const UpdateInstantiateConfigProposal = { + encode(message: UpdateInstantiateConfigProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.accessConfigUpdates) { + AccessConfigUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInstantiateConfigProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.accessConfigUpdates.push(AccessConfigUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateInstantiateConfigProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + accessConfigUpdates: Array.isArray(object?.accessConfigUpdates) + ? object.accessConfigUpdates.map((e: any) => AccessConfigUpdate.fromJSON(e)) + : [], + }; + }, + + toJSON(message: UpdateInstantiateConfigProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.accessConfigUpdates) { + obj.accessConfigUpdates = message.accessConfigUpdates.map((e) => e ? AccessConfigUpdate.toJSON(e) : undefined); + } else { + obj.accessConfigUpdates = []; + } + return obj; + }, + + fromPartial, I>>( + object: I, + ): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.accessConfigUpdates = object.accessConfigUpdates?.map((e) => AccessConfigUpdate.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array(), + }; +} + +export const StoreAndInstantiateContractProposal = { + encode(message: StoreAndInstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(48).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(58).string(message.admin); + } + if (message.label !== "") { + writer.uint32(66).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(74).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(90).string(message.source); + } + if (message.builder !== "") { + writer.uint32(98).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(106).bytes(message.codeHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreAndInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 6: + message.unpinCode = reader.bool(); + break; + case 7: + message.admin = reader.string(); + break; + case 8: + message.label = reader.string(); + break; + case 9: + message.msg = reader.bytes(); + break; + case 10: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 11: + message.source = reader.string(); + break; + case 12: + message.builder = reader.string(); + break; + case 13: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StoreAndInstantiateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + }; + }, + + toJSON(message: StoreAndInstantiateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined + && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/query.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/query.ts index 5ae85b448f..d07a38995d 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/query.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/query.ts @@ -1,18 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { - ContractInfo, - ContractCodeHistoryEntry, - Model, - AccessConfig, - Params, -} from "../../../cosmwasm/wasm/v1/types"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { AccessConfig, ContractCodeHistoryEntry, ContractInfo, Model, Params } from "./types"; export const protobufPackage = "cosmwasm.wasm.v1"; @@ -32,7 +23,7 @@ export interface QueryContractInfoRequest { export interface QueryContractInfoResponse { /** address is the address of the contract */ address: string; - contract_info: ContractInfo | undefined; + contractInfo: ContractInfo | undefined; } /** @@ -62,7 +53,7 @@ export interface QueryContractHistoryResponse { */ export interface QueryContractsByCodeRequest { /** grpc-gateway_out does not support Go style CodID */ - code_id: number; + codeId: number; /** pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -106,7 +97,7 @@ export interface QueryAllContractStateResponse { export interface QueryRawContractStateRequest { /** address is the address of the contract */ address: string; - query_data: Uint8Array; + queryData: Uint8Array; } /** @@ -126,7 +117,7 @@ export interface QuerySmartContractStateRequest { /** address is the address of the contract */ address: string; /** QueryData contains the query data passed to the contract */ - query_data: Uint8Array; + queryData: Uint8Array; } /** @@ -141,21 +132,21 @@ export interface QuerySmartContractStateResponse { /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequest { /** grpc-gateway_out does not support Go style CodID */ - code_id: number; + codeId: number; } /** CodeInfoResponse contains code meta data from CodeInfo */ export interface CodeInfoResponse { /** id for legacy support */ - code_id: number; + codeId: number; creator: string; - data_hash: Uint8Array; - instantiate_permission: AccessConfig | undefined; + dataHash: Uint8Array; + instantiatePermission: AccessConfig | undefined; } /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponse { - code_info: CodeInfoResponse | undefined; + codeInfo: CodeInfoResponse | undefined; data: Uint8Array; } @@ -167,7 +158,7 @@ export interface QueryCodesRequest { /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponse { - code_infos: CodeInfoResponse[]; + codeInfos: CodeInfoResponse[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } @@ -186,13 +177,14 @@ export interface QueryPinnedCodesRequest { * Query/PinnedCodes RPC method */ export interface QueryPinnedCodesResponse { - code_ids: number[]; + codeIds: number[]; /** pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -206,7 +198,7 @@ export interface QueryParamsResponse { */ export interface QueryContractsByCreatorRequest { /** CreatorAddress is the address of contract creator */ - creator_address: string; + creatorAddress: string; /** Pagination defines an optional pagination for the request. */ pagination: PageRequest | undefined; } @@ -217,33 +209,27 @@ export interface QueryContractsByCreatorRequest { */ export interface QueryContractsByCreatorResponse { /** ContractAddresses result set */ - contract_addresses: string[]; + contractAddresses: string[]; /** Pagination defines the pagination in the response. */ pagination: PageResponse | undefined; } -const baseQueryContractInfoRequest: object = { address: "" }; +function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { + return { address: "" }; +} export const QueryContractInfoRequest = { - encode( - message: QueryContractInfoRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryContractInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractInfoRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractInfoRequest, - } as QueryContractInfoRequest; + const message = createBaseQueryContractInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -259,15 +245,7 @@ export const QueryContractInfoRequest = { }, fromJSON(object: any): QueryContractInfoRequest { - const message = { - ...baseQueryContractInfoRequest, - } as QueryContractInfoRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; + return { address: isSet(object.address) ? String(object.address) : "" }; }, toJSON(message: QueryContractInfoRequest): unknown { @@ -276,49 +254,32 @@ export const QueryContractInfoRequest = { return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractInfoRequest { - const message = { - ...baseQueryContractInfoRequest, - } as QueryContractInfoRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } + fromPartial, I>>(object: I): QueryContractInfoRequest { + const message = createBaseQueryContractInfoRequest(); + message.address = object.address ?? ""; return message; }, }; -const baseQueryContractInfoResponse: object = { address: "" }; +function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { + return { address: "", contractInfo: undefined }; +} export const QueryContractInfoResponse = { - encode( - message: QueryContractInfoResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryContractInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.contract_info !== undefined) { - ContractInfo.encode( - message.contract_info, - writer.uint32(18).fork() - ).ldelim(); + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractInfoResponse, - } as QueryContractInfoResponse; + const message = createBaseQueryContractInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -326,7 +287,7 @@ export const QueryContractInfoResponse = { message.address = reader.string(); break; case 2: - message.contract_info = ContractInfo.decode(reader, reader.uint32()); + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -337,59 +298,36 @@ export const QueryContractInfoResponse = { }, fromJSON(object: any): QueryContractInfoResponse { - const message = { - ...baseQueryContractInfoResponse, - } as QueryContractInfoResponse; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.contract_info !== undefined && object.contract_info !== null) { - message.contract_info = ContractInfo.fromJSON(object.contract_info); - } else { - message.contract_info = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + contractInfo: isSet(object.contractInfo) ? ContractInfo.fromJSON(object.contractInfo) : undefined, + }; }, toJSON(message: QueryContractInfoResponse): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.contract_info !== undefined && - (obj.contract_info = message.contract_info - ? ContractInfo.toJSON(message.contract_info) - : undefined); + message.contractInfo !== undefined + && (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractInfoResponse { - const message = { - ...baseQueryContractInfoResponse, - } as QueryContractInfoResponse; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.contract_info !== undefined && object.contract_info !== null) { - message.contract_info = ContractInfo.fromPartial(object.contract_info); - } else { - message.contract_info = undefined; - } + fromPartial, I>>(object: I): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + message.address = object.address ?? ""; + message.contractInfo = (object.contractInfo !== undefined && object.contractInfo !== null) + ? ContractInfo.fromPartial(object.contractInfo) + : undefined; return message; }, }; -const baseQueryContractHistoryRequest: object = { address: "" }; +function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { + return { address: "", pagination: undefined }; +} export const QueryContractHistoryRequest = { - encode( - message: QueryContractHistoryRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryContractHistoryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -399,15 +337,10 @@ export const QueryContractHistoryRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractHistoryRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractHistoryRequest, - } as QueryContractHistoryRequest; + const message = createBaseQueryContractHistoryRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -426,88 +359,54 @@ export const QueryContractHistoryRequest = { }, fromJSON(object: any): QueryContractHistoryRequest { - const message = { - ...baseQueryContractHistoryRequest, - } as QueryContractHistoryRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractHistoryRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractHistoryRequest { - const message = { - ...baseQueryContractHistoryRequest, - } as QueryContractHistoryRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + message.address = object.address ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryContractHistoryResponse: object = {}; +function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { + return { entries: [], pagination: undefined }; +} export const QueryContractHistoryResponse = { - encode( - message: QueryContractHistoryResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryContractHistoryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.entries) { ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractHistoryResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractHistoryResponse, - } as QueryContractHistoryResponse; - message.entries = []; + const message = createBaseQueryContractHistoryResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.entries.push( - ContractCodeHistoryEntry.decode(reader, reader.uint32()) - ); + message.entries.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -521,69 +420,44 @@ export const QueryContractHistoryResponse = { }, fromJSON(object: any): QueryContractHistoryResponse { - const message = { - ...baseQueryContractHistoryResponse, - } as QueryContractHistoryResponse; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(ContractCodeHistoryEntry.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + entries: Array.isArray(object?.entries) + ? object.entries.map((e: any) => ContractCodeHistoryEntry.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractHistoryResponse): unknown { const obj: any = {}; if (message.entries) { - obj.entries = message.entries.map((e) => - e ? ContractCodeHistoryEntry.toJSON(e) : undefined - ); + obj.entries = message.entries.map((e) => e ? ContractCodeHistoryEntry.toJSON(e) : undefined); } else { obj.entries = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractHistoryResponse { - const message = { - ...baseQueryContractHistoryResponse, - } as QueryContractHistoryResponse; - message.entries = []; - if (object.entries !== undefined && object.entries !== null) { - for (const e of object.entries) { - message.entries.push(ContractCodeHistoryEntry.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map((e) => ContractCodeHistoryEntry.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryContractsByCodeRequest: object = { code_id: 0 }; +function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { + return { codeId: 0, pagination: undefined }; +} export const QueryContractsByCodeRequest = { - encode( - message: QueryContractsByCodeRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: QueryContractsByCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -591,20 +465,15 @@ export const QueryContractsByCodeRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractsByCodeRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractsByCodeRequest, - } as QueryContractsByCodeRequest; + const message = createBaseQueryContractsByCodeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -618,81 +487,49 @@ export const QueryContractsByCodeRequest = { }, fromJSON(object: any): QueryContractsByCodeRequest { - const message = { - ...baseQueryContractsByCodeRequest, - } as QueryContractsByCodeRequest; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractsByCodeRequest): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractsByCodeRequest { - const message = { - ...baseQueryContractsByCodeRequest, - } as QueryContractsByCodeRequest; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryContractsByCodeRequest { + const message = createBaseQueryContractsByCodeRequest(); + message.codeId = object.codeId ?? 0; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryContractsByCodeResponse: object = { contracts: "" }; +function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { + return { contracts: [], pagination: undefined }; +} export const QueryContractsByCodeResponse = { - encode( - message: QueryContractsByCodeResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryContractsByCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.contracts) { writer.uint32(10).string(v!); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractsByCodeResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractsByCodeResponse, - } as QueryContractsByCodeResponse; - message.contracts = []; + const message = createBaseQueryContractsByCodeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -711,21 +548,10 @@ export const QueryContractsByCodeResponse = { }, fromJSON(object: any): QueryContractsByCodeResponse { - const message = { - ...baseQueryContractsByCodeResponse, - } as QueryContractsByCodeResponse; - message.contracts = []; - if (object.contracts !== undefined && object.contracts !== null) { - for (const e of object.contracts) { - message.contracts.push(String(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractsByCodeResponse): unknown { @@ -735,41 +561,27 @@ export const QueryContractsByCodeResponse = { } else { obj.contracts = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryContractsByCodeResponse { - const message = { - ...baseQueryContractsByCodeResponse, - } as QueryContractsByCodeResponse; - message.contracts = []; - if (object.contracts !== undefined && object.contracts !== null) { - for (const e of object.contracts) { - message.contracts.push(e); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryContractsByCodeResponse { + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map((e) => e) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllContractStateRequest: object = { address: "" }; +function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { + return { address: "", pagination: undefined }; +} export const QueryAllContractStateRequest = { - encode( - message: QueryAllContractStateRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -779,15 +591,10 @@ export const QueryAllContractStateRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllContractStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllContractStateRequest, - } as QueryAllContractStateRequest; + const message = createBaseQueryAllContractStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -806,81 +613,49 @@ export const QueryAllContractStateRequest = { }, fromJSON(object: any): QueryAllContractStateRequest { - const message = { - ...baseQueryAllContractStateRequest, - } as QueryAllContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllContractStateRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryAllContractStateRequest { - const message = { - ...baseQueryAllContractStateRequest, - } as QueryAllContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryAllContractStateRequest { + const message = createBaseQueryAllContractStateRequest(); + message.address = object.address ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryAllContractStateResponse: object = {}; +function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { + return { models: [], pagination: undefined }; +} export const QueryAllContractStateResponse = { - encode( - message: QueryAllContractStateResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryAllContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.models) { Model.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllContractStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllContractStateResponse, - } as QueryAllContractStateResponse; - message.models = []; + const message = createBaseQueryAllContractStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -899,83 +674,55 @@ export const QueryAllContractStateResponse = { }, fromJSON(object: any): QueryAllContractStateResponse { - const message = { - ...baseQueryAllContractStateResponse, - } as QueryAllContractStateResponse; - message.models = []; - if (object.models !== undefined && object.models !== null) { - for (const e of object.models) { - message.models.push(Model.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + models: Array.isArray(object?.models) ? object.models.map((e: any) => Model.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryAllContractStateResponse): unknown { const obj: any = {}; if (message.models) { - obj.models = message.models.map((e) => (e ? Model.toJSON(e) : undefined)); + obj.models = message.models.map((e) => e ? Model.toJSON(e) : undefined); } else { obj.models = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryAllContractStateResponse { - const message = { - ...baseQueryAllContractStateResponse, - } as QueryAllContractStateResponse; - message.models = []; - if (object.models !== undefined && object.models !== null) { - for (const e of object.models) { - message.models.push(Model.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map((e) => Model.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryRawContractStateRequest: object = { address: "" }; +function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest { + return { address: "", queryData: new Uint8Array() }; +} export const QueryRawContractStateRequest = { - encode( - message: QueryRawContractStateRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryRawContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.query_data.length !== 0) { - writer.uint32(18).bytes(message.query_data); + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRawContractStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRawContractStateRequest, - } as QueryRawContractStateRequest; + const message = createBaseQueryRawContractStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -983,7 +730,7 @@ export const QueryRawContractStateRequest = { message.address = reader.string(); break; case 2: - message.query_data = reader.bytes(); + message.queryData = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -994,72 +741,44 @@ export const QueryRawContractStateRequest = { }, fromJSON(object: any): QueryRawContractStateRequest { - const message = { - ...baseQueryRawContractStateRequest, - } as QueryRawContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.query_data !== undefined && object.query_data !== null) { - message.query_data = bytesFromBase64(object.query_data); - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + queryData: isSet(object.queryData) ? bytesFromBase64(object.queryData) : new Uint8Array(), + }; }, toJSON(message: QueryRawContractStateRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.query_data !== undefined && - (obj.query_data = base64FromBytes( - message.query_data !== undefined ? message.query_data : new Uint8Array() - )); + message.queryData !== undefined + && (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): QueryRawContractStateRequest { - const message = { - ...baseQueryRawContractStateRequest, - } as QueryRawContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.query_data !== undefined && object.query_data !== null) { - message.query_data = object.query_data; - } else { - message.query_data = new Uint8Array(); - } + fromPartial, I>>(object: I): QueryRawContractStateRequest { + const message = createBaseQueryRawContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); return message; }, }; -const baseQueryRawContractStateResponse: object = {}; +function createBaseQueryRawContractStateResponse(): QueryRawContractStateResponse { + return { data: new Uint8Array() }; +} export const QueryRawContractStateResponse = { - encode( - message: QueryRawContractStateResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryRawContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryRawContractStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryRawContractStateResponse, - } as QueryRawContractStateResponse; + const message = createBaseQueryRawContractStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1075,64 +794,44 @@ export const QueryRawContractStateResponse = { }, fromJSON(object: any): QueryRawContractStateResponse { - const message = { - ...baseQueryRawContractStateResponse, - } as QueryRawContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, toJSON(message: QueryRawContractStateResponse): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryRawContractStateResponse { - const message = { - ...baseQueryRawContractStateResponse, - } as QueryRawContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + const message = createBaseQueryRawContractStateResponse(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseQuerySmartContractStateRequest: object = { address: "" }; +function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequest { + return { address: "", queryData: new Uint8Array() }; +} export const QuerySmartContractStateRequest = { - encode( - message: QuerySmartContractStateRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySmartContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (message.query_data.length !== 0) { - writer.uint32(18).bytes(message.query_data); + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySmartContractStateRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySmartContractStateRequest, - } as QuerySmartContractStateRequest; + const message = createBaseQuerySmartContractStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1140,7 +839,7 @@ export const QuerySmartContractStateRequest = { message.address = reader.string(); break; case 2: - message.query_data = reader.bytes(); + message.queryData = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1151,72 +850,46 @@ export const QuerySmartContractStateRequest = { }, fromJSON(object: any): QuerySmartContractStateRequest { - const message = { - ...baseQuerySmartContractStateRequest, - } as QuerySmartContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.query_data !== undefined && object.query_data !== null) { - message.query_data = bytesFromBase64(object.query_data); - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + queryData: isSet(object.queryData) ? bytesFromBase64(object.queryData) : new Uint8Array(), + }; }, toJSON(message: QuerySmartContractStateRequest): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.query_data !== undefined && - (obj.query_data = base64FromBytes( - message.query_data !== undefined ? message.query_data : new Uint8Array() - )); + message.queryData !== undefined + && (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QuerySmartContractStateRequest { - const message = { - ...baseQuerySmartContractStateRequest, - } as QuerySmartContractStateRequest; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.query_data !== undefined && object.query_data !== null) { - message.query_data = object.query_data; - } else { - message.query_data = new Uint8Array(); - } + const message = createBaseQuerySmartContractStateRequest(); + message.address = object.address ?? ""; + message.queryData = object.queryData ?? new Uint8Array(); return message; }, }; -const baseQuerySmartContractStateResponse: object = {}; +function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateResponse { + return { data: new Uint8Array() }; +} export const QuerySmartContractStateResponse = { - encode( - message: QuerySmartContractStateResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QuerySmartContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QuerySmartContractStateResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQuerySmartContractStateResponse, - } as QuerySmartContractStateResponse; + const message = createBaseQuerySmartContractStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1232,58 +905,46 @@ export const QuerySmartContractStateResponse = { }, fromJSON(object: any): QuerySmartContractStateResponse { - const message = { - ...baseQuerySmartContractStateResponse, - } as QuerySmartContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, toJSON(message: QuerySmartContractStateResponse): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QuerySmartContractStateResponse { - const message = { - ...baseQuerySmartContractStateResponse, - } as QuerySmartContractStateResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + const message = createBaseQuerySmartContractStateResponse(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseQueryCodeRequest: object = { code_id: 0 }; +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { codeId: 0 }; +} export const QueryCodeRequest = { - encode(message: QueryCodeRequest, writer: Writer = Writer.create()): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: QueryCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryCodeRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; + const message = createBaseQueryCodeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -1294,75 +955,61 @@ export const QueryCodeRequest = { }, fromJSON(object: any): QueryCodeRequest { - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - return message; + return { codeId: isSet(object.codeId) ? Number(object.codeId) : 0 }; }, toJSON(message: QueryCodeRequest): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); return obj; }, - fromPartial(object: DeepPartial): QueryCodeRequest { - const message = { ...baseQueryCodeRequest } as QueryCodeRequest; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } + fromPartial, I>>(object: I): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.codeId = object.codeId ?? 0; return message; }, }; -const baseCodeInfoResponse: object = { code_id: 0, creator: "" }; +function createBaseCodeInfoResponse(): CodeInfoResponse { + return { codeId: 0, creator: "", dataHash: new Uint8Array(), instantiatePermission: undefined }; +} export const CodeInfoResponse = { - encode(message: CodeInfoResponse, writer: Writer = Writer.create()): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: CodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } if (message.creator !== "") { writer.uint32(18).string(message.creator); } - if (message.data_hash.length !== 0) { - writer.uint32(26).bytes(message.data_hash); + if (message.dataHash.length !== 0) { + writer.uint32(26).bytes(message.dataHash); } - if (message.instantiate_permission !== undefined) { - AccessConfig.encode( - message.instantiate_permission, - writer.uint32(50).fork() - ).ldelim(); + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(50).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): CodeInfoResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; + const message = createBaseCodeInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 2: message.creator = reader.string(); break; case 3: - message.data_hash = reader.bytes(); + message.dataHash = reader.bytes(); break; case 6: - message.instantiate_permission = AccessConfig.decode( - reader, - reader.uint32() - ); + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1373,88 +1020,49 @@ export const CodeInfoResponse = { }, fromJSON(object: any): CodeInfoResponse { - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = bytesFromBase64(object.data_hash); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromJSON( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - return message; + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + creator: isSet(object.creator) ? String(object.creator) : "", + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + }; }, toJSON(message: CodeInfoResponse): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); message.creator !== undefined && (obj.creator = message.creator); - message.data_hash !== undefined && - (obj.data_hash = base64FromBytes( - message.data_hash !== undefined ? message.data_hash : new Uint8Array() - )); - message.instantiate_permission !== undefined && - (obj.instantiate_permission = message.instantiate_permission - ? AccessConfig.toJSON(message.instantiate_permission) - : undefined); + message.dataHash !== undefined + && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); return obj; }, - fromPartial(object: DeepPartial): CodeInfoResponse { - const message = { ...baseCodeInfoResponse } as CodeInfoResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.data_hash = object.data_hash; - } else { - message.data_hash = new Uint8Array(); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromPartial( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } + fromPartial, I>>(object: I): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + message.codeId = object.codeId ?? 0; + message.creator = object.creator ?? ""; + message.dataHash = object.dataHash ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; return message; }, }; -const baseQueryCodeResponse: object = {}; +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { codeInfo: undefined, data: new Uint8Array() }; +} export const QueryCodeResponse = { - encode(message: QueryCodeResponse, writer: Writer = Writer.create()): Writer { - if (message.code_info !== undefined) { - CodeInfoResponse.encode( - message.code_info, - writer.uint32(10).fork() - ).ldelim(); + encode(message: QueryCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); } if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -1462,15 +1070,15 @@ export const QueryCodeResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryCodeResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; + const message = createBaseQueryCodeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_info = CodeInfoResponse.decode(reader, reader.uint32()); + message.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); break; case 2: message.data = reader.bytes(); @@ -1484,61 +1092,47 @@ export const QueryCodeResponse = { }, fromJSON(object: any): QueryCodeResponse { - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; - if (object.code_info !== undefined && object.code_info !== null) { - message.code_info = CodeInfoResponse.fromJSON(object.code_info); - } else { - message.code_info = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + return { + codeInfo: isSet(object.codeInfo) ? CodeInfoResponse.fromJSON(object.codeInfo) : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, toJSON(message: QueryCodeResponse): unknown { const obj: any = {}; - message.code_info !== undefined && - (obj.code_info = message.code_info - ? CodeInfoResponse.toJSON(message.code_info) - : undefined); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.codeInfo !== undefined + && (obj.codeInfo = message.codeInfo ? CodeInfoResponse.toJSON(message.codeInfo) : undefined); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): QueryCodeResponse { - const message = { ...baseQueryCodeResponse } as QueryCodeResponse; - if (object.code_info !== undefined && object.code_info !== null) { - message.code_info = CodeInfoResponse.fromPartial(object.code_info); - } else { - message.code_info = undefined; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>(object: I): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.codeInfo = (object.codeInfo !== undefined && object.codeInfo !== null) + ? CodeInfoResponse.fromPartial(object.codeInfo) + : undefined; + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseQueryCodesRequest: object = {}; +function createBaseQueryCodesRequest(): QueryCodesRequest { + return { pagination: undefined }; +} export const QueryCodesRequest = { - encode(message: QueryCodesRequest, writer: Writer = Writer.create()): Writer { + encode(message: QueryCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryCodesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; + const message = createBaseQueryCodesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1554,66 +1148,49 @@ export const QueryCodesRequest = { }, fromJSON(object: any): QueryCodesRequest { - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryCodesRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryCodesRequest { - const message = { ...baseQueryCodesRequest } as QueryCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryCodesRequest { + const message = createBaseQueryCodesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryCodesResponse: object = {}; +function createBaseQueryCodesResponse(): QueryCodesResponse { + return { codeInfos: [], pagination: undefined }; +} export const QueryCodesResponse = { - encode( - message: QueryCodesResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.code_infos) { + encode(message: QueryCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.codeInfos) { CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryCodesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.code_infos = []; + const message = createBaseQueryCodesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_infos.push( - CodeInfoResponse.decode(reader, reader.uint32()) - ); + message.codeInfos.push(CodeInfoResponse.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1627,73 +1204,50 @@ export const QueryCodesResponse = { }, fromJSON(object: any): QueryCodesResponse { - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.code_infos = []; - if (object.code_infos !== undefined && object.code_infos !== null) { - for (const e of object.code_infos) { - message.code_infos.push(CodeInfoResponse.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + codeInfos: Array.isArray(object?.codeInfos) ? object.codeInfos.map((e: any) => CodeInfoResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryCodesResponse): unknown { const obj: any = {}; - if (message.code_infos) { - obj.code_infos = message.code_infos.map((e) => - e ? CodeInfoResponse.toJSON(e) : undefined - ); + if (message.codeInfos) { + obj.codeInfos = message.codeInfos.map((e) => e ? CodeInfoResponse.toJSON(e) : undefined); } else { - obj.code_infos = []; + obj.codeInfos = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryCodesResponse { - const message = { ...baseQueryCodesResponse } as QueryCodesResponse; - message.code_infos = []; - if (object.code_infos !== undefined && object.code_infos !== null) { - for (const e of object.code_infos) { - message.code_infos.push(CodeInfoResponse.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.codeInfos?.map((e) => CodeInfoResponse.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryPinnedCodesRequest: object = {}; +function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { + return { pagination: undefined }; +} export const QueryPinnedCodesRequest = { - encode( - message: QueryPinnedCodesRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryPinnedCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryPinnedCodesRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPinnedCodesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPinnedCodesRequest, - } as QueryPinnedCodesRequest; + const message = createBaseQueryPinnedCodesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1709,72 +1263,46 @@ export const QueryPinnedCodesRequest = { }, fromJSON(object: any): QueryPinnedCodesRequest { - const message = { - ...baseQueryPinnedCodesRequest, - } as QueryPinnedCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, toJSON(message: QueryPinnedCodesRequest): unknown { const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryPinnedCodesRequest { - const message = { - ...baseQueryPinnedCodesRequest, - } as QueryPinnedCodesRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryPinnedCodesRequest { + const message = createBaseQueryPinnedCodesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryPinnedCodesResponse: object = { code_ids: 0 }; +function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { + return { codeIds: [], pagination: undefined }; +} export const QueryPinnedCodesResponse = { - encode( - message: QueryPinnedCodesResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryPinnedCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { writer.uint32(10).fork(); - for (const v of message.code_ids) { + for (const v of message.codeIds) { writer.uint64(v); } writer.ldelim(); if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryPinnedCodesResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPinnedCodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryPinnedCodesResponse, - } as QueryPinnedCodesResponse; - message.code_ids = []; + const message = createBaseQueryPinnedCodesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1782,10 +1310,10 @@ export const QueryPinnedCodesResponse = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.code_ids.push(longToNumber(reader.uint64() as Long)); + message.codeIds.push(longToNumber(reader.uint64() as Long)); } } else { - message.code_ids.push(longToNumber(reader.uint64() as Long)); + message.codeIds.push(longToNumber(reader.uint64() as Long)); } break; case 2: @@ -1800,69 +1328,47 @@ export const QueryPinnedCodesResponse = { }, fromJSON(object: any): QueryPinnedCodesResponse { - const message = { - ...baseQueryPinnedCodesResponse, - } as QueryPinnedCodesResponse; - message.code_ids = []; - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(Number(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => Number(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryPinnedCodesResponse): unknown { const obj: any = {}; - if (message.code_ids) { - obj.code_ids = message.code_ids.map((e) => e); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => Math.round(e)); } else { - obj.code_ids = []; + obj.codeIds = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): QueryPinnedCodesResponse { - const message = { - ...baseQueryPinnedCodesResponse, - } as QueryPinnedCodesResponse; - message.code_ids = []; - if (object.code_ids !== undefined && object.code_ids !== null) { - for (const e of object.code_ids) { - message.code_ids.push(e); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + fromPartial, I>>(object: I): QueryPinnedCodesResponse { + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.codeIds?.map((e) => e) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1875,8 +1381,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -1884,29 +1389,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1922,42 +1426,32 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -const baseQueryContractsByCreatorRequest: object = { creator_address: "" }; +function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { + return { creatorAddress: "", pagination: undefined }; +} export const QueryContractsByCreatorRequest = { - encode( - message: QueryContractsByCreatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.creator_address !== "") { - writer.uint32(10).string(message.creator_address); + encode(message: QueryContractsByCreatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.creatorAddress !== "") { + writer.uint32(10).string(message.creatorAddress); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1965,20 +1459,15 @@ export const QueryContractsByCreatorRequest = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractsByCreatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCreatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractsByCreatorRequest, - } as QueryContractsByCreatorRequest; + const message = createBaseQueryContractsByCreatorRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creator_address = reader.string(); + message.creatorAddress = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1992,93 +1481,56 @@ export const QueryContractsByCreatorRequest = { }, fromJSON(object: any): QueryContractsByCreatorRequest { - const message = { - ...baseQueryContractsByCreatorRequest, - } as QueryContractsByCreatorRequest; - if ( - object.creator_address !== undefined && - object.creator_address !== null - ) { - message.creator_address = String(object.creator_address); - } else { - message.creator_address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + creatorAddress: isSet(object.creatorAddress) ? String(object.creatorAddress) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractsByCreatorRequest): unknown { const obj: any = {}; - message.creator_address !== undefined && - (obj.creator_address = message.creator_address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); + message.creatorAddress !== undefined && (obj.creatorAddress = message.creatorAddress); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryContractsByCreatorRequest { - const message = { - ...baseQueryContractsByCreatorRequest, - } as QueryContractsByCreatorRequest; - if ( - object.creator_address !== undefined && - object.creator_address !== null - ) { - message.creator_address = object.creator_address; - } else { - message.creator_address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryContractsByCreatorRequest(); + message.creatorAddress = object.creatorAddress ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -const baseQueryContractsByCreatorResponse: object = { contract_addresses: "" }; +function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { + return { contractAddresses: [], pagination: undefined }; +} export const QueryContractsByCreatorResponse = { - encode( - message: QueryContractsByCreatorResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.contract_addresses) { + encode(message: QueryContractsByCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.contractAddresses) { writer.uint32(10).string(v!); } if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryContractsByCreatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCreatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryContractsByCreatorResponse, - } as QueryContractsByCreatorResponse; - message.contract_addresses = []; + const message = createBaseQueryContractsByCreatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.contract_addresses.push(reader.string()); + message.contractAddresses.push(reader.string()); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -2092,60 +1544,34 @@ export const QueryContractsByCreatorResponse = { }, fromJSON(object: any): QueryContractsByCreatorResponse { - const message = { - ...baseQueryContractsByCreatorResponse, - } as QueryContractsByCreatorResponse; - message.contract_addresses = []; - if ( - object.contract_addresses !== undefined && - object.contract_addresses !== null - ) { - for (const e of object.contract_addresses) { - message.contract_addresses.push(String(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; + return { + contractAddresses: Array.isArray(object?.contractAddresses) + ? object.contractAddresses.map((e: any) => String(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; }, toJSON(message: QueryContractsByCreatorResponse): unknown { const obj: any = {}; - if (message.contract_addresses) { - obj.contract_addresses = message.contract_addresses.map((e) => e); + if (message.contractAddresses) { + obj.contractAddresses = message.contractAddresses.map((e) => e); } else { - obj.contract_addresses = []; + obj.contractAddresses = []; } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryContractsByCreatorResponse { - const message = { - ...baseQueryContractsByCreatorResponse, - } as QueryContractsByCreatorResponse; - message.contract_addresses = []; - if ( - object.contract_addresses !== undefined && - object.contract_addresses !== null - ) { - for (const e of object.contract_addresses) { - message.contract_addresses.push(e); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contractAddresses?.map((e) => e) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; @@ -2153,233 +1579,171 @@ export const QueryContractsByCreatorResponse = { /** Query provides defines the gRPC querier service */ export interface Query { /** ContractInfo gets the contract meta data */ - ContractInfo( - request: QueryContractInfoRequest - ): Promise; + ContractInfo(request: QueryContractInfoRequest): Promise; /** ContractHistory gets the contract code history */ - ContractHistory( - request: QueryContractHistoryRequest - ): Promise; + ContractHistory(request: QueryContractHistoryRequest): Promise; /** ContractsByCode lists all smart contracts for a code id */ - ContractsByCode( - request: QueryContractsByCodeRequest - ): Promise; + ContractsByCode(request: QueryContractsByCodeRequest): Promise; /** AllContractState gets all raw store data for a single contract */ - AllContractState( - request: QueryAllContractStateRequest - ): Promise; + AllContractState(request: QueryAllContractStateRequest): Promise; /** RawContractState gets single key from the raw store data of a contract */ - RawContractState( - request: QueryRawContractStateRequest - ): Promise; + RawContractState(request: QueryRawContractStateRequest): Promise; /** SmartContractState get smart query result from the contract */ - SmartContractState( - request: QuerySmartContractStateRequest - ): Promise; + SmartContractState(request: QuerySmartContractStateRequest): Promise; /** Code gets the binary code and metadata for a singe wasm code */ Code(request: QueryCodeRequest): Promise; /** Codes gets the metadata for all stored wasm codes */ Codes(request: QueryCodesRequest): Promise; /** PinnedCodes gets the pinned code ids */ - PinnedCodes( - request: QueryPinnedCodesRequest - ): Promise; + PinnedCodes(request: QueryPinnedCodesRequest): Promise; /** Params gets the module params */ Params(request: QueryParamsRequest): Promise; /** ContractsByCreator gets the contracts by creator */ - ContractsByCreator( - request: QueryContractsByCreatorRequest - ): Promise; + ContractsByCreator(request: QueryContractsByCreatorRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.ContractInfo = this.ContractInfo.bind(this); + this.ContractHistory = this.ContractHistory.bind(this); + this.ContractsByCode = this.ContractsByCode.bind(this); + this.AllContractState = this.AllContractState.bind(this); + this.RawContractState = this.RawContractState.bind(this); + this.SmartContractState = this.SmartContractState.bind(this); + this.Code = this.Code.bind(this); + this.Codes = this.Codes.bind(this); + this.PinnedCodes = this.PinnedCodes.bind(this); + this.Params = this.Params.bind(this); + this.ContractsByCreator = this.ContractsByCreator.bind(this); } - ContractInfo( - request: QueryContractInfoRequest - ): Promise { + ContractInfo(request: QueryContractInfoRequest): Promise { const data = QueryContractInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "ContractInfo", - data - ); - return promise.then((data) => - QueryContractInfoResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractInfo", data); + return promise.then((data) => QueryContractInfoResponse.decode(new _m0.Reader(data))); } - ContractHistory( - request: QueryContractHistoryRequest - ): Promise { + ContractHistory(request: QueryContractHistoryRequest): Promise { const data = QueryContractHistoryRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "ContractHistory", - data - ); - return promise.then((data) => - QueryContractHistoryResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractHistory", data); + return promise.then((data) => QueryContractHistoryResponse.decode(new _m0.Reader(data))); } - ContractsByCode( - request: QueryContractsByCodeRequest - ): Promise { + ContractsByCode(request: QueryContractsByCodeRequest): Promise { const data = QueryContractsByCodeRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "ContractsByCode", - data - ); - return promise.then((data) => - QueryContractsByCodeResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCode", data); + return promise.then((data) => QueryContractsByCodeResponse.decode(new _m0.Reader(data))); } - AllContractState( - request: QueryAllContractStateRequest - ): Promise { + AllContractState(request: QueryAllContractStateRequest): Promise { const data = QueryAllContractStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "AllContractState", - data - ); - return promise.then((data) => - QueryAllContractStateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "AllContractState", data); + return promise.then((data) => QueryAllContractStateResponse.decode(new _m0.Reader(data))); } - RawContractState( - request: QueryRawContractStateRequest - ): Promise { + RawContractState(request: QueryRawContractStateRequest): Promise { const data = QueryRawContractStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "RawContractState", - data - ); - return promise.then((data) => - QueryRawContractStateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "RawContractState", data); + return promise.then((data) => QueryRawContractStateResponse.decode(new _m0.Reader(data))); } - SmartContractState( - request: QuerySmartContractStateRequest - ): Promise { + SmartContractState(request: QuerySmartContractStateRequest): Promise { const data = QuerySmartContractStateRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "SmartContractState", - data - ); - return promise.then((data) => - QuerySmartContractStateResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "SmartContractState", data); + return promise.then((data) => QuerySmartContractStateResponse.decode(new _m0.Reader(data))); } Code(request: QueryCodeRequest): Promise { const data = QueryCodeRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Code", data); - return promise.then((data) => QueryCodeResponse.decode(new Reader(data))); + return promise.then((data) => QueryCodeResponse.decode(new _m0.Reader(data))); } Codes(request: QueryCodesRequest): Promise { const data = QueryCodesRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Codes", data); - return promise.then((data) => QueryCodesResponse.decode(new Reader(data))); + return promise.then((data) => QueryCodesResponse.decode(new _m0.Reader(data))); } - PinnedCodes( - request: QueryPinnedCodesRequest - ): Promise { + PinnedCodes(request: QueryPinnedCodesRequest): Promise { const data = QueryPinnedCodesRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "PinnedCodes", - data - ); - return promise.then((data) => - QueryPinnedCodesResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "PinnedCodes", data); + return promise.then((data) => QueryPinnedCodesResponse.decode(new _m0.Reader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } - ContractsByCreator( - request: QueryContractsByCreatorRequest - ): Promise { + ContractsByCreator(request: QueryContractsByCreatorRequest): Promise { const data = QueryContractsByCreatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Query", - "ContractsByCreator", - data - ); - return promise.then((data) => - QueryContractsByCreatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCreator", data); + return promise.then((data) => QueryContractsByCreatorResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -2387,7 +1751,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/tx.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/tx.ts index b01ff732c4..680fb084f4 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/tx.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/tx.ts @@ -1,29 +1,29 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; -import { AccessConfig } from "../../../cosmwasm/wasm/v1/types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { AccessConfig, Params } from "./types"; export const protobufPackage = "cosmwasm.wasm.v1"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { - /** Sender is the that actor that signed the messages */ + /** Sender is the actor that signed the messages */ sender: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: Uint8Array; + wasmByteCode: Uint8Array; /** * InstantiatePermission access control to apply on contract creation, * optional */ - instantiate_permission: AccessConfig | undefined; + instantiatePermission: AccessConfig | undefined; } /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponse { /** CodeID is the reference to the stored WASM code */ - code_id: number; + codeId: number; /** Checksum is the sha256 hash of the stored code */ checksum: Uint8Array; } @@ -38,7 +38,7 @@ export interface MsgInstantiateContract { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - code_id: number; + codeId: number; /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ @@ -47,6 +47,14 @@ export interface MsgInstantiateContract { funds: Coin[]; } +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} + /** * MsgInstantiateContract2 create a new smart contract instance for the given * code id with a predicable address. @@ -57,7 +65,7 @@ export interface MsgInstantiateContract2 { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - code_id: number; + codeId: number; /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ @@ -70,15 +78,7 @@ export interface MsgInstantiateContract2 { * FixMsg include the msg value into the hash for the predictable address. * Default is false */ - fix_msg: boolean; -} - -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; + fixMsg: boolean; } /** MsgInstantiateContract2Response return instantiation result data */ @@ -114,7 +114,7 @@ export interface MsgMigrateContract { /** Contract is the address of the smart contract */ contract: string; /** CodeID references the new WASM code */ - code_id: number; + codeId: number; /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } @@ -133,48 +133,297 @@ export interface MsgUpdateAdmin { /** Sender is the that actor that signed the messages */ sender: string; /** NewAdmin address to be set */ - new_admin: string; + newAdmin: string; /** Contract is the address of the smart contract */ contract: string; } /** MsgUpdateAdminResponse returns empty data */ -export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponse { +} /** MsgClearAdmin removes any admin stored for a smart contract */ export interface MsgClearAdmin { - /** Sender is the that actor that signed the messages */ + /** Sender is the actor that signed the messages */ sender: string; /** Contract is the address of the smart contract */ contract: string; } /** MsgClearAdminResponse returns empty data */ -export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponse { +} + +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfig { + /** Sender is the that actor that signed the messages */ + sender: string; + /** CodeID references the stored WASM code */ + codeId: number; + /** NewInstantiatePermission is the new access control */ + newInstantiatePermission: AccessConfig | undefined; +} + +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponse { +} + +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParams { + /** Authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponse { +} + +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContract { + /** Authority is the address of the governance account. */ + authority: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} + +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} + +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the new WASM codes */ + codeIds: number[]; +} + +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponse { +} + +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the WASM codes */ + codeIds: number[]; +} + +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponse { +} + +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission: + | AccessConfig + | undefined; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} + +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} + +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} + +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponse { +} + +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} + +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponse { +} + +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission: + | AccessConfig + | undefined; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} + +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: number; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} + +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabel { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewLabel string to be set */ + newLabel: string; + /** Contract is the address of the smart contract */ + contract: string; +} -const baseMsgStoreCode: object = { sender: "" }; +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponse { +} + +function createBaseMsgStoreCode(): MsgStoreCode { + return { sender: "", wasmByteCode: new Uint8Array(), instantiatePermission: undefined }; +} export const MsgStoreCode = { - encode(message: MsgStoreCode, writer: Writer = Writer.create()): Writer { + encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.wasm_byte_code.length !== 0) { - writer.uint32(18).bytes(message.wasm_byte_code); + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); } - if (message.instantiate_permission !== undefined) { - AccessConfig.encode( - message.instantiate_permission, - writer.uint32(42).fork() - ).ldelim(); + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCode } as MsgStoreCode; + const message = createBaseMsgStoreCode(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -182,13 +431,10 @@ export const MsgStoreCode = { message.sender = reader.string(); break; case 2: - message.wasm_byte_code = reader.bytes(); + message.wasmByteCode = reader.bytes(); break; case 5: - message.instantiate_permission = AccessConfig.decode( - reader, - reader.uint32() - ); + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -199,79 +445,48 @@ export const MsgStoreCode = { }, fromJSON(object: any): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = bytesFromBase64(object.wasm_byte_code); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromJSON( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + }; }, toJSON(message: MsgStoreCode): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.wasm_byte_code !== undefined && - (obj.wasm_byte_code = base64FromBytes( - message.wasm_byte_code !== undefined - ? message.wasm_byte_code - : new Uint8Array() + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), )); - message.instantiate_permission !== undefined && - (obj.instantiate_permission = message.instantiate_permission - ? AccessConfig.toJSON(message.instantiate_permission) - : undefined); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = object.wasm_byte_code; - } else { - message.wasm_byte_code = new Uint8Array(); - } - if ( - object.instantiate_permission !== undefined && - object.instantiate_permission !== null - ) { - message.instantiate_permission = AccessConfig.fromPartial( - object.instantiate_permission - ); - } else { - message.instantiate_permission = undefined; - } + fromPartial, I>>(object: I): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; return message; }, }; -const baseMsgStoreCodeResponse: object = { code_id: 0 }; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { codeId: 0, checksum: new Uint8Array() }; +} export const MsgStoreCodeResponse = { - encode( - message: MsgStoreCodeResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } if (message.checksum.length !== 0) { writer.uint32(18).bytes(message.checksum); @@ -279,15 +494,15 @@ export const MsgStoreCodeResponse = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; + const message = createBaseMsgStoreCodeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 2: message.checksum = reader.bytes(); @@ -301,64 +516,42 @@ export const MsgStoreCodeResponse = { }, fromJSON(object: any): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.checksum !== undefined && object.checksum !== null) { - message.checksum = bytesFromBase64(object.checksum); - } - return message; + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + }; }, toJSON(message: MsgStoreCodeResponse): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); - message.checksum !== undefined && - (obj.checksum = base64FromBytes( - message.checksum !== undefined ? message.checksum : new Uint8Array() - )); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.checksum !== undefined + && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.checksum !== undefined && object.checksum !== null) { - message.checksum = object.checksum; - } else { - message.checksum = new Uint8Array(); - } + fromPartial, I>>(object: I): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId ?? 0; + message.checksum = object.checksum ?? new Uint8Array(); return message; }, }; -const baseMsgInstantiateContract: object = { - sender: "", - admin: "", - code_id: 0, - label: "", -}; +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { sender: "", admin: "", codeId: 0, label: "", msg: new Uint8Array(), funds: [] }; +} export const MsgInstantiateContract = { - encode( - message: MsgInstantiateContract, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.admin !== "") { writer.uint32(18).string(message.admin); } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); } if (message.label !== "") { writer.uint32(34).string(message.label); @@ -372,11 +565,10 @@ export const MsgInstantiateContract = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgInstantiateContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.funds = []; + const message = createBaseMsgInstantiateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -387,7 +579,7 @@ export const MsgInstantiateContract = { message.admin = reader.string(); break; case 3: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 4: message.label = reader.string(); @@ -407,117 +599,128 @@ export const MsgInstantiateContract = { }, fromJSON(object: any): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: MsgInstantiateContract): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.admin !== undefined && (obj.admin = message.admin); - message.code_id !== undefined && (obj.code_id = message.code_id); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); message.label !== undefined && (obj.label = message.label); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.funds = []; } return obj; }, - fromPartial( - object: DeepPartial - ): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; + fromPartial, I>>(object: I): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId ?? 0; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { address: "", data: new Uint8Array() }; +} + +export const MsgInstantiateContractResponse = { + encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; } } return message; }, -}; -const baseMsgInstantiateContract2: object = { - sender: "", - admin: "", - code_id: 0, - label: "", - fix_msg: false, + fromJSON(object: any): MsgInstantiateContractResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: MsgInstantiateContractResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, }; +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: 0, + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false, + }; +} + export const MsgInstantiateContract2 = { - encode( - message: MsgInstantiateContract2, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgInstantiateContract2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.admin !== "") { writer.uint32(18).string(message.admin); } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); } if (message.label !== "") { writer.uint32(34).string(message.label); @@ -531,19 +734,16 @@ export const MsgInstantiateContract2 = { if (message.salt.length !== 0) { writer.uint32(58).bytes(message.salt); } - if (message.fix_msg === true) { - writer.uint32(64).bool(message.fix_msg); + if (message.fixMsg === true) { + writer.uint32(64).bool(message.fixMsg); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgInstantiateContract2 { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgInstantiateContract2, - } as MsgInstantiateContract2; - message.funds = []; + const message = createBaseMsgInstantiateContract2(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -554,7 +754,7 @@ export const MsgInstantiateContract2 = { message.admin = reader.string(); break; case 3: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 4: message.label = reader.string(); @@ -569,7 +769,7 @@ export const MsgInstantiateContract2 = { message.salt = reader.bytes(); break; case 8: - message.fix_msg = reader.bool(); + message.fixMsg = reader.bool(); break; default: reader.skipType(tag & 7); @@ -580,130 +780,57 @@ export const MsgInstantiateContract2 = { }, fromJSON(object: any): MsgInstantiateContract2 { - const message = { - ...baseMsgInstantiateContract2, - } as MsgInstantiateContract2; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - if (object.salt !== undefined && object.salt !== null) { - message.salt = bytesFromBase64(object.salt); - } - if (object.fix_msg !== undefined && object.fix_msg !== null) { - message.fix_msg = Boolean(object.fix_msg); - } else { - message.fix_msg = false; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + salt: isSet(object.salt) ? bytesFromBase64(object.salt) : new Uint8Array(), + fixMsg: isSet(object.fixMsg) ? Boolean(object.fixMsg) : false, + }; }, toJSON(message: MsgInstantiateContract2): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.admin !== undefined && (obj.admin = message.admin); - message.code_id !== undefined && (obj.code_id = message.code_id); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); message.label !== undefined && (obj.label = message.label); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.funds = []; } - message.salt !== undefined && - (obj.salt = base64FromBytes( - message.salt !== undefined ? message.salt : new Uint8Array() - )); - message.fix_msg !== undefined && (obj.fix_msg = message.fix_msg); + message.salt !== undefined + && (obj.salt = base64FromBytes(message.salt !== undefined ? message.salt : new Uint8Array())); + message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); return obj; }, - fromPartial( - object: DeepPartial - ): MsgInstantiateContract2 { - const message = { - ...baseMsgInstantiateContract2, - } as MsgInstantiateContract2; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); - } - } - if (object.salt !== undefined && object.salt !== null) { - message.salt = object.salt; - } else { - message.salt = new Uint8Array(); - } - if (object.fix_msg !== undefined && object.fix_msg !== null) { - message.fix_msg = object.fix_msg; - } else { - message.fix_msg = false; - } + fromPartial, I>>(object: I): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId ?? 0; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; return message; }, }; -const baseMsgInstantiateContractResponse: object = { address: "" }; +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { address: "", data: new Uint8Array() }; +} -export const MsgInstantiateContractResponse = { - encode( - message: MsgInstantiateContractResponse, - writer: Writer = Writer.create() - ): Writer { +export const MsgInstantiateContract2Response = { + encode(message: MsgInstantiateContract2Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -713,15 +840,10 @@ export const MsgInstantiateContractResponse = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgInstantiateContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; + const message = createBaseMsgInstantiateContract2Response(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -739,58 +861,1213 @@ export const MsgInstantiateContractResponse = { return message; }, - fromJSON(object: any): MsgInstantiateContractResponse { - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); + fromJSON(object: any): MsgInstantiateContract2Response { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: MsgInstantiateContract2Response): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { sender: "", contract: "", msg: new Uint8Array(), funds: [] }; +} + +export const MsgExecuteContract = { + encode(message: MsgExecuteContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteContract { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: MsgExecuteContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { data: new Uint8Array() }; +} + +export const MsgExecuteContractResponse = { + encode(message: MsgExecuteContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteContractResponse { + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; + }, + + toJSON(message: MsgExecuteContractResponse): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { sender: "", contract: "", codeId: 0, msg: new Uint8Array() }; +} + +export const MsgMigrateContract = { + encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContract { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; + }, + + toJSON(message: MsgMigrateContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId ?? 0; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { data: new Uint8Array() }; +} + +export const MsgMigrateContractResponse = { + encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContractResponse { + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; + }, + + toJSON(message: MsgMigrateContractResponse): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { sender: "", newAdmin: "", contract: "" }; +} + +export const MsgUpdateAdmin = { + encode(message: MsgUpdateAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + }; + }, + + toJSON(message: MsgUpdateAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, +}; + +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} + +export const MsgUpdateAdminResponse = { + encode(_: MsgUpdateAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateAdminResponse { + return {}; + }, + + toJSON(_: MsgUpdateAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, +}; + +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { sender: "", contract: "" }; +} + +export const MsgClearAdmin = { + encode(message: MsgClearAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgClearAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + }; + }, + + toJSON(message: MsgClearAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial, I>>(object: I): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + return message; + }, +}; + +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} + +export const MsgClearAdminResponse = { + encode(_: MsgClearAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgClearAdminResponse { + return {}; + }, + + toJSON(_: MsgClearAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, +}; + +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { sender: "", codeId: 0, newInstantiatePermission: undefined }; +} + +export const MsgUpdateInstantiateConfig = { + encode(message: MsgUpdateInstantiateConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.codeId !== 0) { + writer.uint32(16).uint64(message.codeId); + } + if (message.newInstantiatePermission !== undefined) { + AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 3: + message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateInstantiateConfig { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + newInstantiatePermission: isSet(object.newInstantiatePermission) + ? AccessConfig.fromJSON(object.newInstantiatePermission) + : undefined, + }; + }, + + toJSON(message: MsgUpdateInstantiateConfig): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.newInstantiatePermission !== undefined && (obj.newInstantiatePermission = message.newInstantiatePermission + ? AccessConfig.toJSON(message.newInstantiatePermission) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + message.sender = object.sender ?? ""; + message.codeId = object.codeId ?? 0; + message.newInstantiatePermission = + (object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null) + ? AccessConfig.fromPartial(object.newInstantiatePermission) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} + +export const MsgUpdateInstantiateConfigResponse = { + encode(_: MsgUpdateInstantiateConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateInstantiateConfigResponse { + return {}; + }, + + toJSON(_: MsgUpdateInstantiateConfigResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +function createBaseMsgSudoContract(): MsgSudoContract { + return { authority: "", contract: "", msg: new Uint8Array() }; +} + +export const MsgSudoContract = { + encode(message: MsgSudoContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSudoContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSudoContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSudoContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; + }, + + toJSON(message: MsgSudoContract): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgSudoContract { + const message = createBaseMsgSudoContract(); + message.authority = object.authority ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { data: new Uint8Array() }; +} + +export const MsgSudoContractResponse = { + encode(message: MsgSudoContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSudoContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSudoContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSudoContractResponse { + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; + }, + + toJSON(message: MsgSudoContractResponse): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgPinCodes(): MsgPinCodes { + return { authority: "", codeIds: [] }; +} + +export const MsgPinCodes = { + encode(message: MsgPinCodes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPinCodes { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgPinCodes { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => Number(e)) : [], + }; + }, + + toJSON(message: MsgPinCodes): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => Math.round(e)); } else { - message.address = ""; + obj.codeIds = []; } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); + return obj; + }, + + fromPartial, I>>(object: I): MsgPinCodes { + const message = createBaseMsgPinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} + +export const MsgPinCodesResponse = { + encode(_: MsgPinCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgPinCodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } return message; }, - toJSON(message: MsgInstantiateContractResponse): unknown { + fromJSON(_: any): MsgPinCodesResponse { + return {}; + }, + + toJSON(_: MsgPinCodesResponse): unknown { const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() + return obj; + }, + + fromPartial, I>>(_: I): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, +}; + +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { authority: "", codeIds: [] }; +} + +export const MsgUnpinCodes = { + encode(message: MsgUnpinCodes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpinCodes { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpinCodes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.codeIds.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUnpinCodes { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => Number(e)) : [], + }; + }, + + toJSON(message: MsgUnpinCodes): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => Math.round(e)); + } else { + obj.codeIds = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} + +export const MsgUnpinCodesResponse = { + encode(_: MsgUnpinCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpinCodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUnpinCodesResponse { + return {}; + }, + + toJSON(_: MsgUnpinCodesResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); + return message; + }, +}; + +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array(), + }; +} + +export const MsgStoreAndInstantiateContract = { + encode(message: MsgStoreAndInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(40).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(50).string(message.admin); + } + if (message.label !== "") { + writer.uint32(58).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(66).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(82).string(message.source); + } + if (message.builder !== "") { + writer.uint32(90).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(98).bytes(message.codeHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreAndInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 3: + message.wasmByteCode = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 5: + message.unpinCode = reader.bool(); + break; + case 6: + message.admin = reader.string(); + break; + case 7: + message.label = reader.string(); + break; + case 8: + message.msg = reader.bytes(); + break; + case 9: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 10: + message.source = reader.string(); + break; + case 11: + message.builder = reader.string(); + break; + case 12: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgStoreAndInstantiateContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + }; + }, + + toJSON(message: MsgStoreAndInstantiateContract): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), )); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined + && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): MsgInstantiateContractResponse { - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>( + object: I, + ): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); return message; }, }; -const baseMsgInstantiateContract2Response: object = { address: "" }; +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { + return { address: "", data: new Uint8Array() }; +} -export const MsgInstantiateContract2Response = { - encode( - message: MsgInstantiateContract2Response, - writer: Writer = Writer.create() - ): Writer { +export const MsgStoreAndInstantiateContractResponse = { + encode(message: MsgStoreAndInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -800,15 +2077,10 @@ export const MsgInstantiateContract2Response = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgInstantiateContract2Response { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgInstantiateContract2Response, - } as MsgInstantiateContract2Response; + const message = createBaseMsgStoreAndInstantiateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -826,92 +2098,58 @@ export const MsgInstantiateContract2Response = { return message; }, - fromJSON(object: any): MsgInstantiateContract2Response { - const message = { - ...baseMsgInstantiateContract2Response, - } as MsgInstantiateContract2Response; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + fromJSON(object: any): MsgStoreAndInstantiateContractResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, - toJSON(message: MsgInstantiateContract2Response): unknown { + toJSON(message: MsgStoreAndInstantiateContractResponse): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): MsgInstantiateContract2Response { - const message = { - ...baseMsgInstantiateContract2Response, - } as MsgInstantiateContract2Response; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>( + object: I, + ): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseMsgExecuteContract: object = { sender: "", contract: "" }; +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { + return { authority: "", addresses: [] }; +} -export const MsgExecuteContract = { - encode( - message: MsgExecuteContract, - writer: Writer = Writer.create() - ): Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); - } - if (message.msg.length !== 0) { - writer.uint32(26).bytes(message.msg); +export const MsgAddCodeUploadParamsAddresses = { + encode(message: MsgAddCodeUploadParamsAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgExecuteContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddresses { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.funds = []; + const message = createBaseMsgAddCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.msg = reader.bytes(); - break; - case 5: - message.funds.push(Coin.decode(reader, reader.uint32())); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -921,101 +2159,50 @@ export const MsgExecuteContract = { return message; }, - fromJSON(object: any): MsgExecuteContract { - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromJSON(e)); - } - } - return message; + fromJSON(object: any): MsgAddCodeUploadParamsAddresses { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [], + }; }, - toJSON(message: MsgExecuteContract): unknown { + toJSON(message: MsgAddCodeUploadParamsAddresses): unknown { const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.contract !== undefined && (obj.contract = message.contract); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - if (message.funds) { - obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + message.authority !== undefined && (obj.authority = message.authority); + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e); } else { - obj.funds = []; + obj.addresses = []; } return obj; }, - fromPartial(object: DeepPartial): MsgExecuteContract { - const message = { ...baseMsgExecuteContract } as MsgExecuteContract; - message.funds = []; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.funds !== undefined && object.funds !== null) { - for (const e of object.funds) { - message.funds.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>( + object: I, + ): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map((e) => e) || []; return message; }, }; -const baseMsgExecuteContractResponse: object = {}; +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; +} -export const MsgExecuteContractResponse = { - encode( - message: MsgExecuteContractResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgAddCodeUploadParamsAddressesResponse = { + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgExecuteContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddressesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgExecuteContractResponse, - } as MsgExecuteContractResponse; + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1024,80 +2211,50 @@ export const MsgExecuteContractResponse = { return message; }, - fromJSON(object: any): MsgExecuteContractResponse { - const message = { - ...baseMsgExecuteContractResponse, - } as MsgExecuteContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + fromJSON(_: any): MsgAddCodeUploadParamsAddressesResponse { + return {}; }, - toJSON(message: MsgExecuteContractResponse): unknown { + toJSON(_: MsgAddCodeUploadParamsAddressesResponse): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); return obj; }, - fromPartial( - object: DeepPartial - ): MsgExecuteContractResponse { - const message = { - ...baseMsgExecuteContractResponse, - } as MsgExecuteContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>( + _: I, + ): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); return message; }, }; -const baseMsgMigrateContract: object = { sender: "", contract: "", code_id: 0 }; +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { + return { authority: "", addresses: [] }; +} -export const MsgMigrateContract = { - encode( - message: MsgMigrateContract, - writer: Writer = Writer.create() - ): Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); +export const MsgRemoveCodeUploadParamsAddresses = { + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); - } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgMigrateContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddresses { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 4: - message.msg = reader.bytes(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1107,95 +2264,50 @@ export const MsgMigrateContract = { return message; }, - fromJSON(object: any): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - return message; + fromJSON(object: any): MsgRemoveCodeUploadParamsAddresses { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [], + }; }, - toJSON(message: MsgMigrateContract): unknown { + toJSON(message: MsgRemoveCodeUploadParamsAddresses): unknown { const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.contract !== undefined && (obj.contract = message.contract); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); + message.authority !== undefined && (obj.authority = message.authority); + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e); + } else { + obj.addresses = []; + } return obj; }, - fromPartial(object: DeepPartial): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } + fromPartial, I>>( + object: I, + ): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map((e) => e) || []; return message; }, }; -const baseMsgMigrateContractResponse: object = {}; +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; +} -export const MsgMigrateContractResponse = { - encode( - message: MsgMigrateContractResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgRemoveCodeUploadParamsAddressesResponse = { + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgMigrateContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddressesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1204,72 +2316,75 @@ export const MsgMigrateContractResponse = { return message; }, - fromJSON(object: any): MsgMigrateContractResponse { - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; + fromJSON(_: any): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; }, - toJSON(message: MsgMigrateContractResponse): unknown { + toJSON(_: MsgRemoveCodeUploadParamsAddressesResponse): unknown { const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); return obj; }, - fromPartial( - object: DeepPartial - ): MsgMigrateContractResponse { - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } + fromPartial, I>>( + _: I, + ): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); return message; }, }; -const baseMsgUpdateAdmin: object = { sender: "", new_admin: "", contract: "" }; +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array(), + }; +} -export const MsgUpdateAdmin = { - encode(message: MsgUpdateAdmin, writer: Writer = Writer.create()): Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndMigrateContract = { + encode(message: MsgStoreAndMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.new_admin !== "") { - writer.uint32(18).string(message.new_admin); + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(26).fork()).ldelim(); } if (message.contract !== "") { - writer.uint32(26).string(message.contract); + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUpdateAdmin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndMigrateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; + const message = createBaseMsgStoreAndMigrateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.new_admin = reader.string(); + message.wasmByteCode = reader.bytes(); break; case 3: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 4: message.contract = reader.string(); break; + case 5: + message.msg = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1278,69 +2393,82 @@ export const MsgUpdateAdmin = { return message; }, - fromJSON(object: any): MsgUpdateAdmin { - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = String(object.new_admin); - } else { - message.new_admin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; + fromJSON(object: any): MsgStoreAndMigrateContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) + ? AccessConfig.fromJSON(object.instantiatePermission) + : undefined, + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; }, - toJSON(message: MsgUpdateAdmin): unknown { + toJSON(message: MsgStoreAndMigrateContract): unknown { const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.new_admin !== undefined && (obj.new_admin = message.new_admin); + message.authority !== undefined && (obj.authority = message.authority); + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): MsgUpdateAdmin { - const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = object.new_admin; - } else { - message.new_admin = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } + fromPartial, I>>(object: I): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = + (object.instantiatePermission !== undefined && object.instantiatePermission !== null) + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); return message; }, }; -const baseMsgUpdateAdminResponse: object = {}; +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { codeId: 0, checksum: new Uint8Array(), data: new Uint8Array() }; +} -export const MsgUpdateAdminResponse = { - encode(_: MsgUpdateAdminResponse, writer: Writer = Writer.create()): Writer { +export const MsgStoreAndMigrateContractResponse = { + encode(message: MsgStoreAndMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgUpdateAdminResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndMigrateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; + const message = createBaseMsgStoreAndMigrateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1349,45 +2477,66 @@ export const MsgUpdateAdminResponse = { return message; }, - fromJSON(_: any): MsgUpdateAdminResponse { - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; - return message; + fromJSON(object: any): MsgStoreAndMigrateContractResponse { + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; }, - toJSON(_: MsgUpdateAdminResponse): unknown { + toJSON(message: MsgStoreAndMigrateContractResponse): unknown { const obj: any = {}; + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.checksum !== undefined + && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial(_: DeepPartial): MsgUpdateAdminResponse { - const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; + fromPartial, I>>( + object: I, + ): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + message.codeId = object.codeId ?? 0; + message.checksum = object.checksum ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, }; -const baseMsgClearAdmin: object = { sender: "", contract: "" }; +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { + return { sender: "", newLabel: "", contract: "" }; +} -export const MsgClearAdmin = { - encode(message: MsgClearAdmin, writer: Writer = Writer.create()): Writer { +export const MsgUpdateContractLabel = { + encode(message: MsgUpdateContractLabel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } + if (message.newLabel !== "") { + writer.uint32(18).string(message.newLabel); + } if (message.contract !== "") { writer.uint32(26).string(message.contract); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgClearAdmin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateContractLabel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; + const message = createBaseMsgUpdateContractLabel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sender = reader.string(); break; + case 2: + message.newLabel = reader.string(); + break; case 3: message.contract = reader.string(); break; @@ -1399,55 +2548,44 @@ export const MsgClearAdmin = { return message; }, - fromJSON(object: any): MsgClearAdmin { - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - return message; + fromJSON(object: any): MsgUpdateContractLabel { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + newLabel: isSet(object.newLabel) ? String(object.newLabel) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + }; }, - toJSON(message: MsgClearAdmin): unknown { + toJSON(message: MsgUpdateContractLabel): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); + message.newLabel !== undefined && (obj.newLabel = message.newLabel); message.contract !== undefined && (obj.contract = message.contract); return obj; }, - fromPartial(object: DeepPartial): MsgClearAdmin { - const message = { ...baseMsgClearAdmin } as MsgClearAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } + fromPartial, I>>(object: I): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); + message.sender = object.sender ?? ""; + message.newLabel = object.newLabel ?? ""; + message.contract = object.contract ?? ""; return message; }, }; -const baseMsgClearAdminResponse: object = {}; +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { + return {}; +} -export const MsgClearAdminResponse = { - encode(_: MsgClearAdminResponse, writer: Writer = Writer.create()): Writer { +export const MsgUpdateContractLabelResponse = { + encode(_: MsgUpdateContractLabelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgClearAdminResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateContractLabelResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; + const message = createBaseMsgUpdateContractLabelResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1459,18 +2597,17 @@ export const MsgClearAdminResponse = { return message; }, - fromJSON(_: any): MsgClearAdminResponse { - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; - return message; + fromJSON(_: any): MsgUpdateContractLabelResponse { + return {}; }, - toJSON(_: MsgClearAdminResponse): unknown { + toJSON(_: MsgUpdateContractLabelResponse): unknown { const obj: any = {}; return obj; }, - fromPartial(_: DeepPartial): MsgClearAdminResponse { - const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; + fromPartial, I>>(_: I): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); return message; }, }; @@ -1483,176 +2620,278 @@ export interface Msg { * InstantiateContract creates a new smart contract instance for the given * code id. */ - InstantiateContract( - request: MsgInstantiateContract - ): Promise; + InstantiateContract(request: MsgInstantiateContract): Promise; /** * InstantiateContract2 creates a new smart contract instance for the given * code id with a predictable address */ - InstantiateContract2( - request: MsgInstantiateContract2 - ): Promise; + InstantiateContract2(request: MsgInstantiateContract2): Promise; /** Execute submits the given message data to a smart contract */ - ExecuteContract( - request: MsgExecuteContract - ): Promise; + ExecuteContract(request: MsgExecuteContract): Promise; /** Migrate runs a code upgrade/ downgrade for a smart contract */ - MigrateContract( - request: MsgMigrateContract - ): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ + MigrateContract(request: MsgMigrateContract): Promise; + /** UpdateAdmin sets a new admin for a smart contract */ UpdateAdmin(request: MsgUpdateAdmin): Promise; /** ClearAdmin removes any admin stored for a smart contract */ ClearAdmin(request: MsgClearAdmin): Promise; + /** UpdateInstantiateConfig updates instantiate config for a smart contract */ + UpdateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise; + /** + * UpdateParams defines a governance operation for updating the x/wasm + * module parameters. The authority is defined in the keeper. + * + * Since: 0.40 + */ + UpdateParams(request: MsgUpdateParams): Promise; + /** + * SudoContract defines a governance operation for calling sudo + * on a contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + SudoContract(request: MsgSudoContract): Promise; + /** + * PinCodes defines a governance operation for pinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + PinCodes(request: MsgPinCodes): Promise; + /** + * UnpinCodes defines a governance operation for unpinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + UnpinCodes(request: MsgUnpinCodes): Promise; + /** + * StoreAndInstantiateContract defines a governance operation for storing + * and instantiating the contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + StoreAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise; + /** + * RemoveCodeUploadParamsAddresses defines a governance operation for + * removing addresses from code upload params. + * The authority is defined in the keeper. + */ + RemoveCodeUploadParamsAddresses( + request: MsgRemoveCodeUploadParamsAddresses, + ): Promise; + /** + * AddCodeUploadParamsAddresses defines a governance operation for + * adding addresses to code upload params. + * The authority is defined in the keeper. + */ + AddCodeUploadParamsAddresses( + request: MsgAddCodeUploadParamsAddresses, + ): Promise; + /** + * StoreAndMigrateContract defines a governance operation for storing + * and migrating the contract. The authority is defined in the keeper. + * + * Since: 0.42 + */ + StoreAndMigrateContract(request: MsgStoreAndMigrateContract): Promise; + /** + * UpdateContractLabel sets a new label for a smart contract + * + * Since: 0.43 + */ + UpdateContractLabel(request: MsgUpdateContractLabel): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.StoreCode = this.StoreCode.bind(this); + this.InstantiateContract = this.InstantiateContract.bind(this); + this.InstantiateContract2 = this.InstantiateContract2.bind(this); + this.ExecuteContract = this.ExecuteContract.bind(this); + this.MigrateContract = this.MigrateContract.bind(this); + this.UpdateAdmin = this.UpdateAdmin.bind(this); + this.ClearAdmin = this.ClearAdmin.bind(this); + this.UpdateInstantiateConfig = this.UpdateInstantiateConfig.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); + this.SudoContract = this.SudoContract.bind(this); + this.PinCodes = this.PinCodes.bind(this); + this.UnpinCodes = this.UnpinCodes.bind(this); + this.StoreAndInstantiateContract = this.StoreAndInstantiateContract.bind(this); + this.RemoveCodeUploadParamsAddresses = this.RemoveCodeUploadParamsAddresses.bind(this); + this.AddCodeUploadParamsAddresses = this.AddCodeUploadParamsAddresses.bind(this); + this.StoreAndMigrateContract = this.StoreAndMigrateContract.bind(this); + this.UpdateContractLabel = this.UpdateContractLabel.bind(this); } StoreCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreCode", data); - return promise.then((data) => - MsgStoreCodeResponse.decode(new Reader(data)) - ); + return promise.then((data) => MsgStoreCodeResponse.decode(new _m0.Reader(data))); } - InstantiateContract( - request: MsgInstantiateContract - ): Promise { + InstantiateContract(request: MsgInstantiateContract): Promise { const data = MsgInstantiateContract.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "InstantiateContract", - data - ); - return promise.then((data) => - MsgInstantiateContractResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract", data); + return promise.then((data) => MsgInstantiateContractResponse.decode(new _m0.Reader(data))); } - InstantiateContract2( - request: MsgInstantiateContract2 - ): Promise { + InstantiateContract2(request: MsgInstantiateContract2): Promise { const data = MsgInstantiateContract2.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "InstantiateContract2", - data - ); - return promise.then((data) => - MsgInstantiateContract2Response.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract2", data); + return promise.then((data) => MsgInstantiateContract2Response.decode(new _m0.Reader(data))); } - ExecuteContract( - request: MsgExecuteContract - ): Promise { + ExecuteContract(request: MsgExecuteContract): Promise { const data = MsgExecuteContract.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "ExecuteContract", - data - ); - return promise.then((data) => - MsgExecuteContractResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ExecuteContract", data); + return promise.then((data) => MsgExecuteContractResponse.decode(new _m0.Reader(data))); } - MigrateContract( - request: MsgMigrateContract - ): Promise { + MigrateContract(request: MsgMigrateContract): Promise { const data = MsgMigrateContract.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "MigrateContract", - data - ); - return promise.then((data) => - MsgMigrateContractResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "MigrateContract", data); + return promise.then((data) => MsgMigrateContractResponse.decode(new _m0.Reader(data))); } UpdateAdmin(request: MsgUpdateAdmin): Promise { const data = MsgUpdateAdmin.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "UpdateAdmin", - data - ); - return promise.then((data) => - MsgUpdateAdminResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateAdmin", data); + return promise.then((data) => MsgUpdateAdminResponse.decode(new _m0.Reader(data))); } ClearAdmin(request: MsgClearAdmin): Promise { const data = MsgClearAdmin.encode(request).finish(); - const promise = this.rpc.request( - "cosmwasm.wasm.v1.Msg", - "ClearAdmin", - data - ); - return promise.then((data) => - MsgClearAdminResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ClearAdmin", data); + return promise.then((data) => MsgClearAdminResponse.decode(new _m0.Reader(data))); + } + + UpdateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise { + const data = MsgUpdateInstantiateConfig.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); + return promise.then((data) => MsgUpdateInstantiateConfigResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } + + SudoContract(request: MsgSudoContract): Promise { + const data = MsgSudoContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); + return promise.then((data) => MsgSudoContractResponse.decode(new _m0.Reader(data))); + } + + PinCodes(request: MsgPinCodes): Promise { + const data = MsgPinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); + return promise.then((data) => MsgPinCodesResponse.decode(new _m0.Reader(data))); + } + + UnpinCodes(request: MsgUnpinCodes): Promise { + const data = MsgUnpinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); + return promise.then((data) => MsgUnpinCodesResponse.decode(new _m0.Reader(data))); + } + + StoreAndInstantiateContract( + request: MsgStoreAndInstantiateContract, + ): Promise { + const data = MsgStoreAndInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); + return promise.then((data) => MsgStoreAndInstantiateContractResponse.decode(new _m0.Reader(data))); + } + + RemoveCodeUploadParamsAddresses( + request: MsgRemoveCodeUploadParamsAddresses, + ): Promise { + const data = MsgRemoveCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "RemoveCodeUploadParamsAddresses", data); + return promise.then((data) => MsgRemoveCodeUploadParamsAddressesResponse.decode(new _m0.Reader(data))); + } + + AddCodeUploadParamsAddresses( + request: MsgAddCodeUploadParamsAddresses, + ): Promise { + const data = MsgAddCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "AddCodeUploadParamsAddresses", data); + return promise.then((data) => MsgAddCodeUploadParamsAddressesResponse.decode(new _m0.Reader(data))); + } + + StoreAndMigrateContract(request: MsgStoreAndMigrateContract): Promise { + const data = MsgStoreAndMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndMigrateContract", data); + return promise.then((data) => MsgStoreAndMigrateContractResponse.decode(new _m0.Reader(data))); + } + + UpdateContractLabel(request: MsgUpdateContractLabel): Promise { + const data = MsgUpdateContractLabel.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateContractLabel", data); + return promise.then((data) => MsgUpdateContractLabelResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1660,7 +2899,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/types.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/types.ts index 95c7f47499..e234a92724 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/types.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/cosmwasm/wasm/v1/types.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Any } from "../../../google/protobuf/any"; export const protobufPackage = "cosmwasm.wasm.v1"; @@ -12,11 +12,6 @@ export enum AccessType { ACCESS_TYPE_UNSPECIFIED = 0, /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ ACCESS_TYPE_NOBODY = 1, - /** - * ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead - */ - ACCESS_TYPE_ONLY_ADDRESS = 2, /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ ACCESS_TYPE_EVERYBODY = 3, /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ @@ -32,9 +27,6 @@ export function accessTypeFromJSON(object: any): AccessType { case 1: case "ACCESS_TYPE_NOBODY": return AccessType.ACCESS_TYPE_NOBODY; - case 2: - case "ACCESS_TYPE_ONLY_ADDRESS": - return AccessType.ACCESS_TYPE_ONLY_ADDRESS; case 3: case "ACCESS_TYPE_EVERYBODY": return AccessType.ACCESS_TYPE_EVERYBODY; @@ -54,14 +46,13 @@ export function accessTypeToJSON(object: AccessType): string { return "ACCESS_TYPE_UNSPECIFIED"; case AccessType.ACCESS_TYPE_NOBODY: return "ACCESS_TYPE_NOBODY"; - case AccessType.ACCESS_TYPE_ONLY_ADDRESS: - return "ACCESS_TYPE_ONLY_ADDRESS"; case AccessType.ACCESS_TYPE_EVERYBODY: return "ACCESS_TYPE_EVERYBODY"; case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + case AccessType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -78,9 +69,7 @@ export enum ContractCodeHistoryOperationType { UNRECOGNIZED = -1, } -export function contractCodeHistoryOperationTypeFromJSON( - object: any -): ContractCodeHistoryOperationType { +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { switch (object) { case 0: case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": @@ -101,9 +90,7 @@ export function contractCodeHistoryOperationTypeFromJSON( } } -export function contractCodeHistoryOperationTypeToJSON( - object: ContractCodeHistoryOperationType -): string { +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { switch (object) { case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; @@ -113,8 +100,9 @@ export function contractCodeHistoryOperationTypeToJSON( return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + case ContractCodeHistoryOperationType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -126,34 +114,29 @@ export interface AccessTypeParam { /** AccessConfig access control type. */ export interface AccessConfig { permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; addresses: string[]; } /** Params defines the set of wasm parameters. */ export interface Params { - code_upload_access: AccessConfig | undefined; - instantiate_default_permission: AccessType; + codeUploadAccess: AccessConfig | undefined; + instantiateDefaultPermission: AccessType; } /** CodeInfo is data for the uploaded contract WASM code */ export interface CodeInfo { /** CodeHash is the unique identifier created by wasmvm */ - code_hash: Uint8Array; + codeHash: Uint8Array; /** Creator address who initially stored the code */ creator: string; /** InstantiateConfig access control to apply on contract creation, optional */ - instantiate_config: AccessConfig | undefined; + instantiateConfig: AccessConfig | undefined; } /** ContractInfo stores a WASM contract instance */ export interface ContractInfo { /** CodeID is the reference to the stored Wasm code */ - code_id: number; + codeId: number; /** Creator address who initially instantiated the contract */ creator: string; /** Admin is an optional address that can execute migrations */ @@ -162,7 +145,7 @@ export interface ContractInfo { label: string; /** Created Tx position when the contract was instantiated. */ created: AbsoluteTxPosition | undefined; - ibc_port_id: string; + ibcPortId: string; /** * Extension is an extension point to store custom metadata within the * persistence model. @@ -174,7 +157,7 @@ export interface ContractInfo { export interface ContractCodeHistoryEntry { operation: ContractCodeHistoryOperationType; /** CodeID is the reference to the stored WASM code */ - code_id: number; + codeId: number; /** Updated Tx position when the operation was executed. */ updated: AbsoluteTxPosition | undefined; msg: Uint8Array; @@ -186,12 +169,12 @@ export interface ContractCodeHistoryEntry { */ export interface AbsoluteTxPosition { /** BlockHeight is the block the contract was created at */ - block_height: number; + blockHeight: number; /** * TxIndex is a monotonic counter within the block (actual transaction index, * or gas consumed) */ - tx_index: number; + txIndex: number; } /** Model is a struct that holds a KV pair */ @@ -202,20 +185,22 @@ export interface Model { value: Uint8Array; } -const baseAccessTypeParam: object = { value: 0 }; +function createBaseAccessTypeParam(): AccessTypeParam { + return { value: 0 }; +} export const AccessTypeParam = { - encode(message: AccessTypeParam, writer: Writer = Writer.create()): Writer { + encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.value !== 0) { writer.uint32(8).int32(message.value); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AccessTypeParam { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAccessTypeParam } as AccessTypeParam; + const message = createBaseAccessTypeParam(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -231,63 +216,47 @@ export const AccessTypeParam = { }, fromJSON(object: any): AccessTypeParam { - const message = { ...baseAccessTypeParam } as AccessTypeParam; - if (object.value !== undefined && object.value !== null) { - message.value = accessTypeFromJSON(object.value); - } else { - message.value = 0; - } - return message; + return { value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 }; }, toJSON(message: AccessTypeParam): unknown { const obj: any = {}; - message.value !== undefined && - (obj.value = accessTypeToJSON(message.value)); + message.value !== undefined && (obj.value = accessTypeToJSON(message.value)); return obj; }, - fromPartial(object: DeepPartial): AccessTypeParam { - const message = { ...baseAccessTypeParam } as AccessTypeParam; - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = 0; - } + fromPartial, I>>(object: I): AccessTypeParam { + const message = createBaseAccessTypeParam(); + message.value = object.value ?? 0; return message; }, }; -const baseAccessConfig: object = { permission: 0, address: "", addresses: "" }; +function createBaseAccessConfig(): AccessConfig { + return { permission: 0, addresses: [] }; +} export const AccessConfig = { - encode(message: AccessConfig, writer: Writer = Writer.create()): Writer { + encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.permission !== 0) { writer.uint32(8).int32(message.permission); } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } for (const v of message.addresses) { writer.uint32(26).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AccessConfig { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAccessConfig } as AccessConfig; - message.addresses = []; + const message = createBaseAccessConfig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.permission = reader.int32() as any; break; - case 2: - message.address = reader.string(); - break; case 3: message.addresses.push(reader.string()); break; @@ -300,31 +269,15 @@ export const AccessConfig = { }, fromJSON(object: any): AccessConfig { - const message = { ...baseAccessConfig } as AccessConfig; - message.addresses = []; - if (object.permission !== undefined && object.permission !== null) { - message.permission = accessTypeFromJSON(object.permission); - } else { - message.permission = 0; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(String(e)); - } - } - return message; + return { + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [], + }; }, toJSON(message: AccessConfig): unknown { const obj: any = {}; - message.permission !== undefined && - (obj.permission = accessTypeToJSON(message.permission)); - message.address !== undefined && (obj.address = message.address); + message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission)); if (message.addresses) { obj.addresses = message.addresses.map((e) => e); } else { @@ -333,59 +286,41 @@ export const AccessConfig = { return obj; }, - fromPartial(object: DeepPartial): AccessConfig { - const message = { ...baseAccessConfig } as AccessConfig; - message.addresses = []; - if (object.permission !== undefined && object.permission !== null) { - message.permission = object.permission; - } else { - message.permission = 0; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.addresses !== undefined && object.addresses !== null) { - for (const e of object.addresses) { - message.addresses.push(e); - } - } + fromPartial, I>>(object: I): AccessConfig { + const message = createBaseAccessConfig(); + message.permission = object.permission ?? 0; + message.addresses = object.addresses?.map((e) => e) || []; return message; }, }; -const baseParams: object = { instantiate_default_permission: 0 }; +function createBaseParams(): Params { + return { codeUploadAccess: undefined, instantiateDefaultPermission: 0 }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.code_upload_access !== undefined) { - AccessConfig.encode( - message.code_upload_access, - writer.uint32(10).fork() - ).ldelim(); + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeUploadAccess !== undefined) { + AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); } - if (message.instantiate_default_permission !== 0) { - writer.uint32(16).int32(message.instantiate_default_permission); + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_upload_access = AccessConfig.decode( - reader, - reader.uint32() - ); + message.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); break; case 2: - message.instantiate_default_permission = reader.int32() as any; + message.instantiateDefaultPermission = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -396,105 +331,66 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - if ( - object.code_upload_access !== undefined && - object.code_upload_access !== null - ) { - message.code_upload_access = AccessConfig.fromJSON( - object.code_upload_access - ); - } else { - message.code_upload_access = undefined; - } - if ( - object.instantiate_default_permission !== undefined && - object.instantiate_default_permission !== null - ) { - message.instantiate_default_permission = accessTypeFromJSON( - object.instantiate_default_permission - ); - } else { - message.instantiate_default_permission = 0; - } - return message; + return { + codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) + ? accessTypeFromJSON(object.instantiateDefaultPermission) + : 0, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - message.code_upload_access !== undefined && - (obj.code_upload_access = message.code_upload_access - ? AccessConfig.toJSON(message.code_upload_access) - : undefined); - message.instantiate_default_permission !== undefined && - (obj.instantiate_default_permission = accessTypeToJSON( - message.instantiate_default_permission - )); + message.codeUploadAccess !== undefined + && (obj.codeUploadAccess = message.codeUploadAccess ? AccessConfig.toJSON(message.codeUploadAccess) : undefined); + message.instantiateDefaultPermission !== undefined + && (obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission)); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - if ( - object.code_upload_access !== undefined && - object.code_upload_access !== null - ) { - message.code_upload_access = AccessConfig.fromPartial( - object.code_upload_access - ); - } else { - message.code_upload_access = undefined; - } - if ( - object.instantiate_default_permission !== undefined && - object.instantiate_default_permission !== null - ) { - message.instantiate_default_permission = - object.instantiate_default_permission; - } else { - message.instantiate_default_permission = 0; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.codeUploadAccess = (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) + ? AccessConfig.fromPartial(object.codeUploadAccess) + : undefined; + message.instantiateDefaultPermission = object.instantiateDefaultPermission ?? 0; return message; }, }; -const baseCodeInfo: object = { creator: "" }; +function createBaseCodeInfo(): CodeInfo { + return { codeHash: new Uint8Array(), creator: "", instantiateConfig: undefined }; +} export const CodeInfo = { - encode(message: CodeInfo, writer: Writer = Writer.create()): Writer { - if (message.code_hash.length !== 0) { - writer.uint32(10).bytes(message.code_hash); + encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); } if (message.creator !== "") { writer.uint32(18).string(message.creator); } - if (message.instantiate_config !== undefined) { - AccessConfig.encode( - message.instantiate_config, - writer.uint32(42).fork() - ).ldelim(); + if (message.instantiateConfig !== undefined) { + AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): CodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCodeInfo } as CodeInfo; + const message = createBaseCodeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_hash = reader.bytes(); + message.codeHash = reader.bytes(); break; case 2: message.creator = reader.string(); break; case 5: - message.instantiate_config = AccessConfig.decode( - reader, - reader.uint32() - ); + message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -505,80 +401,44 @@ export const CodeInfo = { }, fromJSON(object: any): CodeInfo { - const message = { ...baseCodeInfo } as CodeInfo; - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = bytesFromBase64(object.code_hash); - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if ( - object.instantiate_config !== undefined && - object.instantiate_config !== null - ) { - message.instantiate_config = AccessConfig.fromJSON( - object.instantiate_config - ); - } else { - message.instantiate_config = undefined; - } - return message; + return { + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + creator: isSet(object.creator) ? String(object.creator) : "", + instantiateConfig: isSet(object.instantiateConfig) ? AccessConfig.fromJSON(object.instantiateConfig) : undefined, + }; }, toJSON(message: CodeInfo): unknown { const obj: any = {}; - message.code_hash !== undefined && - (obj.code_hash = base64FromBytes( - message.code_hash !== undefined ? message.code_hash : new Uint8Array() - )); + message.codeHash !== undefined + && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); message.creator !== undefined && (obj.creator = message.creator); - message.instantiate_config !== undefined && - (obj.instantiate_config = message.instantiate_config - ? AccessConfig.toJSON(message.instantiate_config) + message.instantiateConfig !== undefined + && (obj.instantiateConfig = message.instantiateConfig + ? AccessConfig.toJSON(message.instantiateConfig) : undefined); return obj; }, - fromPartial(object: DeepPartial): CodeInfo { - const message = { ...baseCodeInfo } as CodeInfo; - if (object.code_hash !== undefined && object.code_hash !== null) { - message.code_hash = object.code_hash; - } else { - message.code_hash = new Uint8Array(); - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if ( - object.instantiate_config !== undefined && - object.instantiate_config !== null - ) { - message.instantiate_config = AccessConfig.fromPartial( - object.instantiate_config - ); - } else { - message.instantiate_config = undefined; - } + fromPartial, I>>(object: I): CodeInfo { + const message = createBaseCodeInfo(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.creator = object.creator ?? ""; + message.instantiateConfig = (object.instantiateConfig !== undefined && object.instantiateConfig !== null) + ? AccessConfig.fromPartial(object.instantiateConfig) + : undefined; return message; }, }; -const baseContractInfo: object = { - code_id: 0, - creator: "", - admin: "", - label: "", - ibc_port_id: "", -}; +function createBaseContractInfo(): ContractInfo { + return { codeId: 0, creator: "", admin: "", label: "", created: undefined, ibcPortId: "", extension: undefined }; +} export const ContractInfo = { - encode(message: ContractInfo, writer: Writer = Writer.create()): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); + encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); } if (message.creator !== "") { writer.uint32(18).string(message.creator); @@ -590,13 +450,10 @@ export const ContractInfo = { writer.uint32(34).string(message.label); } if (message.created !== undefined) { - AbsoluteTxPosition.encode( - message.created, - writer.uint32(42).fork() - ).ldelim(); + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); } - if (message.ibc_port_id !== "") { - writer.uint32(50).string(message.ibc_port_id); + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); } if (message.extension !== undefined) { Any.encode(message.extension, writer.uint32(58).fork()).ldelim(); @@ -604,15 +461,15 @@ export const ContractInfo = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ContractInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseContractInfo } as ContractInfo; + const message = createBaseContractInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 2: message.creator = reader.string(); @@ -627,7 +484,7 @@ export const ContractInfo = { message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); break; case 6: - message.ibc_port_id = reader.string(); + message.ibcPortId = reader.string(); break; case 7: message.extension = Any.decode(reader, reader.uint32()); @@ -641,123 +498,61 @@ export const ContractInfo = { }, fromJSON(object: any): ContractInfo { - const message = { ...baseContractInfo } as ContractInfo; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.created !== undefined && object.created !== null) { - message.created = AbsoluteTxPosition.fromJSON(object.created); - } else { - message.created = undefined; - } - if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { - message.ibc_port_id = String(object.ibc_port_id); - } else { - message.ibc_port_id = ""; - } - if (object.extension !== undefined && object.extension !== null) { - message.extension = Any.fromJSON(object.extension); - } else { - message.extension = undefined; - } - return message; + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + creator: isSet(object.creator) ? String(object.creator) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + created: isSet(object.created) ? AbsoluteTxPosition.fromJSON(object.created) : undefined, + ibcPortId: isSet(object.ibcPortId) ? String(object.ibcPortId) : "", + extension: isSet(object.extension) ? Any.fromJSON(object.extension) : undefined, + }; }, toJSON(message: ContractInfo): unknown { const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); message.creator !== undefined && (obj.creator = message.creator); message.admin !== undefined && (obj.admin = message.admin); message.label !== undefined && (obj.label = message.label); - message.created !== undefined && - (obj.created = message.created - ? AbsoluteTxPosition.toJSON(message.created) - : undefined); - message.ibc_port_id !== undefined && - (obj.ibc_port_id = message.ibc_port_id); - message.extension !== undefined && - (obj.extension = message.extension - ? Any.toJSON(message.extension) - : undefined); + message.created !== undefined + && (obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined); + message.ibcPortId !== undefined && (obj.ibcPortId = message.ibcPortId); + message.extension !== undefined && (obj.extension = message.extension ? Any.toJSON(message.extension) : undefined); return obj; }, - fromPartial(object: DeepPartial): ContractInfo { - const message = { ...baseContractInfo } as ContractInfo; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.created !== undefined && object.created !== null) { - message.created = AbsoluteTxPosition.fromPartial(object.created); - } else { - message.created = undefined; - } - if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { - message.ibc_port_id = object.ibc_port_id; - } else { - message.ibc_port_id = ""; - } - if (object.extension !== undefined && object.extension !== null) { - message.extension = Any.fromPartial(object.extension); - } else { - message.extension = undefined; - } + fromPartial, I>>(object: I): ContractInfo { + const message = createBaseContractInfo(); + message.codeId = object.codeId ?? 0; + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.created = (object.created !== undefined && object.created !== null) + ? AbsoluteTxPosition.fromPartial(object.created) + : undefined; + message.ibcPortId = object.ibcPortId ?? ""; + message.extension = (object.extension !== undefined && object.extension !== null) + ? Any.fromPartial(object.extension) + : undefined; return message; }, }; -const baseContractCodeHistoryEntry: object = { operation: 0, code_id: 0 }; +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { operation: 0, codeId: 0, updated: undefined, msg: new Uint8Array() }; +} export const ContractCodeHistoryEntry = { - encode( - message: ContractCodeHistoryEntry, - writer: Writer = Writer.create() - ): Writer { + encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.operation !== 0) { writer.uint32(8).int32(message.operation); } - if (message.code_id !== 0) { - writer.uint32(16).uint64(message.code_id); + if (message.codeId !== 0) { + writer.uint32(16).uint64(message.codeId); } if (message.updated !== undefined) { - AbsoluteTxPosition.encode( - message.updated, - writer.uint32(26).fork() - ).ldelim(); + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); } if (message.msg.length !== 0) { writer.uint32(34).bytes(message.msg); @@ -765,15 +560,10 @@ export const ContractCodeHistoryEntry = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): ContractCodeHistoryEntry { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseContractCodeHistoryEntry, - } as ContractCodeHistoryEntry; + const message = createBaseContractCodeHistoryEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -781,7 +571,7 @@ export const ContractCodeHistoryEntry = { message.operation = reader.int32() as any; break; case 2: - message.code_id = longToNumber(reader.uint64() as Long); + message.codeId = longToNumber(reader.uint64() as Long); break; case 3: message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); @@ -798,108 +588,64 @@ export const ContractCodeHistoryEntry = { }, fromJSON(object: any): ContractCodeHistoryEntry { - const message = { - ...baseContractCodeHistoryEntry, - } as ContractCodeHistoryEntry; - if (object.operation !== undefined && object.operation !== null) { - message.operation = contractCodeHistoryOperationTypeFromJSON( - object.operation - ); - } else { - message.operation = 0; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.updated !== undefined && object.updated !== null) { - message.updated = AbsoluteTxPosition.fromJSON(object.updated); - } else { - message.updated = undefined; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - return message; + return { + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + }; }, toJSON(message: ContractCodeHistoryEntry): unknown { const obj: any = {}; - message.operation !== undefined && - (obj.operation = contractCodeHistoryOperationTypeToJSON( - message.operation - )); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.updated !== undefined && - (obj.updated = message.updated - ? AbsoluteTxPosition.toJSON(message.updated) - : undefined); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); + message.operation !== undefined && (obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation)); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.updated !== undefined + && (obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial( - object: DeepPartial - ): ContractCodeHistoryEntry { - const message = { - ...baseContractCodeHistoryEntry, - } as ContractCodeHistoryEntry; - if (object.operation !== undefined && object.operation !== null) { - message.operation = object.operation; - } else { - message.operation = 0; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.updated !== undefined && object.updated !== null) { - message.updated = AbsoluteTxPosition.fromPartial(object.updated); - } else { - message.updated = undefined; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } + fromPartial, I>>(object: I): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + message.operation = object.operation ?? 0; + message.codeId = object.codeId ?? 0; + message.updated = (object.updated !== undefined && object.updated !== null) + ? AbsoluteTxPosition.fromPartial(object.updated) + : undefined; + message.msg = object.msg ?? new Uint8Array(); return message; }, }; -const baseAbsoluteTxPosition: object = { block_height: 0, tx_index: 0 }; +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { blockHeight: 0, txIndex: 0 }; +} export const AbsoluteTxPosition = { - encode( - message: AbsoluteTxPosition, - writer: Writer = Writer.create() - ): Writer { - if (message.block_height !== 0) { - writer.uint32(8).uint64(message.block_height); + encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockHeight !== 0) { + writer.uint32(8).uint64(message.blockHeight); } - if (message.tx_index !== 0) { - writer.uint32(16).uint64(message.tx_index); + if (message.txIndex !== 0) { + writer.uint32(16).uint64(message.txIndex); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): AbsoluteTxPosition { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; + const message = createBaseAbsoluteTxPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block_height = longToNumber(reader.uint64() as Long); + message.blockHeight = longToNumber(reader.uint64() as Long); break; case 2: - message.tx_index = longToNumber(reader.uint64() as Long); + message.txIndex = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -910,48 +656,33 @@ export const AbsoluteTxPosition = { }, fromJSON(object: any): AbsoluteTxPosition { - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = Number(object.block_height); - } else { - message.block_height = 0; - } - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = Number(object.tx_index); - } else { - message.tx_index = 0; - } - return message; + return { + blockHeight: isSet(object.blockHeight) ? Number(object.blockHeight) : 0, + txIndex: isSet(object.txIndex) ? Number(object.txIndex) : 0, + }; }, toJSON(message: AbsoluteTxPosition): unknown { const obj: any = {}; - message.block_height !== undefined && - (obj.block_height = message.block_height); - message.tx_index !== undefined && (obj.tx_index = message.tx_index); + message.blockHeight !== undefined && (obj.blockHeight = Math.round(message.blockHeight)); + message.txIndex !== undefined && (obj.txIndex = Math.round(message.txIndex)); return obj; }, - fromPartial(object: DeepPartial): AbsoluteTxPosition { - const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; - if (object.block_height !== undefined && object.block_height !== null) { - message.block_height = object.block_height; - } else { - message.block_height = 0; - } - if (object.tx_index !== undefined && object.tx_index !== null) { - message.tx_index = object.tx_index; - } else { - message.tx_index = 0; - } + fromPartial, I>>(object: I): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + message.blockHeight = object.blockHeight ?? 0; + message.txIndex = object.txIndex ?? 0; return message; }, }; -const baseModel: object = {}; +function createBaseModel(): Model { + return { key: new Uint8Array(), value: new Uint8Array() }; +} export const Model = { - encode(message: Model, writer: Writer = Writer.create()): Writer { + encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -961,10 +692,10 @@ export const Model = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Model { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Model { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseModel } as Model; + const message = createBaseModel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -983,89 +714,84 @@ export const Model = { }, fromJSON(object: any): Model { - const message = { ...baseModel } as Model; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Model): unknown { const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Model { - const message = { ...baseModel } as Model; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Model { + const message = createBaseModel(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -1073,7 +799,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/any.ts index 15b74ff0bb..363af6de7c 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/any.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/any.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -59,7 +59,6 @@ export const protobufPackage = "google.protobuf"; * in the type URL, for example "foo.bar.com/x/y.z" will yield type * name "y.z". * - * * JSON * ==== * The JSON representation of an `Any` value uses the regular @@ -118,17 +117,19 @@ export interface Any { * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. */ - type_url: string; + typeUrl: string; /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } -const baseAny: object = { type_url: "" }; +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} export const Any = { - encode(message: Any, writer: Writer = Writer.create()): Writer { - if (message.type_url !== "") { - writer.uint32(10).string(message.type_url); + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); @@ -136,15 +137,15 @@ export const Any = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Any { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAny } as Any; + const message = createBaseAny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type_url = reader.string(); + message.typeUrl = reader.string(); break; case 2: message.value = reader.bytes(); @@ -158,84 +159,83 @@ export const Any = { }, fromJSON(object: any): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = String(object.type_url); - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - return message; + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; }, toJSON(message: Any): unknown { const obj: any = {}; - message.type_url !== undefined && (obj.type_url = message.type_url); - message.value !== undefined && - (obj.value = base64FromBytes( - message.value !== undefined ? message.value : new Uint8Array() - )); + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial(object: DeepPartial): Any { - const message = { ...baseAny } as Any; - if (object.type_url !== undefined && object.type_url !== null) { - message.type_url = object.type_url; - } else { - message.type_url = ""; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } else { - message.value = new Uint8Array(); - } + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/cosmwasm.wasm.v1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/index.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/module.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/module.ts new file mode 100755 index 0000000000..b27ae4a302 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/module.ts @@ -0,0 +1,101 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Params as typeParams} from "./types" +import { QueryRequest as typeQueryRequest} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Params: getStructure(typeParams.fromPartial({})), + QueryRequest: getStructure(typeQueryRequest.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + IbcApplicationsInterchainAccountsHostV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/registry.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/rest.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/rest.ts new file mode 100644 index 0000000000..e78f471aed --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/rest.ts @@ -0,0 +1,214 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** +* Params defines the set of on-chain interchain accounts parameters. +The following parameters may be used to disable the host submodule. +*/ +export interface Hostv1Params { + /** host_enabled enables or disables the host submodule. */ + host_enabled?: boolean; + + /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ + allow_messages?: string[]; +} + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export interface V1MsgModuleQuerySafeResponse { + /** + * height at which the responses were queried + * @format uint64 + */ + height?: string; + + /** protobuf encoded responses for each query */ + responses?: string[]; +} + +/** + * QueryParamsResponse is the response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Hostv1Params; +} + +/** +* QueryRequest defines the parameters for a particular query request +by an interchain account. +*/ +export interface V1QueryRequest { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path?: string; + + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + * @format byte + */ + data?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title ibc/applications/interchain_accounts/host/v1/host.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Params queries all parameters of the ICA host submodule. + * @request GET:/ibc/apps/interchain_accounts/host/v1/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/interchain_accounts/host/v1/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types.ts new file mode 100755 index 0000000000..bccb1022ed --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { Params } from "./types/ibc/applications/interchain_accounts/host/v1/host" +import { QueryRequest } from "./types/ibc/applications/interchain_accounts/host/v1/host" + + +export { + Params, + QueryRequest, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/host.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/host.ts new file mode 100644 index 0000000000..5aba1821c2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/host.ts @@ -0,0 +1,213 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; + +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the host submodule. + */ +export interface Params { + /** host_enabled enables or disables the host submodule. */ + hostEnabled: boolean; + /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ + allowMessages: string[]; +} + +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequest { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path: string; + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + data: Uint8Array; +} + +function createBaseParams(): Params { + return { hostEnabled: false, allowMessages: [] }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hostEnabled === true) { + writer.uint32(8).bool(message.hostEnabled); + } + for (const v of message.allowMessages) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostEnabled = reader.bool(); + break; + case 2: + message.allowMessages.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + hostEnabled: isSet(object.hostEnabled) ? Boolean(object.hostEnabled) : false, + allowMessages: Array.isArray(object?.allowMessages) ? object.allowMessages.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.hostEnabled !== undefined && (obj.hostEnabled = message.hostEnabled); + if (message.allowMessages) { + obj.allowMessages = message.allowMessages.map((e) => e); + } else { + obj.allowMessages = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.hostEnabled = object.hostEnabled ?? false; + message.allowMessages = object.allowMessages?.map((e) => e) || []; + return message; + }, +}; + +function createBaseQueryRequest(): QueryRequest { + return { path: "", data: new Uint8Array() }; +} + +export const QueryRequest = { + encode(message: QueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryRequest { + return { + path: isSet(object.path) ? String(object.path) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: QueryRequest): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): QueryRequest { + const message = createBaseQueryRequest(); + message.path = object.path ?? ""; + message.data = object.data ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/query.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/query.ts new file mode 100644 index 0000000000..233b4c2e54 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/query.ts @@ -0,0 +1,142 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Params } from "./host"; + +export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** Params queries all parameters of the ICA host submodule. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/tx.ts b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/tx.ts new file mode 100644 index 0000000000..28b40f0ec8 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/tx.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { QueryRequest } from "./host"; + +export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; + +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafe { + /** signer address */ + signer: string; + /** requests defines the module safe queries to execute. */ + requests: QueryRequest[]; +} + +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponse { + /** height at which the responses were queried */ + height: number; + /** protobuf encoded responses for each query */ + responses: Uint8Array[]; +} + +function createBaseMsgModuleQuerySafe(): MsgModuleQuerySafe { + return { signer: "", requests: [] }; +} + +export const MsgModuleQuerySafe = { + encode(message: MsgModuleQuerySafe, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.requests) { + QueryRequest.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgModuleQuerySafe { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgModuleQuerySafe(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.requests.push(QueryRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgModuleQuerySafe { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + requests: Array.isArray(object?.requests) ? object.requests.map((e: any) => QueryRequest.fromJSON(e)) : [], + }; + }, + + toJSON(message: MsgModuleQuerySafe): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + if (message.requests) { + obj.requests = message.requests.map((e) => e ? QueryRequest.toJSON(e) : undefined); + } else { + obj.requests = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgModuleQuerySafe { + const message = createBaseMsgModuleQuerySafe(); + message.signer = object.signer ?? ""; + message.requests = object.requests?.map((e) => QueryRequest.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMsgModuleQuerySafeResponse(): MsgModuleQuerySafeResponse { + return { height: 0, responses: [] }; +} + +export const MsgModuleQuerySafeResponse = { + encode(message: MsgModuleQuerySafeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== 0) { + writer.uint32(8).uint64(message.height); + } + for (const v of message.responses) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgModuleQuerySafeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgModuleQuerySafeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = longToNumber(reader.uint64() as Long); + break; + case 2: + message.responses.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgModuleQuerySafeResponse { + return { + height: isSet(object.height) ? Number(object.height) : 0, + responses: Array.isArray(object?.responses) ? object.responses.map((e: any) => bytesFromBase64(e)) : [], + }; + }, + + toJSON(message: MsgModuleQuerySafeResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = Math.round(message.height)); + if (message.responses) { + obj.responses = message.responses.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.responses = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MsgModuleQuerySafeResponse { + const message = createBaseMsgModuleQuerySafeResponse(); + message.height = object.height ?? 0; + message.responses = object.responses?.map((e) => e) || []; + return message; + }, +}; + +/** Msg defines the 27-interchain-accounts/host Msg service. */ +export interface Msg { + /** ModuleQuerySafe defines a rpc handler for MsgModuleQuerySafe. */ + ModuleQuerySafe(request: MsgModuleQuerySafe): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ModuleQuerySafe = this.ModuleQuerySafe.bind(this); + } + ModuleQuerySafe(request: MsgModuleQuerySafe): Promise { + const data = MsgModuleQuerySafe.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Msg", "ModuleQuerySafe", data); + return promise.then((data) => MsgModuleQuerySafeResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/index.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/module.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/module.ts new file mode 100755 index 0000000000..6bad403f04 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/module.ts @@ -0,0 +1,138 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgTransfer } from "./types/ibc/applications/transfer/v1/tx"; + +import { Allocation as typeAllocation} from "./types" +import { TransferAuthorization as typeTransferAuthorization} from "./types" +import { DenomTrace as typeDenomTrace} from "./types" +import { Params as typeParams} from "./types" + +export { MsgTransfer }; + +type sendMsgTransferParams = { + value: MsgTransfer, + fee?: StdFee, + memo?: string +}; + + +type msgTransferParams = { + value: MsgTransfer, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgTransfer({ value, fee, memo }: sendMsgTransferParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgTransfer: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgTransfer({ value: MsgTransfer.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgTransfer: Could not broadcast Tx: '+ e.message) + } + }, + + + msgTransfer({ value }: msgTransferParams): EncodeObject { + try { + return { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgTransfer: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Allocation: getStructure(typeAllocation.fromPartial({})), + TransferAuthorization: getStructure(typeTransferAuthorization.fromPartial({})), + DenomTrace: getStructure(typeDenomTrace.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + IbcApplicationsTransferV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/registry.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/registry.ts new file mode 100755 index 0000000000..d7a9d32293 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/registry.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgTransfer } from "./types/ibc/applications/transfer/v1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/rest.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/rest.ts new file mode 100644 index 0000000000..1cb9395728 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/rest.ts @@ -0,0 +1,574 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** +* Params defines the set of IBC transfer parameters. +NOTE: To prevent a single token from being transferred, set the +TransfersEnabled parameter to true and then set the bank module's SendEnabled +parameter for the denomination to false. +*/ +export interface Applicationstransferv1Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + send_enabled?: boolean; + + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receive_enabled?: boolean; +} + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** +* DenomTrace contains the base denomination for ICS20 fungible tokens and the +source tracing information path. +*/ +export interface Transferv1DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path?: string; + + /** base denomination of the relayed fungible token. */ + base_denom?: string; +} + +/** +* Normally the RevisionHeight is incremented at each height while keeping +RevisionNumber the same. However some consensus algorithms may choose to +reset the height in certain conditions e.g. hard forks, state-machine +breaking changes In these cases, the RevisionNumber is incremented so that +height continues to be monitonically increasing even as the RevisionHeight +gets reset +*/ +export interface V1Height { + /** + * the revision that the client is currently on + * @format uint64 + */ + revision_number?: string; + + /** + * the height within the given revision + * @format uint64 + */ + revision_height?: string; +} + +/** + * MsgTransferResponse defines the Msg/Transfer response type. + */ +export interface V1MsgTransferResponse { + /** + * sequence number of the transfer packet sent + * @format uint64 + */ + sequence?: string; +} + +/** +* QueryDenomHashResponse is the response type for the Query/DenomHash RPC +method. +*/ +export interface V1QueryDenomHashResponse { + /** hash (in hex format) of the denomination trace information. */ + hash?: string; +} + +/** +* QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +method. +*/ +export interface V1QueryDenomTraceResponse { + /** denom_trace returns the requested denomination trace information. */ + denom_trace?: Transferv1DenomTrace; +} + +/** +* QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +method. +*/ +export interface V1QueryDenomTracesResponse { + /** denom_traces returns all denominations trace information. */ + denom_traces?: Transferv1DenomTrace[]; + + /** pagination defines the pagination in the response. */ + pagination?: V1Beta1PageResponse; +} + +/** + * QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. + */ +export interface V1QueryEscrowAddressResponse { + /** the escrow account address */ + escrow_address?: string; +} + +/** + * QueryParamsResponse is the response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Applicationstransferv1Params; +} + +/** + * QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. + */ +export interface V1QueryTotalEscrowForDenomResponse { + /** + * 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. + */ + amount?: V1Beta1Coin; +} + +/** +* 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 V1Beta1Coin { + denom?: string; + amount?: string; +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title ibc/applications/transfer/v1/authz.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryEscrowAddress + * @summary EscrowAddress returns the escrow address for a particular port and channel id. + * @request GET:/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address + */ + queryEscrowAddress = (channelId: string, portId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/transfer/v1/channels/${channelId}/ports/${portId}/escrow_address`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDenomHash + * @summary DenomHash queries a denomination hash information. + * @request GET:/ibc/apps/transfer/v1/denom_hashes/{trace} + */ + queryDenomHash = (trace: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/transfer/v1/denom_hashes/${trace}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDenomTraces + * @summary DenomTraces queries all denomination traces. + * @request GET:/ibc/apps/transfer/v1/denom_traces + */ + queryDenomTraces = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/apps/transfer/v1/denom_traces`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryDenomTrace + * @summary DenomTrace queries a denomination trace information. + * @request GET:/ibc/apps/transfer/v1/denom_traces/{hash} + */ + queryDenomTrace = (hash: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/transfer/v1/denom_traces/${hash}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryTotalEscrowForDenom + * @summary TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + * @request GET:/ibc/apps/transfer/v1/denoms/{denom}/total_escrow + */ + queryTotalEscrowForDenom = (denom: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/transfer/v1/denoms/${denom}/total_escrow`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Params queries all parameters of the ibc-transfer module. + * @request GET:/ibc/apps/transfer/v1/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/transfer/v1/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types.ts new file mode 100755 index 0000000000..6f1fa5b814 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { Allocation } from "./types/ibc/applications/transfer/v1/authz" +import { TransferAuthorization } from "./types/ibc/applications/transfer/v1/authz" +import { DenomTrace } from "./types/ibc/applications/transfer/v1/transfer" +import { Params } from "./types/ibc/applications/transfer/v1/transfer" + + +export { + Allocation, + TransferAuthorization, + DenomTrace, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/v1beta1/coin.ts new file mode 100644 index 0000000000..d11d12c100 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,262 @@ +//@ts-nocheck +/* eslint-disable */ +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. */ +export interface IntProto { + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/upgrade/v1beta1/upgrade.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000000..4b2ecab4a4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,432 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + time: + | Date + | undefined; + /** The height at which the upgrade must be performed. */ + height: number; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + upgradedClientState: Any | undefined; +} + +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + * + * @deprecated + */ +export interface SoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan | undefined; +} + +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + * + * @deprecated + */ +export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} + +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: number; +} + +function createBasePlan(): Plan { + return { name: "", time: undefined, height: 0, info: "", upgradedClientState: undefined }; +} + +export const Plan = { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: Plan): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height ?? 0; + message.info = object.info ?? ""; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { title: "", description: "", plan: undefined }; +} + +export const SoftwareUpgradeProposal = { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; + }, + + toJSON(message: SoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + return message; + }, +}; + +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { title: "", description: "" }; +} + +export const CancelSoftwareUpgradeProposal = { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelSoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: CancelSoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I, + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseModuleVersion(): ModuleVersion { + return { name: "", version: 0 }; +} + +export const ModuleVersion = { + encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== 0) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? Number(object.version) : 0, + }; + }, + + toJSON(message: ModuleVersion): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = Math.round(message.version)); + return obj; + }, + + fromPartial, I>>(object: I): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/timestamp.ts new file mode 100644 index 0000000000..93776d9496 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/google/protobuf/timestamp.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/authz.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/authz.ts new file mode 100644 index 0000000000..e3a1218f11 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/authz.ts @@ -0,0 +1,199 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** Allocation defines the spend limit for a particular port and channel */ +export interface Allocation { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** spend limitation on the channel */ + spendLimit: Coin[]; + /** allow list of receivers, an empty allow list permits any receiver address */ + allowList: string[]; + /** + * allow list of memo strings, an empty list prohibits all memo strings; + * a list only with "*" permits any memo string + */ + allowedPacketData: string[]; +} + +/** + * TransferAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account for ibc transfer on a specific channel + */ +export interface TransferAuthorization { + /** port and channel amounts */ + allocations: Allocation[]; +} + +function createBaseAllocation(): Allocation { + return { sourcePort: "", sourceChannel: "", spendLimit: [], allowList: [], allowedPacketData: [] }; +} + +export const Allocation = { + encode(message: Allocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.allowList) { + writer.uint32(34).string(v!); + } + for (const v of message.allowedPacketData) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Allocation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllocation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.allowList.push(reader.string()); + break; + case 5: + message.allowedPacketData.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Allocation { + return { + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], + allowList: Array.isArray(object?.allowList) ? object.allowList.map((e: any) => String(e)) : [], + allowedPacketData: Array.isArray(object?.allowedPacketData) + ? object.allowedPacketData.map((e: any) => String(e)) + : [], + }; + }, + + toJSON(message: Allocation): unknown { + const obj: any = {}; + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + if (message.spendLimit) { + obj.spendLimit = message.spendLimit.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.spendLimit = []; + } + if (message.allowList) { + obj.allowList = message.allowList.map((e) => e); + } else { + obj.allowList = []; + } + if (message.allowedPacketData) { + obj.allowedPacketData = message.allowedPacketData.map((e) => e); + } else { + obj.allowedPacketData = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Allocation { + const message = createBaseAllocation(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map((e) => e) || []; + message.allowedPacketData = object.allowedPacketData?.map((e) => e) || []; + return message; + }, +}; + +function createBaseTransferAuthorization(): TransferAuthorization { + return { allocations: [] }; +} + +export const TransferAuthorization = { + encode(message: TransferAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allocations) { + Allocation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TransferAuthorization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransferAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allocations.push(Allocation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TransferAuthorization { + return { + allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => Allocation.fromJSON(e)) : [], + }; + }, + + toJSON(message: TransferAuthorization): unknown { + const obj: any = {}; + if (message.allocations) { + obj.allocations = message.allocations.map((e) => e ? Allocation.toJSON(e) : undefined); + } else { + obj.allocations = []; + } + return obj; + }, + + fromPartial, I>>(object: I): TransferAuthorization { + const message = createBaseTransferAuthorization(); + message.allocations = object.allocations?.map((e) => Allocation.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.ts new file mode 100644 index 0000000000..719bb9afb8 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.ts @@ -0,0 +1,122 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { DenomTrace, Params } from "./transfer"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisState { + portId: string; + denomTraces: DenomTrace[]; + params: + | Params + | undefined; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + totalEscrowed: Coin[]; +} + +function createBaseGenesisState(): GenesisState { + return { portId: "", denomTraces: [], params: undefined, totalEscrowed: [] }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.totalEscrowed) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + case 4: + message.totalEscrowed.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + denomTraces: Array.isArray(object?.denomTraces) ? object.denomTraces.map((e: any) => DenomTrace.fromJSON(e)) : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + totalEscrowed: Array.isArray(object?.totalEscrowed) ? object.totalEscrowed.map((e: any) => Coin.fromJSON(e)) : [], + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map((e) => e ? DenomTrace.toJSON(e) : undefined); + } else { + obj.denomTraces = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.totalEscrowed) { + obj.totalEscrowed = message.totalEscrowed.map((e) => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalEscrowed = []; + } + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.portId = object.portId ?? ""; + message.denomTraces = object.denomTraces?.map((e) => DenomTrace.fromPartial(e)) || []; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.totalEscrowed = object.totalEscrowed?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.ts new file mode 100644 index 0000000000..3860ef11db --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.ts @@ -0,0 +1,780 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { DenomTrace, Params } from "./transfer"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC + * method + */ +export interface QueryDenomTraceRequest { + /** hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. */ + hash: string; +} + +/** + * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + * method. + */ +export interface QueryDenomTraceResponse { + /** denom_trace returns the requested denomination trace information. */ + denomTrace: DenomTrace | undefined; +} + +/** + * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC + * method + */ +export interface QueryDenomTracesRequest { + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest | undefined; +} + +/** + * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC + * method. + */ +export interface QueryDenomTracesResponse { + /** denom_traces returns all denominations trace information. */ + denomTraces: DenomTrace[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse | undefined; +} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} + +/** + * QueryDenomHashRequest is the request type for the Query/DenomHash RPC + * method + */ +export interface QueryDenomHashRequest { + /** The denomination trace ([port_id]/[channel_id])+/[denom] */ + trace: string; +} + +/** + * QueryDenomHashResponse is the response type for the Query/DenomHash RPC + * method. + */ +export interface QueryDenomHashResponse { + /** hash (in hex format) of the denomination trace information. */ + hash: string; +} + +/** QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. */ +export interface QueryEscrowAddressRequest { + /** unique port identifier */ + portId: string; + /** unique channel identifier */ + channelId: string; +} + +/** QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. */ +export interface QueryEscrowAddressResponse { + /** the escrow account address */ + escrowAddress: string; +} + +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequest { + denom: string; +} + +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponse { + amount: Coin | undefined; +} + +function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { + return { hash: "" }; +} + +export const QueryDenomTraceRequest = { + encode(message: QueryDenomTraceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTraceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTraceRequest { + return { hash: isSet(object.hash) ? String(object.hash) : "" }; + }, + + toJSON(message: QueryDenomTraceRequest): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomTraceRequest { + const message = createBaseQueryDenomTraceRequest(); + message.hash = object.hash ?? ""; + return message; + }, +}; + +function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { + return { denomTrace: undefined }; +} + +export const QueryDenomTraceResponse = { + encode(message: QueryDenomTraceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denomTrace !== undefined) { + DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTraceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTrace = DenomTrace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTraceResponse { + return { denomTrace: isSet(object.denomTrace) ? DenomTrace.fromJSON(object.denomTrace) : undefined }; + }, + + toJSON(message: QueryDenomTraceResponse): unknown { + const obj: any = {}; + message.denomTrace !== undefined + && (obj.denomTrace = message.denomTrace ? DenomTrace.toJSON(message.denomTrace) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomTraceResponse { + const message = createBaseQueryDenomTraceResponse(); + message.denomTrace = (object.denomTrace !== undefined && object.denomTrace !== null) + ? DenomTrace.fromPartial(object.denomTrace) + : undefined; + return message; + }, +}; + +function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { + return { pagination: undefined }; +} + +export const QueryDenomTracesRequest = { + encode(message: QueryDenomTracesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTracesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTracesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryDenomTracesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomTracesRequest { + const message = createBaseQueryDenomTracesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { + return { denomTraces: [], pagination: undefined }; +} + +export const QueryDenomTracesResponse = { + encode(message: QueryDenomTracesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomTracesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTracesResponse { + return { + denomTraces: Array.isArray(object?.denomTraces) ? object.denomTraces.map((e: any) => DenomTrace.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryDenomTracesResponse): unknown { + const obj: any = {}; + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map((e) => e ? DenomTrace.toJSON(e) : undefined); + } else { + obj.denomTraces = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomTracesResponse { + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denomTraces?.map((e) => DenomTrace.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseQueryDenomHashRequest(): QueryDenomHashRequest { + return { trace: "" }; +} + +export const QueryDenomHashRequest = { + encode(message: QueryDenomHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.trace !== "") { + writer.uint32(10).string(message.trace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomHashRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomHashRequest { + return { trace: isSet(object.trace) ? String(object.trace) : "" }; + }, + + toJSON(message: QueryDenomHashRequest): unknown { + const obj: any = {}; + message.trace !== undefined && (obj.trace = message.trace); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomHashRequest { + const message = createBaseQueryDenomHashRequest(); + message.trace = object.trace ?? ""; + return message; + }, +}; + +function createBaseQueryDenomHashResponse(): QueryDenomHashResponse { + return { hash: "" }; +} + +export const QueryDenomHashResponse = { + encode(message: QueryDenomHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomHashResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomHashResponse { + return { hash: isSet(object.hash) ? String(object.hash) : "" }; + }, + + toJSON(message: QueryDenomHashResponse): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, + + fromPartial, I>>(object: I): QueryDenomHashResponse { + const message = createBaseQueryDenomHashResponse(); + message.hash = object.hash ?? ""; + return message; + }, +}; + +function createBaseQueryEscrowAddressRequest(): QueryEscrowAddressRequest { + return { portId: "", channelId: "" }; +} + +export const QueryEscrowAddressRequest = { + encode(message: QueryEscrowAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEscrowAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryEscrowAddressRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: QueryEscrowAddressRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>(object: I): QueryEscrowAddressRequest { + const message = createBaseQueryEscrowAddressRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseQueryEscrowAddressResponse(): QueryEscrowAddressResponse { + return { escrowAddress: "" }; +} + +export const QueryEscrowAddressResponse = { + encode(message: QueryEscrowAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.escrowAddress !== "") { + writer.uint32(10).string(message.escrowAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEscrowAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.escrowAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryEscrowAddressResponse { + return { escrowAddress: isSet(object.escrowAddress) ? String(object.escrowAddress) : "" }; + }, + + toJSON(message: QueryEscrowAddressResponse): unknown { + const obj: any = {}; + message.escrowAddress !== undefined && (obj.escrowAddress = message.escrowAddress); + return obj; + }, + + fromPartial, I>>(object: I): QueryEscrowAddressResponse { + const message = createBaseQueryEscrowAddressResponse(); + message.escrowAddress = object.escrowAddress ?? ""; + return message; + }, +}; + +function createBaseQueryTotalEscrowForDenomRequest(): QueryTotalEscrowForDenomRequest { + return { denom: "" }; +} + +export const QueryTotalEscrowForDenomRequest = { + encode(message: QueryTotalEscrowForDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTotalEscrowForDenomRequest { + return { denom: isSet(object.denom) ? String(object.denom) : "" }; + }, + + toJSON(message: QueryTotalEscrowForDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, +}; + +function createBaseQueryTotalEscrowForDenomResponse(): QueryTotalEscrowForDenomResponse { + return { amount: undefined }; +} + +export const QueryTotalEscrowForDenomResponse = { + encode(message: QueryTotalEscrowForDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTotalEscrowForDenomResponse { + return { amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined }; + }, + + toJSON(message: QueryTotalEscrowForDenomResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** DenomTraces queries all denomination traces. */ + DenomTraces(request: QueryDenomTracesRequest): Promise; + /** DenomTrace queries a denomination trace information. */ + DenomTrace(request: QueryDenomTraceRequest): Promise; + /** Params queries all parameters of the ibc-transfer module. */ + Params(request: QueryParamsRequest): Promise; + /** DenomHash queries a denomination hash information. */ + DenomHash(request: QueryDenomHashRequest): Promise; + /** EscrowAddress returns the escrow address for a particular port and channel id. */ + EscrowAddress(request: QueryEscrowAddressRequest): Promise; + /** TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + TotalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.DenomTraces = this.DenomTraces.bind(this); + this.DenomTrace = this.DenomTrace.bind(this); + this.Params = this.Params.bind(this); + this.DenomHash = this.DenomHash.bind(this); + this.EscrowAddress = this.EscrowAddress.bind(this); + this.TotalEscrowForDenom = this.TotalEscrowForDenom.bind(this); + } + DenomTraces(request: QueryDenomTracesRequest): Promise { + const data = QueryDenomTracesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); + return promise.then((data) => QueryDenomTracesResponse.decode(new _m0.Reader(data))); + } + + DenomTrace(request: QueryDenomTraceRequest): Promise { + const data = QueryDenomTraceRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); + return promise.then((data) => QueryDenomTraceResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + DenomHash(request: QueryDenomHashRequest): Promise { + const data = QueryDenomHashRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomHash", data); + return promise.then((data) => QueryDenomHashResponse.decode(new _m0.Reader(data))); + } + + EscrowAddress(request: QueryEscrowAddressRequest): Promise { + const data = QueryEscrowAddressRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); + return promise.then((data) => QueryEscrowAddressResponse.decode(new _m0.Reader(data))); + } + + TotalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + const data = QueryTotalEscrowForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "TotalEscrowForDenom", data); + return promise.then((data) => QueryTotalEscrowForDenomResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/transfer.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 0000000000..57c5499978 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,169 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + baseDenom: string; +} + +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} + +function createBaseDenomTrace(): DenomTrace { + return { path: "", baseDenom: "" }; +} + +export const DenomTrace = { + encode(message: DenomTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.baseDenom !== "") { + writer.uint32(18).string(message.baseDenom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomTrace { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomTrace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DenomTrace { + return { + path: isSet(object.path) ? String(object.path) : "", + baseDenom: isSet(object.baseDenom) ? String(object.baseDenom) : "", + }; + }, + + toJSON(message: DenomTrace): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); + return obj; + }, + + fromPartial, I>>(object: I): DenomTrace { + const message = createBaseDenomTrace(); + message.path = object.path ?? ""; + message.baseDenom = object.baseDenom ?? ""; + return message; + }, +}; + +function createBaseParams(): Params { + return { sendEnabled: false, receiveEnabled: false }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + sendEnabled: isSet(object.sendEnabled) ? Boolean(object.sendEnabled) : false, + receiveEnabled: isSet(object.receiveEnabled) ? Boolean(object.receiveEnabled) : false, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.sendEnabled !== undefined && (obj.sendEnabled = message.sendEnabled); + message.receiveEnabled !== undefined && (obj.receiveEnabled = message.receiveEnabled); + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled ?? false; + message.receiveEnabled = object.receiveEnabled ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 0000000000..39de7e0357 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,288 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { Height } from "../../../core/client/v1/client"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the tokens to be transferred */ + token: + | Coin + | undefined; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: + | Height + | undefined; + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: number; + /** optional memo */ + memo: string; +} + +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse { + /** sequence number of the transfer packet sent */ + sequence: number; +} + +function createBaseMsgTransfer(): MsgTransfer { + return { + sourcePort: "", + sourceChannel: "", + token: undefined, + sender: "", + receiver: "", + timeoutHeight: undefined, + timeoutTimestamp: 0, + memo: "", + }; +} + +export const MsgTransfer = { + encode(message: MsgTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.timeoutTimestamp !== 0) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + if (message.memo !== "") { + writer.uint32(66).string(message.memo); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = longToNumber(reader.uint64() as Long); + break; + case 8: + message.memo = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTransfer { + return { + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + token: isSet(object.token) ? Coin.fromJSON(object.token) : undefined, + sender: isSet(object.sender) ? String(object.sender) : "", + receiver: isSet(object.receiver) ? String(object.receiver) : "", + timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? Number(object.timeoutTimestamp) : 0, + memo: isSet(object.memo) ? String(object.memo) : "", + }; + }, + + toJSON(message: MsgTransfer): unknown { + const obj: any = {}; + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.token !== undefined && (obj.token = message.token ? Coin.toJSON(message.token) : undefined); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + message.timeoutHeight !== undefined + && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = Math.round(message.timeoutTimestamp)); + message.memo !== undefined && (obj.memo = message.memo); + return obj; + }, + + fromPartial, I>>(object: I): MsgTransfer { + const message = createBaseMsgTransfer(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.token = (object.token !== undefined && object.token !== null) ? Coin.fromPartial(object.token) : undefined; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.timeoutHeight = (object.timeoutHeight !== undefined && object.timeoutHeight !== null) + ? Height.fromPartial(object.timeoutHeight) + : undefined; + message.timeoutTimestamp = object.timeoutTimestamp ?? 0; + message.memo = object.memo ?? ""; + return message; + }, +}; + +function createBaseMsgTransferResponse(): MsgTransferResponse { + return { sequence: 0 }; +} + +export const MsgTransferResponse = { + encode(message: MsgTransferResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sequence !== 0) { + writer.uint32(8).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTransferResponse { + return { sequence: isSet(object.sequence) ? Number(object.sequence) : 0 }; + }, + + toJSON(message: MsgTransferResponse): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): MsgTransferResponse { + const message = createBaseMsgTransferResponse(); + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +/** Msg defines the ibc/transfer Msg service. */ +export interface Msg { + /** Transfer defines a rpc handler method for MsgTransfer. */ + Transfer(request: MsgTransfer): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Transfer = this.Transfer.bind(this); + } + Transfer(request: MsgTransfer): Promise { + const data = MsgTransfer.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); + return promise.then((data) => MsgTransferResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/core/client/v1/client.ts b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/core/client/v1/client.ts new file mode 100644 index 0000000000..0f612c313b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.applications.transfer.v1/types/ibc/core/client/v1/client.ts @@ -0,0 +1,613 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState: Any | undefined; +} + +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: + | Height + | undefined; + /** consensus state */ + consensusState: Any | undefined; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} + +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + title: string; + description: string; + plan: + | Plan + | undefined; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState: Any | undefined; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: number; + /** the height within the given revision */ + revisionHeight: number; +} + +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} + +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { clientId: "", clientState: undefined }; +} + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + }; + }, + + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + return message; + }, +}; + +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { height: undefined, consensusState: undefined }; +} + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + }; + }, + + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + return message; + }, +}; + +function createBaseClientConsensusStates(): ClientConsensusStates { + return { clientId: "", consensusStates: [] }; +} + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) + ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { title: "", description: "", subjectClientId: "", substituteClientId: "" }; +} + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "", + }; + }, + + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, + + fromPartial, I>>(object: I): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, +}; + +function createBaseUpgradeProposal(): UpgradeProposal { + return { title: "", description: "", plan: undefined, upgradedClientState: undefined }; +} + +export const UpgradeProposal = { + encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: UpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseHeight(): Height { + return { revisionNumber: 0, revisionHeight: 0 }; +} + +export const Height = { + encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revisionNumber !== 0) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Height { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 2: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>(object: I): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseParams(): Params { + return { allowedClients: [] }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/index.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/module.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/module.ts new file mode 100755 index 0000000000..1f9d00de61 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/module.ts @@ -0,0 +1,113 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Channel as typeChannel} from "./types" +import { IdentifiedChannel as typeIdentifiedChannel} from "./types" +import { Counterparty as typeCounterparty} from "./types" +import { Packet as typePacket} from "./types" +import { PacketState as typePacketState} from "./types" +import { PacketId as typePacketId} from "./types" +import { Acknowledgement as typeAcknowledgement} from "./types" +import { PacketSequence as typePacketSequence} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Channel: getStructure(typeChannel.fromPartial({})), + IdentifiedChannel: getStructure(typeIdentifiedChannel.fromPartial({})), + Counterparty: getStructure(typeCounterparty.fromPartial({})), + Packet: getStructure(typePacket.fromPartial({})), + PacketState: getStructure(typePacketState.fromPartial({})), + PacketId: getStructure(typePacketId.fromPartial({})), + Acknowledgement: getStructure(typeAcknowledgement.fromPartial({})), + PacketSequence: getStructure(typePacketSequence.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + IbcCoreChannelV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/registry.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/rest.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/rest.ts new file mode 100644 index 0000000000..b196467f8d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/rest.ts @@ -0,0 +1,1377 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** +* Channel defines pipeline for exactly-once packet delivery between specific +modules on separate blockchains, which has at least one end capable of +sending packets and one end capable of receiving packets. +*/ +export interface Channelv1Channel { + /** + * current state of the channel end + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * + * - STATE_UNINITIALIZED_UNSPECIFIED: Default State + * - STATE_INIT: A channel has just started the opening handshake. + * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + * - STATE_OPEN: A channel has completed the handshake. Open channels are + * ready to send and receive packets. + * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + * packets. + */ + state?: V1State; + + /** + * whether the channel is ordered or unordered + * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + * which they were sent. + * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + */ + ordering?: V1Order; + + /** counterparty channel end */ + counterparty?: V1Counterparty; + + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; +} + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export interface V1Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + port_id?: string; + + /** channel end on the counterparty chain */ + channel_id?: string; +} + +/** +* Normally the RevisionHeight is incremented at each height while keeping +RevisionNumber the same. However some consensus algorithms may choose to +reset the height in certain conditions e.g. hard forks, state-machine +breaking changes In these cases, the RevisionNumber is incremented so that +height continues to be monitonically increasing even as the RevisionHeight +gets reset +*/ +export interface V1Height { + /** + * the revision that the client is currently on + * @format uint64 + */ + revision_number?: string; + + /** + * the height within the given revision + * @format uint64 + */ + revision_height?: string; +} + +/** +* IdentifiedChannel defines a channel with additional port and channel +identifier fields. +*/ +export interface V1IdentifiedChannel { + /** + * current state of the channel end + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * + * - STATE_UNINITIALIZED_UNSPECIFIED: Default State + * - STATE_INIT: A channel has just started the opening handshake. + * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + * - STATE_OPEN: A channel has completed the handshake. Open channels are + * ready to send and receive packets. + * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + * packets. + */ + state?: V1State; + + /** + * whether the channel is ordered or unordered + * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + * which they were sent. + * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + */ + ordering?: V1Order; + + /** counterparty channel end */ + counterparty?: V1Counterparty; + + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; + + /** port identifier */ + port_id?: string; + + /** channel identifier */ + channel_id?: string; +} + +/** +* IdentifiedClientState defines a client state with an additional client +identifier field. +*/ +export interface V1IdentifiedClientState { + /** client identifier */ + client_id?: string; + + /** + * client state + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + client_state?: ProtobufAny; +} + +/** + * MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. + */ +export interface V1MsgAcknowledgementResponse { + /** + * - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + * - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + * - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + */ + result?: V1ResponseResultType; +} + +/** +* MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +type. +*/ +export type V1MsgChannelCloseConfirmResponse = object; + +/** + * MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. + */ +export type V1MsgChannelCloseInitResponse = object; + +/** + * MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. + */ +export type V1MsgChannelOpenAckResponse = object; + +/** +* MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +type. +*/ +export type V1MsgChannelOpenConfirmResponse = object; + +/** + * MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. + */ +export interface V1MsgChannelOpenInitResponse { + channel_id?: string; + version?: string; +} + +/** + * MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. + */ +export interface V1MsgChannelOpenTryResponse { + version?: string; + channel_id?: string; +} + +/** + * MsgRecvPacketResponse defines the Msg/RecvPacket response type. + */ +export interface V1MsgRecvPacketResponse { + /** + * - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + * - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + * - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + */ + result?: V1ResponseResultType; +} + +/** + * MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. + */ +export interface V1MsgTimeoutOnCloseResponse { + /** + * - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + * - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + * - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + */ + result?: V1ResponseResultType; +} + +/** + * MsgTimeoutResponse defines the Msg/Timeout response type. + */ +export interface V1MsgTimeoutResponse { + /** + * - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + * - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + * - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + */ + result?: V1ResponseResultType; +} + +/** +* - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in +which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent +*/ +export enum V1Order { + ORDER_NONE_UNSPECIFIED = "ORDER_NONE_UNSPECIFIED", + ORDER_UNORDERED = "ORDER_UNORDERED", + ORDER_ORDERED = "ORDER_ORDERED", +} + +export interface V1Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + * @format uint64 + */ + sequence?: string; + + /** identifies the port on the sending chain. */ + source_port?: string; + + /** identifies the channel end on the sending chain. */ + source_channel?: string; + + /** identifies the port on the receiving chain. */ + destination_port?: string; + + /** identifies the channel end on the receiving chain. */ + destination_channel?: string; + + /** + * actual opaque bytes transferred directly to the application module + * @format byte + */ + data?: string; + + /** + * block height after which the packet times out + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + timeout_height?: V1Height; + + /** + * block timestamp (in nanoseconds) after which the packet times out + * @format uint64 + */ + timeout_timestamp?: string; +} + +/** +* PacketState defines the generic type necessary to retrieve and store +packet commitments, acknowledgements, and receipts. +Caller is responsible for knowing the context necessary to interpret this +state as a commitment, acknowledgement, or a receipt. +*/ +export interface V1PacketState { + /** channel port identifier. */ + port_id?: string; + + /** channel unique identifier. */ + channel_id?: string; + + /** + * packet sequence. + * @format uint64 + */ + sequence?: string; + + /** + * embedded data that represents packet state. + * @format byte + */ + data?: string; +} + +export interface V1QueryChannelClientStateResponse { + /** + * client state associated with the channel + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ + identified_client_state?: V1IdentifiedClientState; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryChannelConsensusStateResponse { + /** + * consensus state associated with the channel + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + consensus_state?: ProtobufAny; + + /** client ID associated with the consensus state */ + client_id?: string; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +/** +* QueryChannelResponse is the response type for the Query/Channel RPC method. +Besides the Channel end, it includes a proof and the height from which the +proof was retrieved. +*/ +export interface V1QueryChannelResponse { + /** + * channel associated with the request identifiers + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ + channel?: Channelv1Channel; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +/** + * QueryChannelsResponse is the response type for the Query/Channels RPC method. + */ +export interface V1QueryChannelsResponse { + /** list of stored channels of the chain. */ + channels?: V1IdentifiedChannel[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +export interface V1QueryConnectionChannelsResponse { + /** list of channels associated with a connection. */ + channels?: V1IdentifiedChannel[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +export interface V1QueryNextSequenceReceiveResponse { + /** + * next sequence receive number + * @format uint64 + */ + next_sequence_receive?: string; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryPacketAcknowledgementResponse { + /** + * packet associated with the request fields + * @format byte + */ + acknowledgement?: string; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryPacketAcknowledgementsResponse { + acknowledgements?: V1PacketState[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +export interface V1QueryPacketCommitmentResponse { + /** + * packet associated with the request fields + * @format byte + */ + commitment?: string; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryPacketCommitmentsResponse { + commitments?: V1PacketState[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +export interface V1QueryPacketReceiptResponse { + /** success flag for if receipt exists */ + received?: boolean; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryUnreceivedAcksResponse { + /** list of unreceived acknowledgement sequences */ + sequences?: string[]; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +export interface V1QueryUnreceivedPacketsResponse { + /** list of unreceived packet sequences */ + sequences?: string[]; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +/** +* - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully +*/ +export enum V1ResponseResultType { + RESPONSE_RESULT_TYPE_UNSPECIFIED = "RESPONSE_RESULT_TYPE_UNSPECIFIED", + RESPONSE_RESULT_TYPE_NOOP = "RESPONSE_RESULT_TYPE_NOOP", + RESPONSE_RESULT_TYPE_SUCCESS = "RESPONSE_RESULT_TYPE_SUCCESS", +} + +/** +* State defines if a channel is in one of the following states: +CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are +ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive +packets. +*/ +export enum V1State { + STATE_UNINITIALIZED_UNSPECIFIED = "STATE_UNINITIALIZED_UNSPECIFIED", + STATE_INIT = "STATE_INIT", + STATE_TRYOPEN = "STATE_TRYOPEN", + STATE_OPEN = "STATE_OPEN", + STATE_CLOSED = "STATE_CLOSED", +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title ibc/core/channel/v1/channel.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryChannels + * @summary Channels queries all the IBC channels of a chain. + * @request GET:/ibc/core/channel/v1/channels + */ + queryChannels = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/channels`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryChannel + * @summary Channel queries an IBC Channel. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id} + */ + queryChannel = (channelId: string, portId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryChannelClientState + * @summary ChannelClientState queries for the client state for the channel associated +with the provided channel identifiers. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state + */ + queryChannelClientState = (channelId: string, portId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/client_state`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryChannelConsensusState + * @summary ChannelConsensusState queries for the consensus state for the channel +associated with the provided channel identifiers. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height} + */ + queryChannelConsensusState = ( + channelId: string, + portId: string, + revisionNumber: string, + revisionHeight: string, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/consensus_state/revision/${revisionNumber}/height/${revisionHeight}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNextSequenceReceive + * @summary NextSequenceReceive returns the next receive sequence for a given channel. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence + */ + queryNextSequenceReceive = (channelId: string, portId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/next_sequence`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPacketAcknowledgements + * @summary PacketAcknowledgements returns all the packet acknowledgements associated +with a channel. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements + */ + queryPacketAcknowledgements = ( + channelId: string, + portId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + packet_commitment_sequences?: string[]; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_acknowledgements`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPacketAcknowledgement + * @summary PacketAcknowledgement queries a stored packet acknowledgement hash. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence} + */ + queryPacketAcknowledgement = (channelId: string, portId: string, sequence: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_acks/${sequence}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPacketCommitments + * @summary PacketCommitments returns all the packet commitments hashes associated +with a channel. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments + */ + queryPacketCommitments = ( + channelId: string, + portId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_commitments`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryUnreceivedAcks + * @summary UnreceivedAcks returns all the unreceived IBC acknowledgements associated +with a channel and sequences. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks + */ + queryUnreceivedAcks = (channelId: string, portId: string, packetAckSequences: string[], params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_commitments/${packetAckSequences}/unreceived_acks`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryUnreceivedPackets + * @summary UnreceivedPackets returns all the unreceived IBC packets associated with a +channel and sequences. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets + */ + queryUnreceivedPackets = ( + channelId: string, + portId: string, + packetCommitmentSequences: string[], + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_commitments/${packetCommitmentSequences}/unreceived_packets`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPacketCommitment + * @summary PacketCommitment queries a stored packet commitment hash. + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence} + */ + queryPacketCommitment = (channelId: string, portId: string, sequence: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_commitments/${sequence}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPacketReceipt + * @summary PacketReceipt queries if a given packet sequence has been received on the +queried chain + * @request GET:/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence} + */ + queryPacketReceipt = (channelId: string, portId: string, sequence: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/channel/v1/channels/${channelId}/ports/${portId}/packet_receipts/${sequence}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnectionChannels + * @summary ConnectionChannels queries all the channels associated with a connection +end. + * @request GET:/ibc/core/channel/v1/connections/{connection}/channels + */ + queryConnectionChannels = ( + connection: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/channel/v1/connections/${connection}/channels`, + method: "GET", + query: query, + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types.ts new file mode 100755 index 0000000000..c4888a2d31 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types.ts @@ -0,0 +1,22 @@ +//@ts-nocheck +import { Channel } from "./types/ibc/core/channel/v1/channel" +import { IdentifiedChannel } from "./types/ibc/core/channel/v1/channel" +import { Counterparty } from "./types/ibc/core/channel/v1/channel" +import { Packet } from "./types/ibc/core/channel/v1/channel" +import { PacketState } from "./types/ibc/core/channel/v1/channel" +import { PacketId } from "./types/ibc/core/channel/v1/channel" +import { Acknowledgement } from "./types/ibc/core/channel/v1/channel" +import { PacketSequence } from "./types/ibc/core/channel/v1/genesis" + + +export { + Channel, + IdentifiedChannel, + Counterparty, + Packet, + PacketState, + PacketId, + Acknowledgement, + PacketSequence, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/upgrade/v1beta1/upgrade.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000000..4b2ecab4a4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,432 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + time: + | Date + | undefined; + /** The height at which the upgrade must be performed. */ + height: number; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + upgradedClientState: Any | undefined; +} + +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + * + * @deprecated + */ +export interface SoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan | undefined; +} + +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + * + * @deprecated + */ +export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} + +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: number; +} + +function createBasePlan(): Plan { + return { name: "", time: undefined, height: 0, info: "", upgradedClientState: undefined }; +} + +export const Plan = { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: Plan): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height ?? 0; + message.info = object.info ?? ""; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { title: "", description: "", plan: undefined }; +} + +export const SoftwareUpgradeProposal = { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; + }, + + toJSON(message: SoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + return message; + }, +}; + +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { title: "", description: "" }; +} + +export const CancelSoftwareUpgradeProposal = { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelSoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: CancelSoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I, + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseModuleVersion(): ModuleVersion { + return { name: "", version: 0 }; +} + +export const ModuleVersion = { + encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== 0) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? Number(object.version) : 0, + }; + }, + + toJSON(message: ModuleVersion): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = Math.round(message.version)); + return obj; + }, + + fromPartial, I>>(object: I): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/timestamp.ts new file mode 100644 index 0000000000..93776d9496 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/google/protobuf/timestamp.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/channel.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/channel.ts new file mode 100644 index 0000000000..196c44d7d1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/channel.ts @@ -0,0 +1,906 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Height } from "../../client/v1/client"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * packets. + */ + STATE_CLOSED = 4, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case 4: + case "STATE_CLOSED": + return State.STATE_CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.STATE_CLOSED: + return "STATE_CLOSED"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} + +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} + +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + case Order.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: + | Counterparty + | undefined; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; +} + +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: + | Counterparty + | undefined; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + portId: string; + /** channel identifier */ + channelId: string; +} + +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} + +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: number; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight: + | Height + | undefined; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: number; +} + +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: number; + /** embedded data that represents packet state. */ + data: Uint8Array; +} + +/** + * PacketId is an identifer for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketId { + /** channel port identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: number; +} + +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result: Uint8Array | undefined; + error: string | undefined; +} + +function createBaseChannel(): Channel { + return { state: 0, ordering: 0, counterparty: undefined, connectionHops: [], version: "" }; +} + +export const Channel = { + encode(message: Channel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Channel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Channel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "", + }; + }, + + toJSON(message: Channel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + return obj; + }, + + fromPartial, I>>(object: I): Channel { + const message = createBaseChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.connectionHops = object.connectionHops?.map((e) => e) || []; + message.version = object.version ?? ""; + return message; + }, +}; + +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { state: 0, ordering: 0, counterparty: undefined, connectionHops: [], version: "", portId: "", channelId: "" }; +} + +export const IdentifiedChannel = { + encode(message: IdentifiedChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(58).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedChannel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedChannel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "", + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: IdentifiedChannel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.connectionHops = object.connectionHops?.map((e) => e) || []; + message.version = object.version ?? ""; + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseCounterparty(): Counterparty { + return { portId: "", channelId: "" }; +} + +export const Counterparty = { + encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Counterparty { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>(object: I): Counterparty { + const message = createBaseCounterparty(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBasePacket(): Packet { + return { + sequence: 0, + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + data: new Uint8Array(), + timeoutHeight: undefined, + timeoutTimestamp: 0, + }; +} + +export const Packet = { + encode(message: Packet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sequence !== 0) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.timeoutTimestamp !== 0) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Packet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = longToNumber(reader.uint64() as Long); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Packet { + return { + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + destinationPort: isSet(object.destinationPort) ? String(object.destinationPort) : "", + destinationChannel: isSet(object.destinationChannel) ? String(object.destinationChannel) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? Number(object.timeoutTimestamp) : 0, + }; + }, + + toJSON(message: Packet): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); + message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timeoutHeight !== undefined + && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = Math.round(message.timeoutTimestamp)); + return obj; + }, + + fromPartial, I>>(object: I): Packet { + const message = createBasePacket(); + message.sequence = object.sequence ?? 0; + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.destinationPort = object.destinationPort ?? ""; + message.destinationChannel = object.destinationChannel ?? ""; + message.data = object.data ?? new Uint8Array(); + message.timeoutHeight = (object.timeoutHeight !== undefined && object.timeoutHeight !== null) + ? Height.fromPartial(object.timeoutHeight) + : undefined; + message.timeoutTimestamp = object.timeoutTimestamp ?? 0; + return message; + }, +}; + +function createBasePacketState(): PacketState { + return { portId: "", channelId: "", sequence: 0, data: new Uint8Array() }; +} + +export const PacketState = { + encode(message: PacketState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketState { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: PacketState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): PacketState { + const message = createBasePacketState(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 0; + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBasePacketId(): PacketId { + return { portId: "", channelId: "", sequence: 0 }; +} + +export const PacketId = { + encode(message: PacketId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketId { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketId { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: PacketId): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): PacketId { + const message = createBasePacketId(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseAcknowledgement(): Acknowledgement { + return { result: undefined, error: undefined }; +} + +export const Acknowledgement = { + encode(message: Acknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Acknowledgement { + return { + result: isSet(object.result) ? bytesFromBase64(object.result) : undefined, + error: isSet(object.error) ? String(object.error) : undefined, + }; + }, + + toJSON(message: Acknowledgement): unknown { + const obj: any = {}; + message.result !== undefined + && (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined); + message.error !== undefined && (obj.error = message.error); + return obj; + }, + + fromPartial, I>>(object: I): Acknowledgement { + const message = createBaseAcknowledgement(); + message.result = object.result ?? undefined; + message.error = object.error ?? undefined; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/genesis.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/genesis.ts new file mode 100644 index 0000000000..b453be0311 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/genesis.ts @@ -0,0 +1,302 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { IdentifiedChannel, PacketState } from "./channel"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisState { + channels: IdentifiedChannel[]; + acknowledgements: PacketState[]; + commitments: PacketState[]; + receipts: PacketState[]; + sendSequences: PacketSequence[]; + recvSequences: PacketSequence[]; + ackSequences: PacketSequence[]; + /** the sequence for the next generated channel identifier */ + nextChannelSequence: number; +} + +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequence { + portId: string; + channelId: string; + sequence: number; +} + +function createBaseGenesisState(): GenesisState { + return { + channels: [], + acknowledgements: [], + commitments: [], + receipts: [], + sendSequences: [], + recvSequences: [], + ackSequences: [], + nextChannelSequence: 0, + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.receipts) { + PacketState.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.sendSequences) { + PacketSequence.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.recvSequences) { + PacketSequence.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.ackSequences) { + PacketSequence.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.nextChannelSequence !== 0) { + writer.uint32(64).uint64(message.nextChannelSequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 3: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 4: + message.receipts.push(PacketState.decode(reader, reader.uint32())); + break; + case 5: + message.sendSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 6: + message.recvSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 7: + message.ackSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 8: + message.nextChannelSequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + acknowledgements: Array.isArray(object?.acknowledgements) + ? object.acknowledgements.map((e: any) => PacketState.fromJSON(e)) + : [], + commitments: Array.isArray(object?.commitments) + ? object.commitments.map((e: any) => PacketState.fromJSON(e)) + : [], + receipts: Array.isArray(object?.receipts) ? object.receipts.map((e: any) => PacketState.fromJSON(e)) : [], + sendSequences: Array.isArray(object?.sendSequences) + ? object.sendSequences.map((e: any) => PacketSequence.fromJSON(e)) + : [], + recvSequences: Array.isArray(object?.recvSequences) + ? object.recvSequences.map((e: any) => PacketSequence.fromJSON(e)) + : [], + ackSequences: Array.isArray(object?.ackSequences) + ? object.ackSequences.map((e: any) => PacketSequence.fromJSON(e)) + : [], + nextChannelSequence: isSet(object.nextChannelSequence) ? Number(object.nextChannelSequence) : 0, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map((e) => e ? PacketState.toJSON(e) : undefined); + } else { + obj.acknowledgements = []; + } + if (message.commitments) { + obj.commitments = message.commitments.map((e) => e ? PacketState.toJSON(e) : undefined); + } else { + obj.commitments = []; + } + if (message.receipts) { + obj.receipts = message.receipts.map((e) => e ? PacketState.toJSON(e) : undefined); + } else { + obj.receipts = []; + } + if (message.sendSequences) { + obj.sendSequences = message.sendSequences.map((e) => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.sendSequences = []; + } + if (message.recvSequences) { + obj.recvSequences = message.recvSequences.map((e) => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.recvSequences = []; + } + if (message.ackSequences) { + obj.ackSequences = message.ackSequences.map((e) => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.ackSequences = []; + } + message.nextChannelSequence !== undefined && (obj.nextChannelSequence = Math.round(message.nextChannelSequence)); + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; + message.acknowledgements = object.acknowledgements?.map((e) => PacketState.fromPartial(e)) || []; + message.commitments = object.commitments?.map((e) => PacketState.fromPartial(e)) || []; + message.receipts = object.receipts?.map((e) => PacketState.fromPartial(e)) || []; + message.sendSequences = object.sendSequences?.map((e) => PacketSequence.fromPartial(e)) || []; + message.recvSequences = object.recvSequences?.map((e) => PacketSequence.fromPartial(e)) || []; + message.ackSequences = object.ackSequences?.map((e) => PacketSequence.fromPartial(e)) || []; + message.nextChannelSequence = object.nextChannelSequence ?? 0; + return message; + }, +}; + +function createBasePacketSequence(): PacketSequence { + return { portId: "", channelId: "", sequence: 0 }; +} + +export const PacketSequence = { + encode(message: PacketSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketSequence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketSequence { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: PacketSequence): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): PacketSequence { + const message = createBasePacketSequence(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/query.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/query.ts new file mode 100644 index 0000000000..938b8c17d0 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/query.ts @@ -0,0 +1,2473 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; +import { Height, IdentifiedClientState } from "../../client/v1/client"; +import { Channel, IdentifiedChannel, PacketState } from "./channel"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ +export interface QueryChannelRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. + */ +export interface QueryChannelResponse { + /** channel associated with the request identifiers */ + channel: + | Channel + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ +export interface QueryChannelsRequest { + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ +export interface QueryChannelsResponse { + /** list of stored channels of the chain. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination: + | PageResponse + | undefined; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequest { + /** connection unique identifier */ + connection: string; + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponse { + /** list of channels associated with a connection. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination: + | PageResponse + | undefined; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponse { + /** client state associated with the channel */ + identifiedClientState: + | IdentifiedClientState + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** revision number of the consensus state */ + revisionNumber: number; + /** revision height of the consensus state */ + revisionHeight: number; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState: + | Any + | undefined; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: number; +} + +/** + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved + */ +export interface QueryPacketCommitmentResponse { + /** packet associated with the request fields */ + commitment: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponse { + commitments: PacketState[]; + /** pagination response */ + pagination: + | PageResponse + | undefined; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: number; +} + +/** + * QueryPacketReceiptResponse defines the client query response for a packet + * receipt which also includes a proof, and the height from which the proof was + * retrieved + */ +export interface QueryPacketReceiptResponse { + /** success flag for if receipt exists */ + received: boolean; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: number; +} + +/** + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved + */ +export interface QueryPacketAcknowledgementResponse { + /** packet associated with the request fields */ + acknowledgement: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination: + | PageRequest + | undefined; + /** list of packet sequences */ + packetCommitmentSequences: number[]; +} + +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponse { + acknowledgements: PacketState[]; + /** pagination response */ + pagination: + | PageResponse + | undefined; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of packet sequences */ + packetCommitmentSequences: number[]; +} + +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponse { + /** list of unreceived packet sequences */ + sequences: number[]; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of acknowledgement sequences */ + packetAckSequences: number[]; +} + +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponse { + /** list of unreceived acknowledgement sequences */ + sequences: number[]; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponse { + /** next sequence receive number */ + nextSequenceReceive: number; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +function createBaseQueryChannelRequest(): QueryChannelRequest { + return { portId: "", channelId: "" }; +} + +export const QueryChannelRequest = { + encode(message: QueryChannelRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: QueryChannelRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>(object: I): QueryChannelRequest { + const message = createBaseQueryChannelRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseQueryChannelResponse(): QueryChannelResponse { + return { channel: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryChannelResponse = { + encode(message: QueryChannelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelResponse { + return { + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryChannelResponse): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryChannelResponse { + const message = createBaseQueryChannelResponse(); + message.channel = (object.channel !== undefined && object.channel !== null) + ? Channel.fromPartial(object.channel) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryChannelsRequest(): QueryChannelsRequest { + return { pagination: undefined }; +} + +export const QueryChannelsRequest = { + encode(message: QueryChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelsRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryChannelsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryChannelsRequest { + const message = createBaseQueryChannelsRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryChannelsResponse(): QueryChannelsResponse { + return { channels: [], pagination: undefined, height: undefined }; +} + +export const QueryChannelsResponse = { + encode(message: QueryChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelsResponse { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryChannelsResponse { + const message = createBaseQueryChannelsResponse(); + message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionChannelsRequest(): QueryConnectionChannelsRequest { + return { connection: "", pagination: undefined }; +} + +export const QueryConnectionChannelsRequest = { + encode(message: QueryConnectionChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connection !== "") { + writer.uint32(10).string(message.connection); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionChannelsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionChannelsRequest { + return { + connection: isSet(object.connection) ? String(object.connection) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryConnectionChannelsRequest): unknown { + const obj: any = {}; + message.connection !== undefined && (obj.connection = message.connection); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionChannelsRequest { + const message = createBaseQueryConnectionChannelsRequest(); + message.connection = object.connection ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionChannelsResponse(): QueryConnectionChannelsResponse { + return { channels: [], pagination: undefined, height: undefined }; +} + +export const QueryConnectionChannelsResponse = { + encode(message: QueryConnectionChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionChannelsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionChannelsResponse { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryConnectionChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionChannelsResponse { + const message = createBaseQueryConnectionChannelsResponse(); + message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryChannelClientStateRequest(): QueryChannelClientStateRequest { + return { portId: "", channelId: "" }; +} + +export const QueryChannelClientStateRequest = { + encode(message: QueryChannelClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelClientStateRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: QueryChannelClientStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryChannelClientStateRequest { + const message = createBaseQueryChannelClientStateRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseQueryChannelClientStateResponse(): QueryChannelClientStateResponse { + return { identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryChannelClientStateResponse = { + encode(message: QueryChannelClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelClientStateResponse { + return { + identifiedClientState: isSet(object.identifiedClientState) + ? IdentifiedClientState.fromJSON(object.identifiedClientState) + : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryChannelClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryChannelClientStateResponse { + const message = createBaseQueryChannelClientStateResponse(); + message.identifiedClientState = + (object.identifiedClientState !== undefined && object.identifiedClientState !== null) + ? IdentifiedClientState.fromPartial(object.identifiedClientState) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryChannelConsensusStateRequest(): QueryChannelConsensusStateRequest { + return { portId: "", channelId: "", revisionNumber: 0, revisionHeight: 0 }; +} + +export const QueryChannelConsensusStateRequest = { + encode(message: QueryChannelConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.revisionNumber !== 0) { + writer.uint32(24).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(32).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 4: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelConsensusStateRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: QueryChannelConsensusStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryChannelConsensusStateRequest { + const message = createBaseQueryChannelConsensusStateRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusStateResponse { + return { consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryChannelConsensusStateResponse = { + encode(message: QueryChannelConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + clientId: isSet(object.clientId) ? String(object.clientId) : "", + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryChannelConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryChannelConsensusStateResponse { + const message = createBaseQueryChannelConsensusStateResponse(); + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketCommitmentRequest(): QueryPacketCommitmentRequest { + return { portId: "", channelId: "", sequence: 0 }; +} + +export const QueryPacketCommitmentRequest = { + encode(message: QueryPacketCommitmentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: QueryPacketCommitmentRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): QueryPacketCommitmentRequest { + const message = createBaseQueryPacketCommitmentRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseQueryPacketCommitmentResponse(): QueryPacketCommitmentResponse { + return { commitment: new Uint8Array(), proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryPacketCommitmentResponse = { + encode(message: QueryPacketCommitmentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.commitment.length !== 0) { + writer.uint32(10).bytes(message.commitment); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitment = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentResponse { + return { + commitment: isSet(object.commitment) ? bytesFromBase64(object.commitment) : new Uint8Array(), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryPacketCommitmentResponse): unknown { + const obj: any = {}; + message.commitment !== undefined + && (obj.commitment = base64FromBytes(message.commitment !== undefined ? message.commitment : new Uint8Array())); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketCommitmentResponse { + const message = createBaseQueryPacketCommitmentResponse(); + message.commitment = object.commitment ?? new Uint8Array(); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketCommitmentsRequest(): QueryPacketCommitmentsRequest { + return { portId: "", channelId: "", pagination: undefined }; +} + +export const QueryPacketCommitmentsRequest = { + encode(message: QueryPacketCommitmentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryPacketCommitmentsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketCommitmentsRequest { + const message = createBaseQueryPacketCommitmentsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketCommitmentsResponse(): QueryPacketCommitmentsResponse { + return { commitments: [], pagination: undefined, height: undefined }; +} + +export const QueryPacketCommitmentsResponse = { + encode(message: QueryPacketCommitmentsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketCommitmentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentsResponse { + return { + commitments: Array.isArray(object?.commitments) + ? object.commitments.map((e: any) => PacketState.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryPacketCommitmentsResponse): unknown { + const obj: any = {}; + if (message.commitments) { + obj.commitments = message.commitments.map((e) => e ? PacketState.toJSON(e) : undefined); + } else { + obj.commitments = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketCommitmentsResponse { + const message = createBaseQueryPacketCommitmentsResponse(); + message.commitments = object.commitments?.map((e) => PacketState.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketReceiptRequest(): QueryPacketReceiptRequest { + return { portId: "", channelId: "", sequence: 0 }; +} + +export const QueryPacketReceiptRequest = { + encode(message: QueryPacketReceiptRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketReceiptRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketReceiptRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: QueryPacketReceiptRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): QueryPacketReceiptRequest { + const message = createBaseQueryPacketReceiptRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseQueryPacketReceiptResponse(): QueryPacketReceiptResponse { + return { received: false, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryPacketReceiptResponse = { + encode(message: QueryPacketReceiptResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.received === true) { + writer.uint32(16).bool(message.received); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketReceiptResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.received = reader.bool(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketReceiptResponse { + return { + received: isSet(object.received) ? Boolean(object.received) : false, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryPacketReceiptResponse): unknown { + const obj: any = {}; + message.received !== undefined && (obj.received = message.received); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryPacketReceiptResponse { + const message = createBaseQueryPacketReceiptResponse(); + message.received = object.received ?? false; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketAcknowledgementRequest(): QueryPacketAcknowledgementRequest { + return { portId: "", channelId: "", sequence: 0 }; +} + +export const QueryPacketAcknowledgementRequest = { + encode(message: QueryPacketAcknowledgementRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== 0) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: QueryPacketAcknowledgementRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketAcknowledgementRequest { + const message = createBaseQueryPacketAcknowledgementRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence ?? 0; + return message; + }, +}; + +function createBaseQueryPacketAcknowledgementResponse(): QueryPacketAcknowledgementResponse { + return { acknowledgement: new Uint8Array(), proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryPacketAcknowledgementResponse = { + encode(message: QueryPacketAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.acknowledgement.length !== 0) { + writer.uint32(10).bytes(message.acknowledgement); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgement = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementResponse { + return { + acknowledgement: isSet(object.acknowledgement) ? bytesFromBase64(object.acknowledgement) : new Uint8Array(), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryPacketAcknowledgementResponse): unknown { + const obj: any = {}; + message.acknowledgement !== undefined + && (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketAcknowledgementResponse { + const message = createBaseQueryPacketAcknowledgementResponse(); + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryPacketAcknowledgementsRequest(): QueryPacketAcknowledgementsRequest { + return { portId: "", channelId: "", pagination: undefined, packetCommitmentSequences: [] }; +} + +export const QueryPacketAcknowledgementsRequest = { + encode(message: QueryPacketAcknowledgementsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.packetCommitmentSequences.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences) + ? object.packetCommitmentSequences.map((e: any) => Number(e)) + : [], + }; + }, + + toJSON(message: QueryPacketAcknowledgementsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => Math.round(e)); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketAcknowledgementsRequest { + const message = createBaseQueryPacketAcknowledgementsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + message.packetCommitmentSequences = object.packetCommitmentSequences?.map((e) => e) || []; + return message; + }, +}; + +function createBaseQueryPacketAcknowledgementsResponse(): QueryPacketAcknowledgementsResponse { + return { acknowledgements: [], pagination: undefined, height: undefined }; +} + +export const QueryPacketAcknowledgementsResponse = { + encode(message: QueryPacketAcknowledgementsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPacketAcknowledgementsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementsResponse { + return { + acknowledgements: Array.isArray(object?.acknowledgements) + ? object.acknowledgements.map((e: any) => PacketState.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryPacketAcknowledgementsResponse): unknown { + const obj: any = {}; + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map((e) => e ? PacketState.toJSON(e) : undefined); + } else { + obj.acknowledgements = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryPacketAcknowledgementsResponse { + const message = createBaseQueryPacketAcknowledgementsResponse(); + message.acknowledgements = object.acknowledgements?.map((e) => PacketState.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryUnreceivedPacketsRequest(): QueryUnreceivedPacketsRequest { + return { portId: "", channelId: "", packetCommitmentSequences: [] }; +} + +export const QueryUnreceivedPacketsRequest = { + encode(message: QueryUnreceivedPacketsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedPacketsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.packetCommitmentSequences.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedPacketsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences) + ? object.packetCommitmentSequences.map((e: any) => Number(e)) + : [], + }; + }, + + toJSON(message: QueryUnreceivedPacketsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => Math.round(e)); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryUnreceivedPacketsRequest { + const message = createBaseQueryUnreceivedPacketsRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.packetCommitmentSequences = object.packetCommitmentSequences?.map((e) => e) || []; + return message; + }, +}; + +function createBaseQueryUnreceivedPacketsResponse(): QueryUnreceivedPacketsResponse { + return { sequences: [], height: undefined }; +} + +export const QueryUnreceivedPacketsResponse = { + encode(message: QueryUnreceivedPacketsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedPacketsResponse(); + 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.sequences.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.sequences.push(longToNumber(reader.uint64() as Long)); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedPacketsResponse { + return { + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Number(e)) : [], + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryUnreceivedPacketsResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => Math.round(e)); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryUnreceivedPacketsResponse { + const message = createBaseQueryUnreceivedPacketsResponse(); + message.sequences = object.sequences?.map((e) => e) || []; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryUnreceivedAcksRequest(): QueryUnreceivedAcksRequest { + return { portId: "", channelId: "", packetAckSequences: [] }; +} + +export const QueryUnreceivedAcksRequest = { + encode(message: QueryUnreceivedAcksRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetAckSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedAcksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetAckSequences.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.packetAckSequences.push(longToNumber(reader.uint64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedAcksRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + packetAckSequences: Array.isArray(object?.packetAckSequences) + ? object.packetAckSequences.map((e: any) => Number(e)) + : [], + }; + }, + + toJSON(message: QueryUnreceivedAcksRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetAckSequences) { + obj.packetAckSequences = message.packetAckSequences.map((e) => Math.round(e)); + } else { + obj.packetAckSequences = []; + } + return obj; + }, + + fromPartial, I>>(object: I): QueryUnreceivedAcksRequest { + const message = createBaseQueryUnreceivedAcksRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.packetAckSequences = object.packetAckSequences?.map((e) => e) || []; + return message; + }, +}; + +function createBaseQueryUnreceivedAcksResponse(): QueryUnreceivedAcksResponse { + return { sequences: [], height: undefined }; +} + +export const QueryUnreceivedAcksResponse = { + encode(message: QueryUnreceivedAcksResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnreceivedAcksResponse(); + 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.sequences.push(longToNumber(reader.uint64() as Long)); + } + } else { + message.sequences.push(longToNumber(reader.uint64() as Long)); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedAcksResponse { + return { + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Number(e)) : [], + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryUnreceivedAcksResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => Math.round(e)); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryUnreceivedAcksResponse { + const message = createBaseQueryUnreceivedAcksResponse(); + message.sequences = object.sequences?.map((e) => e) || []; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryNextSequenceReceiveRequest(): QueryNextSequenceReceiveRequest { + return { portId: "", channelId: "" }; +} + +export const QueryNextSequenceReceiveRequest = { + encode(message: QueryNextSequenceReceiveRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceReceiveRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNextSequenceReceiveRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: QueryNextSequenceReceiveRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryNextSequenceReceiveRequest { + const message = createBaseQueryNextSequenceReceiveRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseQueryNextSequenceReceiveResponse(): QueryNextSequenceReceiveResponse { + return { nextSequenceReceive: 0, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryNextSequenceReceiveResponse = { + encode(message: QueryNextSequenceReceiveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextSequenceReceive !== 0) { + writer.uint32(8).uint64(message.nextSequenceReceive); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceReceiveResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceReceive = longToNumber(reader.uint64() as Long); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNextSequenceReceiveResponse { + return { + nextSequenceReceive: isSet(object.nextSequenceReceive) ? Number(object.nextSequenceReceive) : 0, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryNextSequenceReceiveResponse): unknown { + const obj: any = {}; + message.nextSequenceReceive !== undefined && (obj.nextSequenceReceive = Math.round(message.nextSequenceReceive)); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryNextSequenceReceiveResponse { + const message = createBaseQueryNextSequenceReceiveResponse(); + message.nextSequenceReceive = object.nextSequenceReceive ?? 0; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Channel queries an IBC Channel. */ + Channel(request: QueryChannelRequest): Promise; + /** Channels queries all the IBC channels of a chain. */ + Channels(request: QueryChannelsRequest): Promise; + /** + * ConnectionChannels queries all the channels associated with a connection + * end. + */ + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise; + /** + * ChannelClientState queries for the client state for the channel associated + * with the provided channel identifiers. + */ + ChannelClientState(request: QueryChannelClientStateRequest): Promise; + /** + * ChannelConsensusState queries for the consensus state for the channel + * associated with the provided channel identifiers. + */ + ChannelConsensusState(request: QueryChannelConsensusStateRequest): Promise; + /** PacketCommitment queries a stored packet commitment hash. */ + PacketCommitment(request: QueryPacketCommitmentRequest): Promise; + /** + * PacketCommitments returns all the packet commitments hashes associated + * with a channel. + */ + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise; + /** + * PacketReceipt queries if a given packet sequence has been received on the + * queried chain + */ + PacketReceipt(request: QueryPacketReceiptRequest): Promise; + /** PacketAcknowledgement queries a stored packet acknowledgement hash. */ + PacketAcknowledgement(request: QueryPacketAcknowledgementRequest): Promise; + /** + * PacketAcknowledgements returns all the packet acknowledgements associated + * with a channel. + */ + PacketAcknowledgements(request: QueryPacketAcknowledgementsRequest): Promise; + /** + * UnreceivedPackets returns all the unreceived IBC packets associated with a + * channel and sequences. + */ + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; + /** + * UnreceivedAcks returns all the unreceived IBC acknowledgements associated + * with a channel and sequences. + */ + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; + /** NextSequenceReceive returns the next receive sequence for a given channel. */ + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Channel = this.Channel.bind(this); + this.Channels = this.Channels.bind(this); + this.ConnectionChannels = this.ConnectionChannels.bind(this); + this.ChannelClientState = this.ChannelClientState.bind(this); + this.ChannelConsensusState = this.ChannelConsensusState.bind(this); + this.PacketCommitment = this.PacketCommitment.bind(this); + this.PacketCommitments = this.PacketCommitments.bind(this); + this.PacketReceipt = this.PacketReceipt.bind(this); + this.PacketAcknowledgement = this.PacketAcknowledgement.bind(this); + this.PacketAcknowledgements = this.PacketAcknowledgements.bind(this); + this.UnreceivedPackets = this.UnreceivedPackets.bind(this); + this.UnreceivedAcks = this.UnreceivedAcks.bind(this); + this.NextSequenceReceive = this.NextSequenceReceive.bind(this); + } + Channel(request: QueryChannelRequest): Promise { + const data = QueryChannelRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channel", data); + return promise.then((data) => QueryChannelResponse.decode(new _m0.Reader(data))); + } + + Channels(request: QueryChannelsRequest): Promise { + const data = QueryChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channels", data); + return promise.then((data) => QueryChannelsResponse.decode(new _m0.Reader(data))); + } + + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise { + const data = QueryConnectionChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ConnectionChannels", data); + return promise.then((data) => QueryConnectionChannelsResponse.decode(new _m0.Reader(data))); + } + + ChannelClientState(request: QueryChannelClientStateRequest): Promise { + const data = QueryChannelClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelClientState", data); + return promise.then((data) => QueryChannelClientStateResponse.decode(new _m0.Reader(data))); + } + + ChannelConsensusState(request: QueryChannelConsensusStateRequest): Promise { + const data = QueryChannelConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelConsensusState", data); + return promise.then((data) => QueryChannelConsensusStateResponse.decode(new _m0.Reader(data))); + } + + PacketCommitment(request: QueryPacketCommitmentRequest): Promise { + const data = QueryPacketCommitmentRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitment", data); + return promise.then((data) => QueryPacketCommitmentResponse.decode(new _m0.Reader(data))); + } + + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise { + const data = QueryPacketCommitmentsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitments", data); + return promise.then((data) => QueryPacketCommitmentsResponse.decode(new _m0.Reader(data))); + } + + PacketReceipt(request: QueryPacketReceiptRequest): Promise { + const data = QueryPacketReceiptRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketReceipt", data); + return promise.then((data) => QueryPacketReceiptResponse.decode(new _m0.Reader(data))); + } + + PacketAcknowledgement(request: QueryPacketAcknowledgementRequest): Promise { + const data = QueryPacketAcknowledgementRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgement", data); + return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new _m0.Reader(data))); + } + + PacketAcknowledgements(request: QueryPacketAcknowledgementsRequest): Promise { + const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgements", data); + return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new _m0.Reader(data))); + } + + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { + const data = QueryUnreceivedPacketsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedPackets", data); + return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new _m0.Reader(data))); + } + + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { + const data = QueryUnreceivedAcksRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedAcks", data); + return promise.then((data) => QueryUnreceivedAcksResponse.decode(new _m0.Reader(data))); + } + + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { + const data = QueryNextSequenceReceiveRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); + return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.ts new file mode 100644 index 0000000000..a1b45d517d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.ts @@ -0,0 +1,1797 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Height } from "../../client/v1/client"; +import { Channel, Packet } from "./channel"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** ResponseResultType defines the possible outcomes of the execution of a message */ +export enum ResponseResultType { + /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0, + /** RESPONSE_RESULT_TYPE_NOOP - The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) */ + RESPONSE_RESULT_TYPE_NOOP = 1, + /** RESPONSE_RESULT_TYPE_SUCCESS - The message was executed successfully */ + RESPONSE_RESULT_TYPE_SUCCESS = 2, + UNRECOGNIZED = -1, +} + +export function responseResultTypeFromJSON(object: any): ResponseResultType { + switch (object) { + case 0: + case "RESPONSE_RESULT_TYPE_UNSPECIFIED": + return ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED; + case 1: + case "RESPONSE_RESULT_TYPE_NOOP": + return ResponseResultType.RESPONSE_RESULT_TYPE_NOOP; + case 2: + case "RESPONSE_RESULT_TYPE_SUCCESS": + return ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS; + case -1: + case "UNRECOGNIZED": + default: + return ResponseResultType.UNRECOGNIZED; + } +} + +export function responseResultTypeToJSON(object: ResponseResultType): string { + switch (object) { + case ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED: + return "RESPONSE_RESULT_TYPE_UNSPECIFIED"; + case ResponseResultType.RESPONSE_RESULT_TYPE_NOOP: + return "RESPONSE_RESULT_TYPE_NOOP"; + case ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS: + return "RESPONSE_RESULT_TYPE_SUCCESS"; + case ResponseResultType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string; + channel: Channel | undefined; + signer: string; +} + +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse { + channelId: string; + version: string; +} + +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTry { + portId: string; + /** + * Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. + * + * @deprecated + */ + previousChannelId: string; + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: Channel | undefined; + counterpartyVersion: string; + proofInit: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse { + version: string; + channelId: string; +} + +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAck { + portId: string; + channelId: string; + counterpartyChannelId: string; + counterpartyVersion: string; + proofTry: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse { +} + +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string; + channelId: string; + proofAck: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponse { +} + +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string; + channelId: string; + signer: string; +} + +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse { +} + +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string; + channelId: string; + proofInit: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponse { +} + +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet: Packet | undefined; + proofCommitment: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse { + result: ResponseResultType; +} + +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet | undefined; + proofUnreceived: Uint8Array; + proofHeight: Height | undefined; + nextSequenceRecv: number; + signer: string; +} + +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse { + result: ResponseResultType; +} + +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet | undefined; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight: Height | undefined; + nextSequenceRecv: number; + signer: string; +} + +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse { + result: ResponseResultType; +} + +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet: Packet | undefined; + acknowledgement: Uint8Array; + proofAcked: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse { + result: ResponseResultType; +} + +function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { + return { portId: "", channel: undefined, signer: "" }; +} + +export const MsgChannelOpenInit = { + encode(message: MsgChannelOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenInit { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelOpenInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit(); + message.portId = object.portId ?? ""; + message.channel = (object.channel !== undefined && object.channel !== null) + ? Channel.fromPartial(object.channel) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { + return { channelId: "", version: "" }; +} + +export const MsgChannelOpenInitResponse = { + encode(message: MsgChannelOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenInitResponse { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + version: isSet(object.version) ? String(object.version) : "", + }; + }, + + toJSON(message: MsgChannelOpenInitResponse): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.version !== undefined && (obj.version = message.version); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse(); + message.channelId = object.channelId ?? ""; + message.version = object.version ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { + return { + portId: "", + previousChannelId: "", + channel: undefined, + counterpartyVersion: "", + proofInit: new Uint8Array(), + proofHeight: undefined, + signer: "", + }; +} + +export const MsgChannelOpenTry = { + encode(message: MsgChannelOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.previousChannelId !== "") { + writer.uint32(18).string(message.previousChannelId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenTry { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + previousChannelId: isSet(object.previousChannelId) ? String(object.previousChannelId) : "", + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + counterpartyVersion: isSet(object.counterpartyVersion) ? String(object.counterpartyVersion) : "", + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelOpenTry): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.previousChannelId !== undefined && (obj.previousChannelId = message.previousChannelId); + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofInit !== undefined + && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry(); + message.portId = object.portId ?? ""; + message.previousChannelId = object.previousChannelId ?? ""; + message.channel = (object.channel !== undefined && object.channel !== null) + ? Channel.fromPartial(object.channel) + : undefined; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { + return { version: "", channelId: "" }; +} + +export const MsgChannelOpenTryResponse = { + encode(message: MsgChannelOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenTryResponse { + return { + version: isSet(object.version) ? String(object.version) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + }; + }, + + toJSON(message: MsgChannelOpenTryResponse): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse(); + message.version = object.version ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { + return { + portId: "", + channelId: "", + counterpartyChannelId: "", + counterpartyVersion: "", + proofTry: new Uint8Array(), + proofHeight: undefined, + signer: "", + }; +} + +export const MsgChannelOpenAck = { + encode(message: MsgChannelOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelId !== "") { + writer.uint32(26).string(message.counterpartyChannelId); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAck { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenAck { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyChannelId: isSet(object.counterpartyChannelId) ? String(object.counterpartyChannelId) : "", + counterpartyVersion: isSet(object.counterpartyVersion) ? String(object.counterpartyVersion) : "", + proofTry: isSet(object.proofTry) ? bytesFromBase64(object.proofTry) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelOpenAck): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannelId !== undefined && (obj.counterpartyChannelId = message.counterpartyChannelId); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofTry !== undefined + && (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelId = object.counterpartyChannelId ?? ""; + message.counterpartyVersion = object.counterpartyVersion ?? ""; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { + return {}; +} + +export const MsgChannelOpenAckResponse = { + encode(_: MsgChannelOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenAckResponse { + return {}; + }, + + toJSON(_: MsgChannelOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse(); + return message; + }, +}; + +function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { + return { portId: "", channelId: "", proofAck: new Uint8Array(), proofHeight: undefined, signer: "" }; +} + +export const MsgChannelOpenConfirm = { + encode(message: MsgChannelOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenConfirm { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + proofAck: isSet(object.proofAck) ? bytesFromBase64(object.proofAck) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelOpenConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofAck !== undefined + && (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmResponse { + return {}; +} + +export const MsgChannelOpenConfirmResponse = { + encode(_: MsgChannelOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenConfirmResponse { + return {}; + }, + + toJSON(_: MsgChannelOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; + }, +}; + +function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { + return { portId: "", channelId: "", signer: "" }; +} + +export const MsgChannelCloseInit = { + encode(message: MsgChannelCloseInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelCloseInit { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelCloseInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { + return {}; +} + +export const MsgChannelCloseInitResponse = { + encode(_: MsgChannelCloseInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelCloseInitResponse { + return {}; + }, + + toJSON(_: MsgChannelCloseInitResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse(); + return message; + }, +}; + +function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { + return { portId: "", channelId: "", proofInit: new Uint8Array(), proofHeight: undefined, signer: "" }; +} + +export const MsgChannelCloseConfirm = { + encode(message: MsgChannelCloseConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelCloseConfirm { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgChannelCloseConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofInit !== undefined + && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmResponse { + return {}; +} + +export const MsgChannelCloseConfirmResponse = { + encode(_: MsgChannelCloseConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelCloseConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelCloseConfirmResponse { + return {}; + }, + + toJSON(_: MsgChannelCloseConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; + }, +}; + +function createBaseMsgRecvPacket(): MsgRecvPacket { + return { packet: undefined, proofCommitment: new Uint8Array(), proofHeight: undefined, signer: "" }; +} + +export const MsgRecvPacket = { + encode(message: MsgRecvPacket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgRecvPacket { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofCommitment: isSet(object.proofCommitment) ? bytesFromBase64(object.proofCommitment) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgRecvPacket): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofCommitment !== undefined + && (obj.proofCommitment = base64FromBytes( + message.proofCommitment !== undefined ? message.proofCommitment : new Uint8Array(), + )); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgRecvPacket { + const message = createBaseMsgRecvPacket(); + message.packet = (object.packet !== undefined && object.packet !== null) + ? Packet.fromPartial(object.packet) + : undefined; + message.proofCommitment = object.proofCommitment ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { + return { result: 0 }; +} + +export const MsgRecvPacketResponse = { + encode(message: MsgRecvPacketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecvPacketResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgRecvPacketResponse { + return { result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : 0 }; + }, + + toJSON(message: MsgRecvPacketResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + + fromPartial, I>>(object: I): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse(); + message.result = object.result ?? 0; + return message; + }, +}; + +function createBaseMsgTimeout(): MsgTimeout { + return { + packet: undefined, + proofUnreceived: new Uint8Array(), + proofHeight: undefined, + nextSequenceRecv: 0, + signer: "", + }; +} + +export const MsgTimeout = { + encode(message: MsgTimeout, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.nextSequenceRecv !== 0) { + writer.uint32(32).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = longToNumber(reader.uint64() as Long); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeout { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofUnreceived: isSet(object.proofUnreceived) ? bytesFromBase64(object.proofUnreceived) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + nextSequenceRecv: isSet(object.nextSequenceRecv) ? Number(object.nextSequenceRecv) : 0, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgTimeout): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined + && (obj.proofUnreceived = base64FromBytes( + message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array(), + )); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && (obj.nextSequenceRecv = Math.round(message.nextSequenceRecv)); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgTimeout { + const message = createBaseMsgTimeout(); + message.packet = (object.packet !== undefined && object.packet !== null) + ? Packet.fromPartial(object.packet) + : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.nextSequenceRecv = object.nextSequenceRecv ?? 0; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { + return { result: 0 }; +} + +export const MsgTimeoutResponse = { + encode(message: MsgTimeoutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeoutResponse { + return { result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : 0 }; + }, + + toJSON(message: MsgTimeoutResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + + fromPartial, I>>(object: I): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse(); + message.result = object.result ?? 0; + return message; + }, +}; + +function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { + return { + packet: undefined, + proofUnreceived: new Uint8Array(), + proofClose: new Uint8Array(), + proofHeight: undefined, + nextSequenceRecv: 0, + signer: "", + }; +} + +export const MsgTimeoutOnClose = { + encode(message: MsgTimeoutOnClose, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.nextSequenceRecv !== 0) { + writer.uint32(40).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnClose { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = longToNumber(reader.uint64() as Long); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeoutOnClose { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofUnreceived: isSet(object.proofUnreceived) ? bytesFromBase64(object.proofUnreceived) : new Uint8Array(), + proofClose: isSet(object.proofClose) ? bytesFromBase64(object.proofClose) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + nextSequenceRecv: isSet(object.nextSequenceRecv) ? Number(object.nextSequenceRecv) : 0, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgTimeoutOnClose): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined + && (obj.proofUnreceived = base64FromBytes( + message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array(), + )); + message.proofClose !== undefined + && (obj.proofClose = base64FromBytes(message.proofClose !== undefined ? message.proofClose : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && (obj.nextSequenceRecv = Math.round(message.nextSequenceRecv)); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose(); + message.packet = (object.packet !== undefined && object.packet !== null) + ? Packet.fromPartial(object.packet) + : undefined; + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array(); + message.proofClose = object.proofClose ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.nextSequenceRecv = object.nextSequenceRecv ?? 0; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { + return { result: 0 }; +} + +export const MsgTimeoutOnCloseResponse = { + encode(message: MsgTimeoutOnCloseResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTimeoutOnCloseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeoutOnCloseResponse { + return { result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : 0 }; + }, + + toJSON(message: MsgTimeoutOnCloseResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + + fromPartial, I>>(object: I): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse(); + message.result = object.result ?? 0; + return message; + }, +}; + +function createBaseMsgAcknowledgement(): MsgAcknowledgement { + return { + packet: undefined, + acknowledgement: new Uint8Array(), + proofAcked: new Uint8Array(), + proofHeight: undefined, + signer: "", + }; +} + +export const MsgAcknowledgement = { + encode(message: MsgAcknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAcknowledgement { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + acknowledgement: isSet(object.acknowledgement) ? bytesFromBase64(object.acknowledgement) : new Uint8Array(), + proofAcked: isSet(object.proofAcked) ? bytesFromBase64(object.proofAcked) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgAcknowledgement): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.acknowledgement !== undefined + && (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + message.proofAcked !== undefined + && (obj.proofAcked = base64FromBytes(message.proofAcked !== undefined ? message.proofAcked : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement(); + message.packet = (object.packet !== undefined && object.packet !== null) + ? Packet.fromPartial(object.packet) + : undefined; + message.acknowledgement = object.acknowledgement ?? new Uint8Array(); + message.proofAcked = object.proofAcked ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { + return { result: 0 }; +} + +export const MsgAcknowledgementResponse = { + encode(message: MsgAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAcknowledgementResponse { + return { result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : 0 }; + }, + + toJSON(message: MsgAcknowledgementResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + + fromPartial, I>>(object: I): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse(); + message.result = object.result ?? 0; + return message; + }, +}; + +/** Msg defines the ibc/channel Msg service. */ +export interface Msg { + /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ + ChannelOpenInit(request: MsgChannelOpenInit): Promise; + /** ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ + ChannelOpenTry(request: MsgChannelOpenTry): Promise; + /** ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ + ChannelOpenAck(request: MsgChannelOpenAck): Promise; + /** ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ + ChannelOpenConfirm(request: MsgChannelOpenConfirm): Promise; + /** ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ + ChannelCloseInit(request: MsgChannelCloseInit): Promise; + /** + * ChannelCloseConfirm defines a rpc handler method for + * MsgChannelCloseConfirm. + */ + ChannelCloseConfirm(request: MsgChannelCloseConfirm): Promise; + /** RecvPacket defines a rpc handler method for MsgRecvPacket. */ + RecvPacket(request: MsgRecvPacket): Promise; + /** Timeout defines a rpc handler method for MsgTimeout. */ + Timeout(request: MsgTimeout): Promise; + /** TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ + TimeoutOnClose(request: MsgTimeoutOnClose): Promise; + /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ + Acknowledgement(request: MsgAcknowledgement): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ChannelOpenInit = this.ChannelOpenInit.bind(this); + this.ChannelOpenTry = this.ChannelOpenTry.bind(this); + this.ChannelOpenAck = this.ChannelOpenAck.bind(this); + this.ChannelOpenConfirm = this.ChannelOpenConfirm.bind(this); + this.ChannelCloseInit = this.ChannelCloseInit.bind(this); + this.ChannelCloseConfirm = this.ChannelCloseConfirm.bind(this); + this.RecvPacket = this.RecvPacket.bind(this); + this.Timeout = this.Timeout.bind(this); + this.TimeoutOnClose = this.TimeoutOnClose.bind(this); + this.Acknowledgement = this.Acknowledgement.bind(this); + } + ChannelOpenInit(request: MsgChannelOpenInit): Promise { + const data = MsgChannelOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenInit", data); + return promise.then((data) => MsgChannelOpenInitResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenTry(request: MsgChannelOpenTry): Promise { + const data = MsgChannelOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenTry", data); + return promise.then((data) => MsgChannelOpenTryResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenAck(request: MsgChannelOpenAck): Promise { + const data = MsgChannelOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenAck", data); + return promise.then((data) => MsgChannelOpenAckResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenConfirm(request: MsgChannelOpenConfirm): Promise { + const data = MsgChannelOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenConfirm", data); + return promise.then((data) => MsgChannelOpenConfirmResponse.decode(new _m0.Reader(data))); + } + + ChannelCloseInit(request: MsgChannelCloseInit): Promise { + const data = MsgChannelCloseInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseInit", data); + return promise.then((data) => MsgChannelCloseInitResponse.decode(new _m0.Reader(data))); + } + + ChannelCloseConfirm(request: MsgChannelCloseConfirm): Promise { + const data = MsgChannelCloseConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseConfirm", data); + return promise.then((data) => MsgChannelCloseConfirmResponse.decode(new _m0.Reader(data))); + } + + RecvPacket(request: MsgRecvPacket): Promise { + const data = MsgRecvPacket.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "RecvPacket", data); + return promise.then((data) => MsgRecvPacketResponse.decode(new _m0.Reader(data))); + } + + Timeout(request: MsgTimeout): Promise { + const data = MsgTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Timeout", data); + return promise.then((data) => MsgTimeoutResponse.decode(new _m0.Reader(data))); + } + + TimeoutOnClose(request: MsgTimeoutOnClose): Promise { + const data = MsgTimeoutOnClose.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "TimeoutOnClose", data); + return promise.then((data) => MsgTimeoutOnCloseResponse.decode(new _m0.Reader(data))); + } + + Acknowledgement(request: MsgAcknowledgement): Promise { + const data = MsgAcknowledgement.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); + return promise.then((data) => MsgAcknowledgementResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/client/v1/client.ts b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/client/v1/client.ts new file mode 100644 index 0000000000..0f612c313b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.channel.v1/types/ibc/core/client/v1/client.ts @@ -0,0 +1,613 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState: Any | undefined; +} + +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: + | Height + | undefined; + /** consensus state */ + consensusState: Any | undefined; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} + +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + title: string; + description: string; + plan: + | Plan + | undefined; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState: Any | undefined; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: number; + /** the height within the given revision */ + revisionHeight: number; +} + +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} + +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { clientId: "", clientState: undefined }; +} + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + }; + }, + + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + return message; + }, +}; + +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { height: undefined, consensusState: undefined }; +} + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + }; + }, + + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + return message; + }, +}; + +function createBaseClientConsensusStates(): ClientConsensusStates { + return { clientId: "", consensusStates: [] }; +} + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) + ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { title: "", description: "", subjectClientId: "", substituteClientId: "" }; +} + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "", + }; + }, + + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, + + fromPartial, I>>(object: I): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, +}; + +function createBaseUpgradeProposal(): UpgradeProposal { + return { title: "", description: "", plan: undefined, upgradedClientState: undefined }; +} + +export const UpgradeProposal = { + encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: UpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseHeight(): Height { + return { revisionNumber: 0, revisionHeight: 0 }; +} + +export const Height = { + encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revisionNumber !== 0) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Height { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 2: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>(object: I): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseParams(): Params { + return { allowedClients: [] }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/index.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/module.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/module.ts new file mode 100755 index 0000000000..dcdb3cabf6 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/module.ts @@ -0,0 +1,115 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { IdentifiedClientState as typeIdentifiedClientState} from "./types" +import { ConsensusStateWithHeight as typeConsensusStateWithHeight} from "./types" +import { ClientConsensusStates as typeClientConsensusStates} from "./types" +import { ClientUpdateProposal as typeClientUpdateProposal} from "./types" +import { UpgradeProposal as typeUpgradeProposal} from "./types" +import { Height as typeHeight} from "./types" +import { Params as typeParams} from "./types" +import { GenesisMetadata as typeGenesisMetadata} from "./types" +import { IdentifiedGenesisMetadata as typeIdentifiedGenesisMetadata} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + IdentifiedClientState: getStructure(typeIdentifiedClientState.fromPartial({})), + ConsensusStateWithHeight: getStructure(typeConsensusStateWithHeight.fromPartial({})), + ClientConsensusStates: getStructure(typeClientConsensusStates.fromPartial({})), + ClientUpdateProposal: getStructure(typeClientUpdateProposal.fromPartial({})), + UpgradeProposal: getStructure(typeUpgradeProposal.fromPartial({})), + Height: getStructure(typeHeight.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + GenesisMetadata: getStructure(typeGenesisMetadata.fromPartial({})), + IdentifiedGenesisMetadata: getStructure(typeIdentifiedGenesisMetadata.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + IbcCoreClientV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/registry.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/rest.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/rest.ts new file mode 100644 index 0000000000..1e7a3b5fef --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/rest.ts @@ -0,0 +1,1089 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** +* ConsensusStateWithHeight defines a consensus state with an additional height +field. +*/ +export interface V1ConsensusStateWithHeight { + /** + * consensus state height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; + + /** + * consensus state + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + consensus_state?: ProtobufAny; +} + +/** +* Normally the RevisionHeight is incremented at each height while keeping +RevisionNumber the same. However some consensus algorithms may choose to +reset the height in certain conditions e.g. hard forks, state-machine +breaking changes In these cases, the RevisionNumber is incremented so that +height continues to be monitonically increasing even as the RevisionHeight +gets reset +*/ +export interface V1Height { + /** + * the revision that the client is currently on + * @format uint64 + */ + revision_number?: string; + + /** + * the height within the given revision + * @format uint64 + */ + revision_height?: string; +} + +/** +* IdentifiedClientState defines a client state with an additional client +identifier field. +*/ +export interface V1IdentifiedClientState { + /** client identifier */ + client_id?: string; + + /** + * client state + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + client_state?: ProtobufAny; +} + +/** + * MsgCreateClientResponse defines the Msg/CreateClient response type. + */ +export type V1MsgCreateClientResponse = object; + +/** +* MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +type. +*/ +export type V1MsgSubmitMisbehaviourResponse = object; + +/** + * MsgUpdateClientResponse defines the Msg/UpdateClient response type. + */ +export type V1MsgUpdateClientResponse = object; + +/** + * MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. + */ +export type V1MsgUpgradeClientResponse = object; + +/** + * Params defines the set of IBC light client parameters. + */ +export interface V1Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} + +/** +* QueryClientParamsResponse is the response type for the Query/ClientParams RPC +method. +*/ +export interface V1QueryClientParamsResponse { + /** params defines the parameters of the module. */ + params?: V1Params; +} + +/** +* QueryClientStateResponse is the response type for the Query/ClientState RPC +method. Besides the client state, it includes a proof and the height from +which the proof was retrieved. +*/ +export interface V1QueryClientStateResponse { + /** + * client state associated with the request identifier + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + client_state?: ProtobufAny; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +/** +* QueryClientStatesResponse is the response type for the Query/ClientStates RPC +method. +*/ +export interface V1QueryClientStatesResponse { + /** list of stored ClientStates of the chain. */ + client_states?: V1IdentifiedClientState[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +/** +* QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +method. It returns the current status of the IBC client. +*/ +export interface V1QueryClientStatusResponse { + status?: string; +} + +export interface V1QueryConsensusStateHeightsResponse { + /** consensus state heights */ + consensus_state_heights?: V1Height[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +export interface V1QueryConsensusStateResponse { + /** + * consensus state associated with the client identifier at the given height + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + consensus_state?: ProtobufAny; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryConsensusStatesResponse { + /** consensus states associated with the identifier */ + consensus_states?: V1ConsensusStateWithHeight[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +/** +* QueryUpgradedClientStateResponse is the response type for the +Query/UpgradedClientState RPC method. +*/ +export interface V1QueryUpgradedClientStateResponse { + /** + * client state associated with the request identifier + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + upgraded_client_state?: ProtobufAny; +} + +/** +* QueryUpgradedConsensusStateResponse is the response type for the +Query/UpgradedConsensusState RPC method. +*/ +export interface V1QueryUpgradedConsensusStateResponse { + /** + * Consensus state associated with the request identifier + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + upgraded_consensus_state?: ProtobufAny; +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title ibc/core/client/v1/client.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryClientStates + * @summary ClientStates queries all the IBC light clients of a chain. + * @request GET:/ibc/core/client/v1/client_states + */ + queryClientStates = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/client/v1/client_states`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryClientState + * @summary ClientState queries an IBC light client. + * @request GET:/ibc/core/client/v1/client_states/{client_id} + */ + queryClientState = (clientId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/client/v1/client_states/${clientId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryClientStatus + * @summary Status queries the status of an IBC client. + * @request GET:/ibc/core/client/v1/client_status/{client_id} + */ + queryClientStatus = (clientId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/client/v1/client_status/${clientId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConsensusStates + * @summary ConsensusStates queries all the consensus state associated with a given +client. + * @request GET:/ibc/core/client/v1/consensus_states/{client_id} + */ + queryConsensusStates = ( + clientId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/client/v1/consensus_states/${clientId}`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConsensusStateHeights + * @summary ConsensusStateHeights queries the height of every consensus states associated with a given client. + * @request GET:/ibc/core/client/v1/consensus_states/{client_id}/heights + */ + queryConsensusStateHeights = ( + clientId: string, + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/client/v1/consensus_states/${clientId}/heights`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConsensusState + * @summary ConsensusState queries a consensus state associated with a client state at +a given height. + * @request GET:/ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height} + */ + queryConsensusState = ( + clientId: string, + revisionNumber: string, + revisionHeight: string, + query?: { latest_height?: boolean }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/client/v1/consensus_states/${clientId}/revision/${revisionNumber}/height/${revisionHeight}`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryClientParams + * @summary ClientParams queries all parameters of the ibc client submodule. + * @request GET:/ibc/core/client/v1/params + */ + queryClientParams = (params: RequestParams = {}) => + this.request({ + path: `/ibc/core/client/v1/params`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryUpgradedClientState + * @summary UpgradedClientState queries an Upgraded IBC light client. + * @request GET:/ibc/core/client/v1/upgraded_client_states + */ + queryUpgradedClientState = (params: RequestParams = {}) => + this.request({ + path: `/ibc/core/client/v1/upgraded_client_states`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryUpgradedConsensusState + * @summary UpgradedConsensusState queries an Upgraded IBC consensus state. + * @request GET:/ibc/core/client/v1/upgraded_consensus_states + */ + queryUpgradedConsensusState = (params: RequestParams = {}) => + this.request({ + path: `/ibc/core/client/v1/upgraded_consensus_states`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types.ts new file mode 100755 index 0000000000..c5dcc88c34 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types.ts @@ -0,0 +1,24 @@ +//@ts-nocheck +import { IdentifiedClientState } from "./types/ibc/core/client/v1/client" +import { ConsensusStateWithHeight } from "./types/ibc/core/client/v1/client" +import { ClientConsensusStates } from "./types/ibc/core/client/v1/client" +import { ClientUpdateProposal } from "./types/ibc/core/client/v1/client" +import { UpgradeProposal } from "./types/ibc/core/client/v1/client" +import { Height } from "./types/ibc/core/client/v1/client" +import { Params } from "./types/ibc/core/client/v1/client" +import { GenesisMetadata } from "./types/ibc/core/client/v1/genesis" +import { IdentifiedGenesisMetadata } from "./types/ibc/core/client/v1/genesis" + + +export { + IdentifiedClientState, + ConsensusStateWithHeight, + ClientConsensusStates, + ClientUpdateProposal, + UpgradeProposal, + Height, + Params, + GenesisMetadata, + IdentifiedGenesisMetadata, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/upgrade/v1beta1/upgrade.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000000..4b2ecab4a4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,432 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + time: + | Date + | undefined; + /** The height at which the upgrade must be performed. */ + height: number; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + upgradedClientState: Any | undefined; +} + +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + * + * @deprecated + */ +export interface SoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan | undefined; +} + +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + * + * @deprecated + */ +export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} + +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: number; +} + +function createBasePlan(): Plan { + return { name: "", time: undefined, height: 0, info: "", upgradedClientState: undefined }; +} + +export const Plan = { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: Plan): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height ?? 0; + message.info = object.info ?? ""; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { title: "", description: "", plan: undefined }; +} + +export const SoftwareUpgradeProposal = { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; + }, + + toJSON(message: SoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + return message; + }, +}; + +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { title: "", description: "" }; +} + +export const CancelSoftwareUpgradeProposal = { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelSoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: CancelSoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I, + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseModuleVersion(): ModuleVersion { + return { name: "", version: 0 }; +} + +export const ModuleVersion = { + encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== 0) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? Number(object.version) : 0, + }; + }, + + toJSON(message: ModuleVersion): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = Math.round(message.version)); + return obj; + }, + + fromPartial, I>>(object: I): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/timestamp.ts new file mode 100644 index 0000000000..93776d9496 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/google/protobuf/timestamp.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/client.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/client.ts new file mode 100644 index 0000000000..0f612c313b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/client.ts @@ -0,0 +1,613 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState: Any | undefined; +} + +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: + | Height + | undefined; + /** consensus state */ + consensusState: Any | undefined; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} + +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + title: string; + description: string; + plan: + | Plan + | undefined; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState: Any | undefined; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: number; + /** the height within the given revision */ + revisionHeight: number; +} + +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} + +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { clientId: "", clientState: undefined }; +} + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + }; + }, + + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + return message; + }, +}; + +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { height: undefined, consensusState: undefined }; +} + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + }; + }, + + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + return message; + }, +}; + +function createBaseClientConsensusStates(): ClientConsensusStates { + return { clientId: "", consensusStates: [] }; +} + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) + ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { title: "", description: "", subjectClientId: "", substituteClientId: "" }; +} + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "", + }; + }, + + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, + + fromPartial, I>>(object: I): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, +}; + +function createBaseUpgradeProposal(): UpgradeProposal { + return { title: "", description: "", plan: undefined, upgradedClientState: undefined }; +} + +export const UpgradeProposal = { + encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: UpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseHeight(): Height { + return { revisionNumber: 0, revisionHeight: 0 }; +} + +export const Height = { + encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revisionNumber !== 0) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Height { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 2: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>(object: I): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseParams(): Params { + return { allowedClients: [] }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/genesis.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/genesis.ts new file mode 100644 index 0000000000..cc57855909 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/genesis.ts @@ -0,0 +1,358 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ClientConsensusStates, IdentifiedClientState, Params } from "./client"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisState { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientState[]; + /** consensus states from each client */ + clientsConsensus: ClientConsensusStates[]; + /** metadata from each client */ + clientsMetadata: IdentifiedGenesisMetadata[]; + params: + | Params + | undefined; + /** create localhost on initialization */ + createLocalhost: boolean; + /** the sequence for the next generated client identifier */ + nextClientSequence: number; +} + +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadata { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} + +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadata { + clientId: string; + clientMetadata: GenesisMetadata[]; +} + +function createBaseGenesisState(): GenesisState { + return { + clients: [], + clientsConsensus: [], + clientsMetadata: [], + params: undefined, + createLocalhost: false, + nextClientSequence: 0, + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.clients) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientsConsensus) { + ClientConsensusStates.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.clientsMetadata) { + IdentifiedGenesisMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + if (message.createLocalhost === true) { + writer.uint32(40).bool(message.createLocalhost); + } + if (message.nextClientSequence !== 0) { + writer.uint32(48).uint64(message.nextClientSequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clients.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.clientsConsensus.push(ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + message.clientsMetadata.push(IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + clients: Array.isArray(object?.clients) ? object.clients.map((e: any) => IdentifiedClientState.fromJSON(e)) : [], + clientsConsensus: Array.isArray(object?.clientsConsensus) + ? object.clientsConsensus.map((e: any) => ClientConsensusStates.fromJSON(e)) + : [], + clientsMetadata: Array.isArray(object?.clientsMetadata) + ? object.clientsMetadata.map((e: any) => IdentifiedGenesisMetadata.fromJSON(e)) + : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + createLocalhost: isSet(object.createLocalhost) ? Boolean(object.createLocalhost) : false, + nextClientSequence: isSet(object.nextClientSequence) ? Number(object.nextClientSequence) : 0, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.clients) { + obj.clients = message.clients.map((e) => e ? IdentifiedClientState.toJSON(e) : undefined); + } else { + obj.clients = []; + } + if (message.clientsConsensus) { + obj.clientsConsensus = message.clientsConsensus.map((e) => e ? ClientConsensusStates.toJSON(e) : undefined); + } else { + obj.clientsConsensus = []; + } + if (message.clientsMetadata) { + obj.clientsMetadata = message.clientsMetadata.map((e) => e ? IdentifiedGenesisMetadata.toJSON(e) : undefined); + } else { + obj.clientsMetadata = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.createLocalhost !== undefined && (obj.createLocalhost = message.createLocalhost); + message.nextClientSequence !== undefined && (obj.nextClientSequence = Math.round(message.nextClientSequence)); + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.clients = object.clients?.map((e) => IdentifiedClientState.fromPartial(e)) || []; + message.clientsConsensus = object.clientsConsensus?.map((e) => ClientConsensusStates.fromPartial(e)) || []; + message.clientsMetadata = object.clientsMetadata?.map((e) => IdentifiedGenesisMetadata.fromPartial(e)) || []; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.createLocalhost = object.createLocalhost ?? false; + message.nextClientSequence = object.nextClientSequence ?? 0; + return message; + }, +}; + +function createBaseGenesisMetadata(): GenesisMetadata { + return { key: new Uint8Array(), value: new Uint8Array() }; +} + +export const GenesisMetadata = { + encode(message: GenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisMetadata { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: GenesisMetadata): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): GenesisMetadata { + const message = createBaseGenesisMetadata(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, +}; + +function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { + return { clientId: "", clientMetadata: [] }; +} + +export const IdentifiedGenesisMetadata = { + encode(message: IdentifiedGenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.clientMetadata) { + GenesisMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedGenesisMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMetadata.push(GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedGenesisMetadata { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientMetadata: Array.isArray(object?.clientMetadata) + ? object.clientMetadata.map((e: any) => GenesisMetadata.fromJSON(e)) + : [], + }; + }, + + toJSON(message: IdentifiedGenesisMetadata): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.clientMetadata) { + obj.clientMetadata = message.clientMetadata.map((e) => e ? GenesisMetadata.toJSON(e) : undefined); + } else { + obj.clientMetadata = []; + } + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedGenesisMetadata { + const message = createBaseIdentifiedGenesisMetadata(); + message.clientId = object.clientId ?? ""; + message.clientMetadata = object.clientMetadata?.map((e) => GenesisMetadata.fromPartial(e)) || []; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/query.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/query.ts new file mode 100644 index 0000000000..babdd00cb2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/query.ts @@ -0,0 +1,1391 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; +import { ConsensusStateWithHeight, Height, IdentifiedClientState, Params } from "./client"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequest { + /** client state unique identifier */ + clientId: string; +} + +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponse { + /** client state associated with the request identifier */ + clientState: + | Any + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequest { + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponse { + /** list of stored ClientStates of the chain. */ + clientStates: IdentifiedClientState[]; + /** pagination response */ + pagination: PageResponse | undefined; +} + +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequest { + /** client identifier */ + clientId: string; + /** consensus state revision number */ + revisionNumber: number; + /** consensus state revision height */ + revisionHeight: number; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latestHeight: boolean; +} + +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponse { + /** consensus state associated with the client identifier at the given height */ + consensusState: + | Any + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponse { + /** consensus states associated with the identifier */ + consensusStates: ConsensusStateWithHeight[]; + /** pagination response */ + pagination: PageResponse | undefined; +} + +/** + * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights + * RPC method. + */ +export interface QueryConsensusStateHeightsRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination: PageRequest | undefined; +} + +/** + * QueryConsensusStateHeightsResponse is the response type for the + * Query/ConsensusStateHeights RPC method + */ +export interface QueryConsensusStateHeightsResponse { + /** consensus state heights */ + consensusStateHeights: Height[]; + /** pagination response */ + pagination: PageResponse | undefined; +} + +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequest { + /** client unique identifier */ + clientId: string; +} + +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponse { + status: string; +} + +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequest { +} + +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} + +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequest { +} + +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponse { + /** client state associated with the request identifier */ + upgradedClientState: Any | undefined; +} + +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequest { +} + +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponse { + /** Consensus state associated with the request identifier */ + upgradedConsensusState: Any | undefined; +} + +function createBaseQueryClientStateRequest(): QueryClientStateRequest { + return { clientId: "" }; +} + +export const QueryClientStateRequest = { + encode(message: QueryClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStateRequest { + return { clientId: isSet(object.clientId) ? String(object.clientId) : "" }; + }, + + toJSON(message: QueryClientStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStateRequest { + const message = createBaseQueryClientStateRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, +}; + +function createBaseQueryClientStateResponse(): QueryClientStateResponse { + return { clientState: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryClientStateResponse = { + encode(message: QueryClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStateResponse { + return { + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryClientStateResponse): unknown { + const obj: any = {}; + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStateResponse { + const message = createBaseQueryClientStateResponse(); + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { + return { pagination: undefined }; +} + +export const QueryClientStatesRequest = { + encode(message: QueryClientStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryClientStatesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStatesRequest { + const message = createBaseQueryClientStatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { + return { clientStates: [], pagination: undefined }; +} + +export const QueryClientStatesResponse = { + encode(message: QueryClientStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.clientStates) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientStates.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatesResponse { + return { + clientStates: Array.isArray(object?.clientStates) + ? object.clientStates.map((e: any) => IdentifiedClientState.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryClientStatesResponse): unknown { + const obj: any = {}; + if (message.clientStates) { + obj.clientStates = message.clientStates.map((e) => e ? IdentifiedClientState.toJSON(e) : undefined); + } else { + obj.clientStates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStatesResponse { + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.clientStates?.map((e) => IdentifiedClientState.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { + return { clientId: "", revisionNumber: 0, revisionHeight: 0, latestHeight: false }; +} + +export const QueryConsensusStateRequest = { + encode(message: QueryConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.revisionNumber !== 0) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(24).uint64(message.revisionHeight); + } + if (message.latestHeight === true) { + writer.uint32(32).bool(message.latestHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 3: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + latestHeight: isSet(object.latestHeight) ? Boolean(object.latestHeight) : false, + }; + }, + + toJSON(message: QueryConsensusStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight); + return obj; + }, + + fromPartial, I>>(object: I): QueryConsensusStateRequest { + const message = createBaseQueryConsensusStateRequest(); + message.clientId = object.clientId ?? ""; + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + message.latestHeight = object.latestHeight ?? false; + return message; + }, +}; + +function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { + return { consensusState: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryConsensusStateResponse = { + encode(message: QueryConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConsensusStateResponse { + const message = createBaseQueryConsensusStateResponse(); + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { + return { clientId: "", pagination: undefined }; +} + +export const QueryConsensusStatesRequest = { + encode(message: QueryConsensusStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStatesRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryConsensusStatesRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConsensusStatesRequest { + const message = createBaseQueryConsensusStatesRequest(); + message.clientId = object.clientId ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { + return { consensusStates: [], pagination: undefined }; +} + +export const QueryConsensusStatesResponse = { + encode(message: QueryConsensusStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStatesResponse { + return { + consensusStates: Array.isArray(object?.consensusStates) + ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryConsensusStatesResponse): unknown { + const obj: any = {}; + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConsensusStatesResponse { + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeightsRequest { + return { clientId: "", pagination: undefined }; +} + +export const QueryConsensusStateHeightsRequest = { + encode(message: QueryConsensusStateHeightsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateHeightsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateHeightsRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryConsensusStateHeightsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConsensusStateHeightsRequest { + const message = createBaseQueryConsensusStateHeightsRequest(); + message.clientId = object.clientId ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeightsResponse { + return { consensusStateHeights: [], pagination: undefined }; +} + +export const QueryConsensusStateHeightsResponse = { + encode(message: QueryConsensusStateHeightsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.consensusStateHeights) { + Height.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateHeightsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStateHeights.push(Height.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateHeightsResponse { + return { + consensusStateHeights: Array.isArray(object?.consensusStateHeights) + ? object.consensusStateHeights.map((e: any) => Height.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryConsensusStateHeightsResponse): unknown { + const obj: any = {}; + if (message.consensusStateHeights) { + obj.consensusStateHeights = message.consensusStateHeights.map((e) => e ? Height.toJSON(e) : undefined); + } else { + obj.consensusStateHeights = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConsensusStateHeightsResponse { + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensusStateHeights?.map((e) => Height.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { + return { clientId: "" }; +} + +export const QueryClientStatusRequest = { + encode(message: QueryClientStatusRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatusRequest { + return { clientId: isSet(object.clientId) ? String(object.clientId) : "" }; + }, + + toJSON(message: QueryClientStatusRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStatusRequest { + const message = createBaseQueryClientStatusRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, +}; + +function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { + return { status: "" }; +} + +export const QueryClientStatusResponse = { + encode(message: QueryClientStatusResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatusResponse { + return { status: isSet(object.status) ? String(object.status) : "" }; + }, + + toJSON(message: QueryClientStatusResponse): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = message.status); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientStatusResponse { + const message = createBaseQueryClientStatusResponse(); + message.status = object.status ?? ""; + return message; + }, +}; + +function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { + return {}; +} + +export const QueryClientParamsRequest = { + encode(_: QueryClientParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryClientParamsRequest { + return {}; + }, + + toJSON(_: QueryClientParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryClientParamsRequest { + const message = createBaseQueryClientParamsRequest(); + return message; + }, +}; + +function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { + return { params: undefined }; +} + +export const QueryClientParamsResponse = { + encode(message: QueryClientParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientParamsResponse { + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryClientParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryClientParamsResponse { + const message = createBaseQueryClientParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRequest { + return {}; +} + +export const QueryUpgradedClientStateRequest = { + encode(_: QueryUpgradedClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryUpgradedClientStateRequest { + return {}; + }, + + toJSON(_: QueryUpgradedClientStateRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryUpgradedClientStateRequest { + const message = createBaseQueryUpgradedClientStateRequest(); + return message; + }, +}; + +function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { + return { upgradedClientState: undefined }; +} + +export const QueryUpgradedClientStateResponse = { + encode(message: QueryUpgradedClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUpgradedClientStateResponse { + return { + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: QueryUpgradedClientStateResponse): unknown { + const obj: any = {}; + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryUpgradedClientStateResponse { + const message = createBaseQueryUpgradedClientStateResponse(); + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { + return {}; +} + +export const QueryUpgradedConsensusStateRequest = { + encode(_: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryUpgradedConsensusStateRequest { + return {}; + }, + + toJSON(_: QueryUpgradedConsensusStateRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; + }, +}; + +function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { + return { upgradedConsensusState: undefined }; +} + +export const QueryUpgradedConsensusStateResponse = { + encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.upgradedConsensusState !== undefined) { + Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedConsensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: isSet(object.upgradedConsensusState) + ? Any.fromJSON(object.upgradedConsensusState) + : undefined, + }; + }, + + toJSON(message: QueryUpgradedConsensusStateResponse): unknown { + const obj: any = {}; + message.upgradedConsensusState !== undefined && (obj.upgradedConsensusState = message.upgradedConsensusState + ? Any.toJSON(message.upgradedConsensusState) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + message.upgradedConsensusState = + (object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null) + ? Any.fromPartial(object.upgradedConsensusState) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ClientState queries an IBC light client. */ + ClientState(request: QueryClientStateRequest): Promise; + /** ClientStates queries all the IBC light clients of a chain. */ + ClientStates(request: QueryClientStatesRequest): Promise; + /** + * ConsensusState queries a consensus state associated with a client state at + * a given height. + */ + ConsensusState(request: QueryConsensusStateRequest): Promise; + /** + * ConsensusStates queries all the consensus state associated with a given + * client. + */ + ConsensusStates(request: QueryConsensusStatesRequest): Promise; + /** ConsensusStateHeights queries the height of every consensus states associated with a given client. */ + ConsensusStateHeights(request: QueryConsensusStateHeightsRequest): Promise; + /** Status queries the status of an IBC client. */ + ClientStatus(request: QueryClientStatusRequest): Promise; + /** ClientParams queries all parameters of the ibc client submodule. */ + ClientParams(request: QueryClientParamsRequest): Promise; + /** UpgradedClientState queries an Upgraded IBC light client. */ + UpgradedClientState(request: QueryUpgradedClientStateRequest): Promise; + /** UpgradedConsensusState queries an Upgraded IBC consensus state. */ + UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ClientState = this.ClientState.bind(this); + this.ClientStates = this.ClientStates.bind(this); + this.ConsensusState = this.ConsensusState.bind(this); + this.ConsensusStates = this.ConsensusStates.bind(this); + this.ConsensusStateHeights = this.ConsensusStateHeights.bind(this); + this.ClientStatus = this.ClientStatus.bind(this); + this.ClientParams = this.ClientParams.bind(this); + this.UpgradedClientState = this.UpgradedClientState.bind(this); + this.UpgradedConsensusState = this.UpgradedConsensusState.bind(this); + } + ClientState(request: QueryClientStateRequest): Promise { + const data = QueryClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); + return promise.then((data) => QueryClientStateResponse.decode(new _m0.Reader(data))); + } + + ClientStates(request: QueryClientStatesRequest): Promise { + const data = QueryClientStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); + return promise.then((data) => QueryClientStatesResponse.decode(new _m0.Reader(data))); + } + + ConsensusState(request: QueryConsensusStateRequest): Promise { + const data = QueryConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); + return promise.then((data) => QueryConsensusStateResponse.decode(new _m0.Reader(data))); + } + + ConsensusStates(request: QueryConsensusStatesRequest): Promise { + const data = QueryConsensusStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); + return promise.then((data) => QueryConsensusStatesResponse.decode(new _m0.Reader(data))); + } + + ConsensusStateHeights(request: QueryConsensusStateHeightsRequest): Promise { + const data = QueryConsensusStateHeightsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStateHeights", data); + return promise.then((data) => QueryConsensusStateHeightsResponse.decode(new _m0.Reader(data))); + } + + ClientStatus(request: QueryClientStatusRequest): Promise { + const data = QueryClientStatusRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data); + return promise.then((data) => QueryClientStatusResponse.decode(new _m0.Reader(data))); + } + + ClientParams(request: QueryClientParamsRequest): Promise { + const data = QueryClientParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); + return promise.then((data) => QueryClientParamsResponse.decode(new _m0.Reader(data))); + } + + UpgradedClientState(request: QueryUpgradedClientStateRequest): Promise { + const data = QueryUpgradedClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data); + return promise.then((data) => QueryUpgradedClientStateResponse.decode(new _m0.Reader(data))); + } + + UpgradedConsensusState(request: QueryUpgradedConsensusStateRequest): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); + return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/tx.ts b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/tx.ts new file mode 100644 index 0000000000..f295686cb1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.client.v1/types/ibc/core/client/v1/tx.ts @@ -0,0 +1,706 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState: + | Any + | undefined; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState: + | Any + | undefined; + /** signer address */ + signer: string; +} + +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse { +} + +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** client message to update the light client */ + clientMessage: + | Any + | undefined; + /** signer address */ + signer: string; +} + +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse { +} + +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState: + | Any + | undefined; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState: + | Any + | undefined; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} + +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse { +} + +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * Warning: DEPRECATED + */ +export interface MsgSubmitMisbehaviour { + /** + * client unique identifier + * + * @deprecated + */ + clientId: string; + /** + * misbehaviour used for freezing the light client + * + * @deprecated + */ + misbehaviour: + | Any + | undefined; + /** + * signer address + * + * @deprecated + */ + signer: string; +} + +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse { +} + +function createBaseMsgCreateClient(): MsgCreateClient { + return { clientState: undefined, consensusState: undefined, signer: "" }; +} + +export const MsgCreateClient = { + encode(message: MsgCreateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreateClient { + return { + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgCreateClient): unknown { + const obj: any = {}; + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgCreateClient { + const message = createBaseMsgCreateClient(); + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { + return {}; +} + +export const MsgCreateClientResponse = { + encode(_: MsgCreateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCreateClientResponse { + return {}; + }, + + toJSON(_: MsgCreateClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + return message; + }, +}; + +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { clientId: "", clientMessage: undefined, signer: "" }; +} + +export const MsgUpdateClient = { + encode(message: MsgUpdateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMessage = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateClient { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientMessage: isSet(object.clientMessage) ? Any.fromJSON(object.clientMessage) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgUpdateClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientMessage !== undefined + && (obj.clientMessage = message.clientMessage ? Any.toJSON(message.clientMessage) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + message.clientId = object.clientId ?? ""; + message.clientMessage = (object.clientMessage !== undefined && object.clientMessage !== null) + ? Any.fromPartial(object.clientMessage) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { + return {}; +} + +export const MsgUpdateClientResponse = { + encode(_: MsgUpdateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateClientResponse { + return {}; + }, + + toJSON(_: MsgUpdateClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, +}; + +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: "", + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: "", + }; +} + +export const MsgUpgradeClient = { + encode(message: MsgUpgradeClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpgradeClient { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + proofUpgradeClient: isSet(object.proofUpgradeClient) + ? bytesFromBase64(object.proofUpgradeClient) + : new Uint8Array(), + proofUpgradeConsensusState: isSet(object.proofUpgradeConsensusState) + ? bytesFromBase64(object.proofUpgradeConsensusState) + : new Uint8Array(), + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgUpgradeClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proofUpgradeClient !== undefined + && (obj.proofUpgradeClient = base64FromBytes( + message.proofUpgradeClient !== undefined ? message.proofUpgradeClient : new Uint8Array(), + )); + message.proofUpgradeConsensusState !== undefined + && (obj.proofUpgradeConsensusState = base64FromBytes( + message.proofUpgradeConsensusState !== undefined ? message.proofUpgradeConsensusState : new Uint8Array(), + )); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + message.clientId = object.clientId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array(); + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { + return {}; +} + +export const MsgUpgradeClientResponse = { + encode(_: MsgUpgradeClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpgradeClientResponse { + return {}; + }, + + toJSON(_: MsgUpgradeClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, +}; + +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { clientId: "", misbehaviour: undefined, signer: "" }; +} + +export const MsgSubmitMisbehaviour = { + encode(message: MsgSubmitMisbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitMisbehaviour { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + misbehaviour: isSet(object.misbehaviour) ? Any.fromJSON(object.misbehaviour) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgSubmitMisbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.misbehaviour !== undefined + && (obj.misbehaviour = message.misbehaviour ? Any.toJSON(message.misbehaviour) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.misbehaviour = (object.misbehaviour !== undefined && object.misbehaviour !== null) + ? Any.fromPartial(object.misbehaviour) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { + return {}; +} + +export const MsgSubmitMisbehaviourResponse = { + encode(_: MsgSubmitMisbehaviourResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSubmitMisbehaviourResponse { + return {}; + }, + + toJSON(_: MsgSubmitMisbehaviourResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, +}; + +/** Msg defines the ibc/client Msg service. */ +export interface Msg { + /** CreateClient defines a rpc handler method for MsgCreateClient. */ + CreateClient(request: MsgCreateClient): Promise; + /** UpdateClient defines a rpc handler method for MsgUpdateClient. */ + UpdateClient(request: MsgUpdateClient): Promise; + /** UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ + UpgradeClient(request: MsgUpgradeClient): Promise; + /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ + SubmitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.CreateClient = this.CreateClient.bind(this); + this.UpdateClient = this.UpdateClient.bind(this); + this.UpgradeClient = this.UpgradeClient.bind(this); + this.SubmitMisbehaviour = this.SubmitMisbehaviour.bind(this); + } + CreateClient(request: MsgCreateClient): Promise { + const data = MsgCreateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); + return promise.then((data) => MsgCreateClientResponse.decode(new _m0.Reader(data))); + } + + UpdateClient(request: MsgUpdateClient): Promise { + const data = MsgUpdateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); + return promise.then((data) => MsgUpdateClientResponse.decode(new _m0.Reader(data))); + } + + UpgradeClient(request: MsgUpgradeClient): Promise { + const data = MsgUpgradeClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); + return promise.then((data) => MsgUpgradeClientResponse.decode(new _m0.Reader(data))); + } + + SubmitMisbehaviour(request: MsgSubmitMisbehaviour): Promise { + const data = MsgSubmitMisbehaviour.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); + return promise.then((data) => MsgSubmitMisbehaviourResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/index.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/module.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/module.ts new file mode 100755 index 0000000000..01774ae386 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/module.ts @@ -0,0 +1,111 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { ConnectionEnd as typeConnectionEnd} from "./types" +import { IdentifiedConnection as typeIdentifiedConnection} from "./types" +import { Counterparty as typeCounterparty} from "./types" +import { ClientPaths as typeClientPaths} from "./types" +import { ConnectionPaths as typeConnectionPaths} from "./types" +import { Version as typeVersion} from "./types" +import { Params as typeParams} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + ConnectionEnd: getStructure(typeConnectionEnd.fromPartial({})), + IdentifiedConnection: getStructure(typeIdentifiedConnection.fromPartial({})), + Counterparty: getStructure(typeCounterparty.fromPartial({})), + ClientPaths: getStructure(typeClientPaths.fromPartial({})), + ConnectionPaths: getStructure(typeConnectionPaths.fromPartial({})), + Version: getStructure(typeVersion.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + IbcCoreConnectionV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/registry.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/rest.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/rest.ts new file mode 100644 index 0000000000..3140b4359e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/rest.ts @@ -0,0 +1,890 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Params defines the set of Connection parameters. + */ +export interface Coreconnectionv1Params { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + * @format uint64 + */ + max_expected_time_per_block?: string; +} + +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** +* ConnectionEnd defines a stateful object on a chain connected to another +separate one. +NOTE: there must only be 2 defined ConnectionEnds to establish +a connection between two chains. +*/ +export interface V1ConnectionEnd { + /** client associated with this connection. */ + client_id?: string; + + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions?: V1Version[]; + + /** current state of the connection end. */ + state?: V1State; + + /** counterparty chain associated with this connection. */ + counterparty?: V1Counterparty; + + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + * @format uint64 + */ + delay_period?: string; +} + +/** + * Counterparty defines the counterparty chain associated with a connection end. + */ +export interface V1Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id?: string; + + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id?: string; + + /** commitment merkle prefix of the counterparty chain. */ + prefix?: V1MerklePrefix; +} + +/** +* Normally the RevisionHeight is incremented at each height while keeping +RevisionNumber the same. However some consensus algorithms may choose to +reset the height in certain conditions e.g. hard forks, state-machine +breaking changes In these cases, the RevisionNumber is incremented so that +height continues to be monitonically increasing even as the RevisionHeight +gets reset +*/ +export interface V1Height { + /** + * the revision that the client is currently on + * @format uint64 + */ + revision_number?: string; + + /** + * the height within the given revision + * @format uint64 + */ + revision_height?: string; +} + +/** +* IdentifiedClientState defines a client state with an additional client +identifier field. +*/ +export interface V1IdentifiedClientState { + /** client identifier */ + client_id?: string; + + /** + * client state + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + client_state?: ProtobufAny; +} + +/** +* IdentifiedConnection defines a connection with additional connection +identifier field. +*/ +export interface V1IdentifiedConnection { + /** connection identifier. */ + id?: string; + + /** client associated with this connection. */ + client_id?: string; + + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions?: V1Version[]; + + /** current state of the connection end. */ + state?: V1State; + + /** counterparty chain associated with this connection. */ + counterparty?: V1Counterparty; + + /** + * delay period associated with this connection. + * @format uint64 + */ + delay_period?: string; +} + +export interface V1MerklePrefix { + /** @format byte */ + key_prefix?: string; +} + +/** + * MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. + */ +export type V1MsgConnectionOpenAckResponse = object; + +/** +* MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +response type. +*/ +export type V1MsgConnectionOpenConfirmResponse = object; + +/** +* MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +type. +*/ +export type V1MsgConnectionOpenInitResponse = object; + +/** + * MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. + */ +export type V1MsgConnectionOpenTryResponse = object; + +export interface V1QueryClientConnectionsResponse { + /** slice of all the connection paths associated with a client. */ + connection_paths?: string[]; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was generated + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryConnectionClientStateResponse { + /** + * client state associated with the channel + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ + identified_client_state?: V1IdentifiedClientState; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +export interface V1QueryConnectionConsensusStateResponse { + /** + * consensus state associated with the channel + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + consensus_state?: ProtobufAny; + + /** client ID associated with the consensus state */ + client_id?: string; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +/** + * QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. + */ +export interface V1QueryConnectionParamsResponse { + /** params defines the parameters of the module. */ + params?: Coreconnectionv1Params; +} + +/** +* QueryConnectionResponse is the response type for the Query/Connection RPC +method. Besides the connection end, it includes a proof and the height from +which the proof was retrieved. +*/ +export interface V1QueryConnectionResponse { + /** + * connection associated with the request identifier + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ + connection?: V1ConnectionEnd; + + /** + * merkle proof of existence + * @format byte + */ + proof?: string; + + /** + * height at which the proof was retrieved + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + proof_height?: V1Height; +} + +/** +* QueryConnectionsResponse is the response type for the Query/Connections RPC +method. +*/ +export interface V1QueryConnectionsResponse { + /** list of stored connections of the chain. */ + connections?: V1IdentifiedConnection[]; + + /** + * pagination response + * 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; + * } + */ + pagination?: V1Beta1PageResponse; + + /** + * query block height + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ + height?: V1Height; +} + +/** +* State defines if a connection is in one of the following states: +INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A connection end has just started the opening handshake. + - STATE_TRYOPEN: A connection end has acknowledged the handshake step on the counterparty +chain. + - STATE_OPEN: A connection end has completed the handshake. +*/ +export enum V1State { + STATE_UNINITIALIZED_UNSPECIFIED = "STATE_UNINITIALIZED_UNSPECIFIED", + STATE_INIT = "STATE_INIT", + STATE_TRYOPEN = "STATE_TRYOPEN", + STATE_OPEN = "STATE_OPEN", +} + +/** +* Version defines the versioning scheme used to negotiate the IBC verison in +the connection handshake. +*/ +export interface V1Version { + /** unique version identifier */ + identifier?: string; + + /** list of features compatible with the specified identifier */ + features?: string[]; +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: 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 V1Beta1PageResponse { + /** + * 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. + * @format byte + */ + next_key?: string; + + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ + total?: string; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title ibc/core/connection/v1/connection.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryClientConnections + * @summary ClientConnections queries the connection paths associated with a client +state. + * @request GET:/ibc/core/connection/v1/client_connections/{client_id} + */ + queryClientConnections = (clientId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/connection/v1/client_connections/${clientId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnections + * @summary Connections queries all the IBC connections of a chain. + * @request GET:/ibc/core/connection/v1/connections + */ + queryConnections = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/connection/v1/connections`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnection + * @summary Connection queries an IBC connection end. + * @request GET:/ibc/core/connection/v1/connections/{connection_id} + */ + queryConnection = (connectionId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/connection/v1/connections/${connectionId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnectionClientState + * @summary ConnectionClientState queries the client state associated with the +connection. + * @request GET:/ibc/core/connection/v1/connections/{connection_id}/client_state + */ + queryConnectionClientState = (connectionId: string, params: RequestParams = {}) => + this.request({ + path: `/ibc/core/connection/v1/connections/${connectionId}/client_state`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnectionConsensusState + * @summary ConnectionConsensusState queries the consensus state associated with the +connection. + * @request GET:/ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height} + */ + queryConnectionConsensusState = ( + connectionId: string, + revisionNumber: string, + revisionHeight: string, + params: RequestParams = {}, + ) => + this.request({ + path: `/ibc/core/connection/v1/connections/${connectionId}/consensus_state/revision/${revisionNumber}/height/${revisionHeight}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryConnectionParams + * @summary ConnectionParams queries all parameters of the ibc connection submodule. + * @request GET:/ibc/core/connection/v1/params + */ + queryConnectionParams = (params: RequestParams = {}) => + this.request({ + path: `/ibc/core/connection/v1/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types.ts new file mode 100755 index 0000000000..5d2cd0e759 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types.ts @@ -0,0 +1,20 @@ +//@ts-nocheck +import { ConnectionEnd } from "./types/ibc/core/connection/v1/connection" +import { IdentifiedConnection } from "./types/ibc/core/connection/v1/connection" +import { Counterparty } from "./types/ibc/core/connection/v1/connection" +import { ClientPaths } from "./types/ibc/core/connection/v1/connection" +import { ConnectionPaths } from "./types/ibc/core/connection/v1/connection" +import { Version } from "./types/ibc/core/connection/v1/connection" +import { Params } from "./types/ibc/core/connection/v1/connection" + + +export { + ConnectionEnd, + IdentifiedConnection, + Counterparty, + ClientPaths, + ConnectionPaths, + Version, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/ics23/v1/proofs.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/ics23/v1/proofs.ts new file mode 100644 index 0000000000..4dfcb222f9 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,1409 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.ics23.v1"; + +export enum HashOp { + /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + SHA512_256 = 6, + UNRECOGNIZED = -1, +} + +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case 6: + case "SHA512_256": + return HashOp.SHA512_256; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} + +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.SHA512_256: + return "SHA512_256"; + case HashOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} + +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} + +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + case LengthOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf: LeafOp | undefined; + path: InnerOp[]; +} + +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left: ExistenceProof | undefined; + right: ExistenceProof | undefined; +} + +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist: ExistenceProof | undefined; + nonexist: NonExistenceProof | undefined; + batch: BatchProof | undefined; + compressed: CompressedBatchProof | undefined; +} + +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} + +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} + +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec: LeafOp | undefined; + innerSpec: + | InnerSpec + | undefined; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; +} + +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} + +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist: ExistenceProof | undefined; + nonexist: NonExistenceProof | undefined; +} + +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist: CompressedExistenceProof | undefined; + nonexist: CompressedNonExistenceProof | undefined; +} + +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf: + | LeafOp + | undefined; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} + +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left: CompressedExistenceProof | undefined; + right: CompressedExistenceProof | undefined; +} + +function createBaseExistenceProof(): ExistenceProof { + return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] }; +} + +export const ExistenceProof = { + encode(message: ExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExistenceProof { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + leaf: isSet(object.leaf) ? LeafOp.fromJSON(object.leaf) : undefined, + path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromJSON(e)) : [], + }; + }, + + toJSON(message: ExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.path = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ExistenceProof { + const message = createBaseExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = (object.leaf !== undefined && object.leaf !== null) ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map((e) => InnerOp.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseNonExistenceProof(): NonExistenceProof { + return { key: new Uint8Array(), left: undefined, right: undefined }; +} + +export const NonExistenceProof = { + encode(message: NonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NonExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NonExistenceProof { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + left: isSet(object.left) ? ExistenceProof.fromJSON(object.left) : undefined, + right: isSet(object.right) ? ExistenceProof.fromJSON(object.right) : undefined, + }; + }, + + toJSON(message: NonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined && (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): NonExistenceProof { + const message = createBaseNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = (object.left !== undefined && object.left !== null) + ? ExistenceProof.fromPartial(object.left) + : undefined; + message.right = (object.right !== undefined && object.right !== null) + ? ExistenceProof.fromPartial(object.right) + : undefined; + return message; + }, +}; + +function createBaseCommitmentProof(): CommitmentProof { + return { exist: undefined, nonexist: undefined, batch: undefined, compressed: undefined }; +} + +export const CommitmentProof = { + encode(message: CommitmentProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitmentProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitmentProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitmentProof { + return { + exist: isSet(object.exist) ? ExistenceProof.fromJSON(object.exist) : undefined, + nonexist: isSet(object.nonexist) ? NonExistenceProof.fromJSON(object.nonexist) : undefined, + batch: isSet(object.batch) ? BatchProof.fromJSON(object.batch) : undefined, + compressed: isSet(object.compressed) ? CompressedBatchProof.fromJSON(object.compressed) : undefined, + }; + }, + + toJSON(message: CommitmentProof): unknown { + const obj: any = {}; + message.exist !== undefined && (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined + && (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined); + message.compressed !== undefined + && (obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): CommitmentProof { + const message = createBaseCommitmentProof(); + message.exist = (object.exist !== undefined && object.exist !== null) + ? ExistenceProof.fromPartial(object.exist) + : undefined; + message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined; + message.batch = (object.batch !== undefined && object.batch !== null) + ? BatchProof.fromPartial(object.batch) + : undefined; + message.compressed = (object.compressed !== undefined && object.compressed !== null) + ? CompressedBatchProof.fromPartial(object.compressed) + : undefined; + return message; + }, +}; + +function createBaseLeafOp(): LeafOp { + return { hash: 0, prehashKey: 0, prehashValue: 0, length: 0, prefix: new Uint8Array() }; +} + +export const LeafOp = { + encode(message: LeafOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey); + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue); + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length); + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeafOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeafOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prehashKey = reader.int32() as any; + break; + case 3: + message.prehashValue = reader.int32() as any; + break; + case 4: + message.length = reader.int32() as any; + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LeafOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), + }; + }, + + toJSON(message: LeafOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey)); + message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue)); + message.length !== undefined && (obj.length = lengthOpToJSON(message.length)); + message.prefix !== undefined + && (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): LeafOp { + const message = createBaseLeafOp(); + message.hash = object.hash ?? 0; + message.prehashKey = object.prehashKey ?? 0; + message.prehashValue = object.prehashValue ?? 0; + message.length = object.length ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + return message; + }, +}; + +function createBaseInnerOp(): InnerOp { + return { hash: 0, prefix: new Uint8Array(), suffix: new Uint8Array() }; +} + +export const InnerOp = { + encode(message: InnerOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InnerOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InnerOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), + suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array(), + }; + }, + + toJSON(message: InnerOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prefix !== undefined + && (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + message.suffix !== undefined + && (obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): InnerOp { + const message = createBaseInnerOp(); + message.hash = object.hash ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + message.suffix = object.suffix ?? new Uint8Array(); + return message; + }, +}; + +function createBaseProofSpec(): ProofSpec { + return { leafSpec: undefined, innerSpec: undefined, maxDepth: 0, minDepth: 0 }; +} + +export const ProofSpec = { + encode(message: ProofSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth); + } + if (message.minDepth !== 0) { + writer.uint32(32).int32(message.minDepth); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofSpec { + return { + leafSpec: isSet(object.leafSpec) ? LeafOp.fromJSON(object.leafSpec) : undefined, + innerSpec: isSet(object.innerSpec) ? InnerSpec.fromJSON(object.innerSpec) : undefined, + maxDepth: isSet(object.maxDepth) ? Number(object.maxDepth) : 0, + minDepth: isSet(object.minDepth) ? Number(object.minDepth) : 0, + }; + }, + + toJSON(message: ProofSpec): unknown { + const obj: any = {}; + message.leafSpec !== undefined && (obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined); + message.innerSpec !== undefined + && (obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined); + message.maxDepth !== undefined && (obj.maxDepth = Math.round(message.maxDepth)); + message.minDepth !== undefined && (obj.minDepth = Math.round(message.minDepth)); + return obj; + }, + + fromPartial, I>>(object: I): ProofSpec { + const message = createBaseProofSpec(); + message.leafSpec = (object.leafSpec !== undefined && object.leafSpec !== null) + ? LeafOp.fromPartial(object.leafSpec) + : undefined; + message.innerSpec = (object.innerSpec !== undefined && object.innerSpec !== null) + ? InnerSpec.fromPartial(object.innerSpec) + : undefined; + message.maxDepth = object.maxDepth ?? 0; + message.minDepth = object.minDepth ?? 0; + return message; + }, +}; + +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0, + }; +} + +export const InnerSpec = { + encode(message: InnerSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize); + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength); + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength); + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild); + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InnerSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerSpec(); + 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.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InnerSpec { + return { + childOrder: Array.isArray(object?.childOrder) ? object.childOrder.map((e: any) => Number(e)) : [], + childSize: isSet(object.childSize) ? Number(object.childSize) : 0, + minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, + maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, + emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + }; + }, + + toJSON(message: InnerSpec): unknown { + const obj: any = {}; + if (message.childOrder) { + obj.childOrder = message.childOrder.map((e) => Math.round(e)); + } else { + obj.childOrder = []; + } + message.childSize !== undefined && (obj.childSize = Math.round(message.childSize)); + message.minPrefixLength !== undefined && (obj.minPrefixLength = Math.round(message.minPrefixLength)); + message.maxPrefixLength !== undefined && (obj.maxPrefixLength = Math.round(message.maxPrefixLength)); + message.emptyChild !== undefined + && (obj.emptyChild = base64FromBytes(message.emptyChild !== undefined ? message.emptyChild : new Uint8Array())); + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + return obj; + }, + + fromPartial, I>>(object: I): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.childOrder?.map((e) => e) || []; + message.childSize = object.childSize ?? 0; + message.minPrefixLength = object.minPrefixLength ?? 0; + message.maxPrefixLength = object.maxPrefixLength ?? 0; + message.emptyChild = object.emptyChild ?? new Uint8Array(); + message.hash = object.hash ?? 0; + return message; + }, +}; + +function createBaseBatchProof(): BatchProof { + return { entries: [] }; +} + +export const BatchProof = { + encode(message: BatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BatchProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchProof { + return { entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromJSON(e)) : [] }; + }, + + toJSON(message: BatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => e ? BatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial, I>>(object: I): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map((e) => BatchEntry.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseBatchEntry(): BatchEntry { + return { exist: undefined, nonexist: undefined }; +} + +export const BatchEntry = { + encode(message: BatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BatchEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchEntry { + return { + exist: isSet(object.exist) ? ExistenceProof.fromJSON(object.exist) : undefined, + nonexist: isSet(object.nonexist) ? NonExistenceProof.fromJSON(object.nonexist) : undefined, + }; + }, + + toJSON(message: BatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined && (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined + && (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): BatchEntry { + const message = createBaseBatchEntry(); + message.exist = (object.exist !== undefined && object.exist !== null) + ? ExistenceProof.fromPartial(object.exist) + : undefined; + message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined; + return message; + }, +}; + +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { entries: [], lookupInners: [] }; +} + +export const CompressedBatchProof = { + encode(message: CompressedBatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedBatchProof { + return { + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromJSON(e)) : [], + lookupInners: Array.isArray(object?.lookupInners) ? object.lookupInners.map((e: any) => InnerOp.fromJSON(e)) : [], + }; + }, + + toJSON(message: CompressedBatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => e ? CompressedBatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookupInners = message.lookupInners.map((e) => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.lookupInners = []; + } + return obj; + }, + + fromPartial, I>>(object: I): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map((e) => CompressedBatchEntry.fromPartial(e)) || []; + message.lookupInners = object.lookupInners?.map((e) => InnerOp.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { exist: undefined, nonexist: undefined }; +} + +export const CompressedBatchEntry = { + encode(message: CompressedBatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedBatchEntry { + return { + exist: isSet(object.exist) ? CompressedExistenceProof.fromJSON(object.exist) : undefined, + nonexist: isSet(object.nonexist) ? CompressedNonExistenceProof.fromJSON(object.nonexist) : undefined, + }; + }, + + toJSON(message: CompressedBatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined + && (obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined + && (obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + message.exist = (object.exist !== undefined && object.exist !== null) + ? CompressedExistenceProof.fromPartial(object.exist) + : undefined; + message.nonexist = (object.nonexist !== undefined && object.nonexist !== null) + ? CompressedNonExistenceProof.fromPartial(object.nonexist) + : undefined; + return message; + }, +}; + +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { key: new Uint8Array(), value: new Uint8Array(), leaf: undefined, path: [] }; +} + +export const CompressedExistenceProof = { + encode(message: CompressedExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedExistenceProof { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + leaf: isSet(object.leaf) ? LeafOp.fromJSON(object.leaf) : undefined, + path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], + }; + }, + + toJSON(message: CompressedExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => Math.round(e)); + } else { + obj.path = []; + } + return obj; + }, + + fromPartial, I>>(object: I): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = (object.leaf !== undefined && object.leaf !== null) ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map((e) => e) || []; + return message; + }, +}; + +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { key: new Uint8Array(), left: undefined, right: undefined }; +} + +export const CompressedNonExistenceProof = { + encode(message: CompressedNonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedNonExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedNonExistenceProof { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + left: isSet(object.left) ? CompressedExistenceProof.fromJSON(object.left) : undefined, + right: isSet(object.right) ? CompressedExistenceProof.fromJSON(object.right) : undefined, + }; + }, + + toJSON(message: CompressedNonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && (obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined + && (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = (object.left !== undefined && object.left !== null) + ? CompressedExistenceProof.fromPartial(object.left) + : undefined; + message.right = (object.right !== undefined && object.right !== null) + ? CompressedExistenceProof.fromPartial(object.right) + : undefined; + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/upgrade/v1beta1/upgrade.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000000..4b2ecab4a4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,432 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + time: + | Date + | undefined; + /** The height at which the upgrade must be performed. */ + height: number; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + * + * @deprecated + */ + upgradedClientState: Any | undefined; +} + +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + * + * @deprecated + */ +export interface SoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan | undefined; +} + +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + * + * @deprecated + */ +export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} + +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: number; +} + +function createBasePlan(): Plan { + return { name: "", time: undefined, height: 0, info: "", upgradedClientState: undefined }; +} + +export const Plan = { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (message.height !== 0) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.height = longToNumber(reader.int64() as Long); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? Number(object.height) : 0, + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: Plan): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.height !== undefined && (obj.height = Math.round(message.height)); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time ?? undefined; + message.height = object.height ?? 0; + message.info = object.info ?? ""; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { title: "", description: "", plan: undefined }; +} + +export const SoftwareUpgradeProposal = { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + }; + }, + + toJSON(message: SoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + return message; + }, +}; + +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { title: "", description: "" }; +} + +export const CancelSoftwareUpgradeProposal = { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelSoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: CancelSoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I, + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseModuleVersion(): ModuleVersion { + return { name: "", version: 0 }; +} + +export const ModuleVersion = { + encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== 0) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? Number(object.version) : 0, + }; + }, + + toJSON(message: ModuleVersion): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = Math.round(message.version)); + return obj; + }, + + fromPartial, I>>(object: I): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/any.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/any.ts new file mode 100644 index 0000000000..363af6de7c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/any.ts @@ -0,0 +1,241 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array() }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined + && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/timestamp.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/timestamp.ts new file mode 100644 index 0000000000..93776d9496 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/google/protobuf/timestamp.ts @@ -0,0 +1,217 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + 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 = longToNumber(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) ? Number(object.seconds) : 0, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = Math.round(message.seconds)); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial, I>>(object: I): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/client/v1/client.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/client/v1/client.ts new file mode 100644 index 0000000000..0f612c313b --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/client/v1/client.ts @@ -0,0 +1,613 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState: Any | undefined; +} + +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: + | Height + | undefined; + /** consensus state */ + consensusState: Any | undefined; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} + +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + title: string; + description: string; + plan: + | Plan + | undefined; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState: Any | undefined; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: number; + /** the height within the given revision */ + revisionHeight: number; +} + +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} + +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { clientId: "", clientState: undefined }; +} + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + }; + }, + + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + return message; + }, +}; + +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { height: undefined, consensusState: undefined }; +} + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + }; + }, + + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + return message; + }, +}; + +function createBaseClientConsensusStates(): ClientConsensusStates { + return { clientId: "", consensusStates: [] }; +} + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) + ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { title: "", description: "", subjectClientId: "", substituteClientId: "" }; +} + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "", + }; + }, + + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, + + fromPartial, I>>(object: I): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, +}; + +function createBaseUpgradeProposal(): UpgradeProposal { + return { title: "", description: "", plan: undefined, upgradedClientState: undefined }; +} + +export const UpgradeProposal = { + encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + }; + }, + + toJSON(message: UpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined + && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = (object.plan !== undefined && object.plan !== null) ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = (object.upgradedClientState !== undefined && object.upgradedClientState !== null) + ? Any.fromPartial(object.upgradedClientState) + : undefined; + return message; + }, +}; + +function createBaseHeight(): Height { + return { revisionNumber: 0, revisionHeight: 0 }; +} + +export const Height = { + encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revisionNumber !== 0) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Height { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 2: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>(object: I): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseParams(): Params { + return { allowedClients: [] }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 0000000000..6b935dfcab --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,300 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { CommitmentProof } from "../../../../cosmos/ics23/v1/proofs"; + +export const protobufPackage = "ibc.core.commitment.v1"; + +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} + +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} + +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePath { + keyPath: string[]; +} + +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} + +function createBaseMerkleRoot(): MerkleRoot { + return { hash: new Uint8Array() }; +} + +export const MerkleRoot = { + encode(message: MerkleRoot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleRoot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerkleRoot { + return { hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array() }; + }, + + toJSON(message: MerkleRoot): unknown { + const obj: any = {}; + message.hash !== undefined + && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MerkleRoot { + const message = createBaseMerkleRoot(); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMerklePrefix(): MerklePrefix { + return { keyPrefix: new Uint8Array() }; +} + +export const MerklePrefix = { + encode(message: MerklePrefix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePrefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerklePrefix { + return { keyPrefix: isSet(object.keyPrefix) ? bytesFromBase64(object.keyPrefix) : new Uint8Array() }; + }, + + toJSON(message: MerklePrefix): unknown { + const obj: any = {}; + message.keyPrefix !== undefined + && (obj.keyPrefix = base64FromBytes(message.keyPrefix !== undefined ? message.keyPrefix : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MerklePrefix { + const message = createBaseMerklePrefix(); + message.keyPrefix = object.keyPrefix ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMerklePath(): MerklePath { + return { keyPath: [] }; +} + +export const MerklePath = { + encode(message: MerklePath, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.keyPath) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerklePath { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePath(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerklePath { + return { keyPath: Array.isArray(object?.keyPath) ? object.keyPath.map((e: any) => String(e)) : [] }; + }, + + toJSON(message: MerklePath): unknown { + const obj: any = {}; + if (message.keyPath) { + obj.keyPath = message.keyPath.map((e) => e); + } else { + obj.keyPath = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MerklePath { + const message = createBaseMerklePath(); + message.keyPath = object.keyPath?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMerkleProof(): MerkleProof { + return { proofs: [] }; +} + +export const MerkleProof = { + encode(message: MerkleProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerkleProof { + return { proofs: Array.isArray(object?.proofs) ? object.proofs.map((e: any) => CommitmentProof.fromJSON(e)) : [] }; + }, + + toJSON(message: MerkleProof): unknown { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map((e) => e ? CommitmentProof.toJSON(e) : undefined); + } else { + obj.proofs = []; + } + return obj; + }, + + fromPartial, I>>(object: I): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map((e) => CommitmentProof.fromPartial(e)) || []; + 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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/connection.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/connection.ts new file mode 100644 index 0000000000..6f4e2116fb --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/connection.ts @@ -0,0 +1,699 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { MerklePrefix } from "../../commitment/v1/commitment"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: + | Counterparty + | undefined; + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delayPeriod: number; +} + +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: + | Counterparty + | undefined; + /** delay period associated with this connection. */ + delayPeriod: number; +} + +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix | undefined; +} + +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} + +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} + +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} + +/** Params defines the set of Connection parameters. */ +export interface Params { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + */ + maxExpectedTimePerBlock: number; +} + +function createBaseConnectionEnd(): ConnectionEnd { + return { clientId: "", versions: [], state: 0, counterparty: undefined, delayPeriod: 0 }; +} + +export const ConnectionEnd = { + encode(message: ConnectionEnd, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== 0) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = reader.int32() as any; + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConnectionEnd { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], + state: isSet(object.state) ? stateFromJSON(object.state) : 0, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? Number(object.delayPeriod) : 0, + }; + }, + + toJSON(message: ConnectionEnd): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => e ? Version.toJSON(e) : undefined); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = Math.round(message.delayPeriod)); + return obj; + }, + + fromPartial, I>>(object: I): ConnectionEnd { + const message = createBaseConnectionEnd(); + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map((e) => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.delayPeriod = object.delayPeriod ?? 0; + return message; + }, +}; + +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { id: "", clientId: "", versions: [], state: 0, counterparty: undefined, delayPeriod: 0 }; +} + +export const IdentifiedConnection = { + encode(message: IdentifiedConnection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (message.delayPeriod !== 0) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = reader.int32() as any; + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedConnection { + return { + id: isSet(object.id) ? String(object.id) : "", + clientId: isSet(object.clientId) ? String(object.clientId) : "", + versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], + state: isSet(object.state) ? stateFromJSON(object.state) : 0, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? Number(object.delayPeriod) : 0, + }; + }, + + toJSON(message: IdentifiedConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => e ? Version.toJSON(e) : undefined); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = Math.round(message.delayPeriod)); + return obj; + }, + + fromPartial, I>>(object: I): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + message.id = object.id ?? ""; + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map((e) => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.delayPeriod = object.delayPeriod ?? 0; + return message; + }, +}; + +function createBaseCounterparty(): Counterparty { + return { clientId: "", connectionId: "", prefix: undefined }; +} + +export const Counterparty = { + encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Counterparty { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + prefix: isSet(object.prefix) ? MerklePrefix.fromJSON(object.prefix) : undefined, + }; + }, + + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.prefix !== undefined && (obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Counterparty { + const message = createBaseCounterparty(); + message.clientId = object.clientId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.prefix = (object.prefix !== undefined && object.prefix !== null) + ? MerklePrefix.fromPartial(object.prefix) + : undefined; + return message; + }, +}; + +function createBaseClientPaths(): ClientPaths { + return { paths: [] }; +} + +export const ClientPaths = { + encode(message: ClientPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientPaths { + return { paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => String(e)) : [] }; + }, + + toJSON(message: ClientPaths): unknown { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map((e) => e) || []; + return message; + }, +}; + +function createBaseConnectionPaths(): ConnectionPaths { + return { clientId: "", paths: [] }; +} + +export const ConnectionPaths = { + encode(message: ConnectionPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConnectionPaths { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: ConnectionPaths): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ConnectionPaths { + const message = createBaseConnectionPaths(); + message.clientId = object.clientId ?? ""; + message.paths = object.paths?.map((e) => e) || []; + return message; + }, +}; + +function createBaseVersion(): Version { + return { identifier: "", features: [] }; +} + +export const Version = { + encode(message: Version, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Version { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Version { + return { + identifier: isSet(object.identifier) ? String(object.identifier) : "", + features: Array.isArray(object?.features) ? object.features.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Version): unknown { + const obj: any = {}; + message.identifier !== undefined && (obj.identifier = message.identifier); + if (message.features) { + obj.features = message.features.map((e) => e); + } else { + obj.features = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Version { + const message = createBaseVersion(); + message.identifier = object.identifier ?? ""; + message.features = object.features?.map((e) => e) || []; + return message; + }, +}; + +function createBaseParams(): Params { + return { maxExpectedTimePerBlock: 0 }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxExpectedTimePerBlock !== 0) { + writer.uint32(8).uint64(message.maxExpectedTimePerBlock); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxExpectedTimePerBlock = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + maxExpectedTimePerBlock: isSet(object.maxExpectedTimePerBlock) ? Number(object.maxExpectedTimePerBlock) : 0, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.maxExpectedTimePerBlock !== undefined + && (obj.maxExpectedTimePerBlock = Math.round(message.maxExpectedTimePerBlock)); + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/genesis.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/genesis.ts new file mode 100644 index 0000000000..cb90add930 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/genesis.ts @@ -0,0 +1,153 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ConnectionPaths, IdentifiedConnection, Params } from "./connection"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisState { + connections: IdentifiedConnection[]; + clientConnectionPaths: ConnectionPaths[]; + /** the sequence for the next generated connection identifier */ + nextConnectionSequence: number; + params: Params | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { connections: [], clientConnectionPaths: [], nextConnectionSequence: 0, params: undefined }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientConnectionPaths) { + ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.nextConnectionSequence !== 0) { + writer.uint32(24).uint64(message.nextConnectionSequence); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32())); + break; + case 3: + message.nextConnectionSequence = longToNumber(reader.uint64() as Long); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + connections: Array.isArray(object?.connections) + ? object.connections.map((e: any) => IdentifiedConnection.fromJSON(e)) + : [], + clientConnectionPaths: Array.isArray(object?.clientConnectionPaths) + ? object.clientConnectionPaths.map((e: any) => ConnectionPaths.fromJSON(e)) + : [], + nextConnectionSequence: isSet(object.nextConnectionSequence) ? Number(object.nextConnectionSequence) : 0, + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map((e) => e ? IdentifiedConnection.toJSON(e) : undefined); + } else { + obj.connections = []; + } + if (message.clientConnectionPaths) { + obj.clientConnectionPaths = message.clientConnectionPaths.map((e) => e ? ConnectionPaths.toJSON(e) : undefined); + } else { + obj.clientConnectionPaths = []; + } + message.nextConnectionSequence !== undefined + && (obj.nextConnectionSequence = Math.round(message.nextConnectionSequence)); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.connections = object.connections?.map((e) => IdentifiedConnection.fromPartial(e)) || []; + message.clientConnectionPaths = object.clientConnectionPaths?.map((e) => ConnectionPaths.fromPartial(e)) || []; + message.nextConnectionSequence = object.nextConnectionSequence ?? 0; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/query.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/query.ts new file mode 100644 index 0000000000..a723aa50f3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/query.ts @@ -0,0 +1,1042 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; +import { Height, IdentifiedClientState } from "../../client/v1/client"; +import { ConnectionEnd, IdentifiedConnection, Params } from "./connection"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequest { + /** connection unique identifier */ + connectionId: string; +} + +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponse { + /** connection associated with the request identifier */ + connection: + | ConnectionEnd + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequest { + pagination: PageRequest | undefined; +} + +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponse { + /** list of stored connections of the chain. */ + connections: IdentifiedConnection[]; + /** pagination response */ + pagination: + | PageResponse + | undefined; + /** query block height */ + height: Height | undefined; +} + +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequest { + /** client identifier associated with a connection */ + clientId: string; +} + +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponse { + /** slice of all the connection paths associated with a client. */ + connectionPaths: string[]; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was generated */ + proofHeight: Height | undefined; +} + +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequest { + /** connection identifier */ + connectionId: string; +} + +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponse { + /** client state associated with the channel */ + identifiedClientState: + | IdentifiedClientState + | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequest { + /** connection identifier */ + connectionId: string; + revisionNumber: number; + revisionHeight: number; +} + +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState: + | Any + | undefined; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} + +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequest { +} + +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} + +function createBaseQueryConnectionRequest(): QueryConnectionRequest { + return { connectionId: "" }; +} + +export const QueryConnectionRequest = { + encode(message: QueryConnectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionRequest { + return { connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" }; + }, + + toJSON(message: QueryConnectionRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, + + fromPartial, I>>(object: I): QueryConnectionRequest { + const message = createBaseQueryConnectionRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, +}; + +function createBaseQueryConnectionResponse(): QueryConnectionResponse { + return { connection: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryConnectionResponse = { + encode(message: QueryConnectionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionResponse { + return { + connection: isSet(object.connection) ? ConnectionEnd.fromJSON(object.connection) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryConnectionResponse): unknown { + const obj: any = {}; + message.connection !== undefined + && (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConnectionResponse { + const message = createBaseQueryConnectionResponse(); + message.connection = (object.connection !== undefined && object.connection !== null) + ? ConnectionEnd.fromPartial(object.connection) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { + return { pagination: undefined }; +} + +export const QueryConnectionsRequest = { + encode(message: QueryConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionsRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryConnectionsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConnectionsRequest { + const message = createBaseQueryConnectionsRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { + return { connections: [], pagination: undefined, height: undefined }; +} + +export const QueryConnectionsResponse = { + encode(message: QueryConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionsResponse { + return { + connections: Array.isArray(object?.connections) + ? object.connections.map((e: any) => IdentifiedConnection.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + }; + }, + + toJSON(message: QueryConnectionsResponse): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map((e) => e ? IdentifiedConnection.toJSON(e) : undefined); + } else { + obj.connections = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryConnectionsResponse { + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map((e) => IdentifiedConnection.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + message.height = (object.height !== undefined && object.height !== null) + ? Height.fromPartial(object.height) + : undefined; + return message; + }, +}; + +function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsRequest { + return { clientId: "" }; +} + +export const QueryClientConnectionsRequest = { + encode(message: QueryClientConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientConnectionsRequest { + return { clientId: isSet(object.clientId) ? String(object.clientId) : "" }; + }, + + toJSON(message: QueryClientConnectionsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryClientConnectionsRequest { + const message = createBaseQueryClientConnectionsRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, +}; + +function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsResponse { + return { connectionPaths: [], proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryClientConnectionsResponse = { + encode(message: QueryClientConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connectionPaths) { + writer.uint32(10).string(v!); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientConnectionsResponse { + return { + connectionPaths: Array.isArray(object?.connectionPaths) ? object.connectionPaths.map((e: any) => String(e)) : [], + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryClientConnectionsResponse): unknown { + const obj: any = {}; + if (message.connectionPaths) { + obj.connectionPaths = message.connectionPaths.map((e) => e); + } else { + obj.connectionPaths = []; + } + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryClientConnectionsResponse { + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connectionPaths?.map((e) => e) || []; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientStateRequest { + return { connectionId: "" }; +} + +export const QueryConnectionClientStateRequest = { + encode(message: QueryConnectionClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionClientStateRequest { + return { connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" }; + }, + + toJSON(message: QueryConnectionClientStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionClientStateRequest { + const message = createBaseQueryConnectionClientStateRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, +}; + +function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientStateResponse { + return { identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryConnectionClientStateResponse = { + encode(message: QueryConnectionClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionClientStateResponse { + return { + identifiedClientState: isSet(object.identifiedClientState) + ? IdentifiedClientState.fromJSON(object.identifiedClientState) + : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryConnectionClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionClientStateResponse { + const message = createBaseQueryConnectionClientStateResponse(); + message.identifiedClientState = + (object.identifiedClientState !== undefined && object.identifiedClientState !== null) + ? IdentifiedClientState.fromPartial(object.identifiedClientState) + : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsensusStateRequest { + return { connectionId: "", revisionNumber: 0, revisionHeight: 0 }; +} + +export const QueryConnectionConsensusStateRequest = { + encode(message: QueryConnectionConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.revisionNumber !== 0) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== 0) { + writer.uint32(24).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = longToNumber(reader.uint64() as Long); + break; + case 3: + message.revisionHeight = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionConsensusStateRequest { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + revisionNumber: isSet(object.revisionNumber) ? Number(object.revisionNumber) : 0, + revisionHeight: isSet(object.revisionHeight) ? Number(object.revisionHeight) : 0, + }; + }, + + toJSON(message: QueryConnectionConsensusStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.revisionNumber !== undefined && (obj.revisionNumber = Math.round(message.revisionNumber)); + message.revisionHeight !== undefined && (obj.revisionHeight = Math.round(message.revisionHeight)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionConsensusStateRequest { + const message = createBaseQueryConnectionConsensusStateRequest(); + message.connectionId = object.connectionId ?? ""; + message.revisionNumber = object.revisionNumber ?? 0; + message.revisionHeight = object.revisionHeight ?? 0; + return message; + }, +}; + +function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { + return { consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: undefined }; +} + +export const QueryConnectionConsensusStateResponse = { + encode(message: QueryConnectionConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + clientId: isSet(object.clientId) ? String(object.clientId) : "", + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + }; + }, + + toJSON(message: QueryConnectionConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined + && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined + && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionConsensusStateResponse { + const message = createBaseQueryConnectionConsensusStateResponse(); + message.consensusState = (object.consensusState !== undefined && object.consensusState !== null) + ? Any.fromPartial(object.consensusState) + : undefined; + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + return message; + }, +}; + +function createBaseQueryConnectionParamsRequest(): QueryConnectionParamsRequest { + return {}; +} + +export const QueryConnectionParamsRequest = { + encode(_: QueryConnectionParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryConnectionParamsRequest { + return {}; + }, + + toJSON(_: QueryConnectionParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryConnectionParamsRequest { + const message = createBaseQueryConnectionParamsRequest(); + return message; + }, +}; + +function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsResponse { + return { params: undefined }; +} + +export const QueryConnectionParamsResponse = { + encode(message: QueryConnectionParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionParamsResponse { + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryConnectionParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryConnectionParamsResponse { + const message = createBaseQueryConnectionParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Connection queries an IBC connection end. */ + Connection(request: QueryConnectionRequest): Promise; + /** Connections queries all the IBC connections of a chain. */ + Connections(request: QueryConnectionsRequest): Promise; + /** + * ClientConnections queries the connection paths associated with a client + * state. + */ + ClientConnections(request: QueryClientConnectionsRequest): Promise; + /** + * ConnectionClientState queries the client state associated with the + * connection. + */ + ConnectionClientState(request: QueryConnectionClientStateRequest): Promise; + /** + * ConnectionConsensusState queries the consensus state associated with the + * connection. + */ + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise; + /** ConnectionParams queries all parameters of the ibc connection submodule. */ + ConnectionParams(request: QueryConnectionParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Connection = this.Connection.bind(this); + this.Connections = this.Connections.bind(this); + this.ClientConnections = this.ClientConnections.bind(this); + this.ConnectionClientState = this.ConnectionClientState.bind(this); + this.ConnectionConsensusState = this.ConnectionConsensusState.bind(this); + this.ConnectionParams = this.ConnectionParams.bind(this); + } + Connection(request: QueryConnectionRequest): Promise { + const data = QueryConnectionRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); + return promise.then((data) => QueryConnectionResponse.decode(new _m0.Reader(data))); + } + + Connections(request: QueryConnectionsRequest): Promise { + const data = QueryConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); + return promise.then((data) => QueryConnectionsResponse.decode(new _m0.Reader(data))); + } + + ClientConnections(request: QueryClientConnectionsRequest): Promise { + const data = QueryClientConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); + return promise.then((data) => QueryClientConnectionsResponse.decode(new _m0.Reader(data))); + } + + ConnectionClientState(request: QueryConnectionClientStateRequest): Promise { + const data = QueryConnectionClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); + return promise.then((data) => QueryConnectionClientStateResponse.decode(new _m0.Reader(data))); + } + + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise { + const data = QueryConnectionConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); + return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new _m0.Reader(data))); + } + + ConnectionParams(request: QueryConnectionParamsRequest): Promise { + const data = QueryConnectionParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionParams", data); + return promise.then((data) => QueryConnectionParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.ts b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.ts new file mode 100644 index 0000000000..44401ec79a --- /dev/null +++ b/wormchain/ts-sdk/src/modules/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.ts @@ -0,0 +1,943 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; +import { Height } from "../../client/v1/client"; +import { Counterparty, Version } from "./connection"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty: Counterparty | undefined; + version: Version | undefined; + delayPeriod: number; + signer: string; +} + +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse { +} + +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** + * Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. + * + * @deprecated + */ + previousConnectionId: string; + clientState: Any | undefined; + counterparty: Counterparty | undefined; + delayPeriod: number; + counterpartyVersions: Version[]; + proofHeight: + | Height + | undefined; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height | undefined; + signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; +} + +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse { +} + +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version: Version | undefined; + clientState: Any | undefined; + proofHeight: + | Height + | undefined; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height | undefined; + signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; +} + +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse { +} + +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} + +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse { +} + +function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { + return { clientId: "", counterparty: undefined, version: undefined, delayPeriod: 0, signer: "" }; +} + +export const MsgConnectionOpenInit = { + encode(message: MsgConnectionOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.delayPeriod !== 0) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = longToNumber(reader.uint64() as Long); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenInit { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + version: isSet(object.version) ? Version.fromJSON(object.version) : undefined, + delayPeriod: isSet(object.delayPeriod) ? Number(object.delayPeriod) : 0, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgConnectionOpenInit): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.version !== undefined && (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = Math.round(message.delayPeriod)); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + message.clientId = object.clientId ?? ""; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.version = (object.version !== undefined && object.version !== null) + ? Version.fromPartial(object.version) + : undefined; + message.delayPeriod = object.delayPeriod ?? 0; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { + return {}; +} + +export const MsgConnectionOpenInitResponse = { + encode(_: MsgConnectionOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenInitResponse { + return {}; + }, + + toJSON(_: MsgConnectionOpenInitResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, +}; + +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: "", + previousConnectionId: "", + clientState: undefined, + counterparty: undefined, + delayPeriod: 0, + counterpartyVersions: [], + proofHeight: undefined, + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: undefined, + signer: "", + hostConsensusStateProof: new Uint8Array(), + }; +} + +export const MsgConnectionOpenTry = { + encode(message: MsgConnectionOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== 0) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(98).string(message.signer); + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(106).bytes(message.hostConsensusStateProof); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = longToNumber(reader.uint64() as Long); + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + case 13: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenTry { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + previousConnectionId: isSet(object.previousConnectionId) ? String(object.previousConnectionId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? Number(object.delayPeriod) : 0, + counterpartyVersions: Array.isArray(object?.counterpartyVersions) + ? object.counterpartyVersions.map((e: any) => Version.fromJSON(e)) + : [], + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofClient: isSet(object.proofClient) ? bytesFromBase64(object.proofClient) : new Uint8Array(), + proofConsensus: isSet(object.proofConsensus) ? bytesFromBase64(object.proofConsensus) : new Uint8Array(), + consensusHeight: isSet(object.consensusHeight) ? Height.fromJSON(object.consensusHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + hostConsensusStateProof: isSet(object.hostConsensusStateProof) + ? bytesFromBase64(object.hostConsensusStateProof) + : new Uint8Array(), + }; + }, + + toJSON(message: MsgConnectionOpenTry): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.previousConnectionId !== undefined && (obj.previousConnectionId = message.previousConnectionId); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.counterparty !== undefined + && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = Math.round(message.delayPeriod)); + if (message.counterpartyVersions) { + obj.counterpartyVersions = message.counterpartyVersions.map((e) => e ? Version.toJSON(e) : undefined); + } else { + obj.counterpartyVersions = []; + } + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofInit !== undefined + && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofClient !== undefined + && (obj.proofClient = base64FromBytes( + message.proofClient !== undefined ? message.proofClient : new Uint8Array(), + )); + message.proofConsensus !== undefined + && (obj.proofConsensus = base64FromBytes( + message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array(), + )); + message.consensusHeight !== undefined + && (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + message.hostConsensusStateProof !== undefined + && (obj.hostConsensusStateProof = base64FromBytes( + message.hostConsensusStateProof !== undefined ? message.hostConsensusStateProof : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + message.clientId = object.clientId ?? ""; + message.previousConnectionId = object.previousConnectionId ?? ""; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + message.counterparty = (object.counterparty !== undefined && object.counterparty !== null) + ? Counterparty.fromPartial(object.counterparty) + : undefined; + message.delayPeriod = object.delayPeriod ?? 0; + message.counterpartyVersions = object.counterpartyVersions?.map((e) => Version.fromPartial(e)) || []; + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = (object.consensusHeight !== undefined && object.consensusHeight !== null) + ? Height.fromPartial(object.consensusHeight) + : undefined; + message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { + return {}; +} + +export const MsgConnectionOpenTryResponse = { + encode(_: MsgConnectionOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenTryResponse { + return {}; + }, + + toJSON(_: MsgConnectionOpenTryResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, +}; + +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: "", + counterpartyConnectionId: "", + version: undefined, + clientState: undefined, + proofHeight: undefined, + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: undefined, + signer: "", + hostConsensusStateProof: new Uint8Array(), + }; +} + +export const MsgConnectionOpenAck = { + encode(message: MsgConnectionOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(82).string(message.signer); + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(90).bytes(message.hostConsensusStateProof); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAck { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + case 11: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenAck { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + counterpartyConnectionId: isSet(object.counterpartyConnectionId) ? String(object.counterpartyConnectionId) : "", + version: isSet(object.version) ? Version.fromJSON(object.version) : undefined, + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + proofTry: isSet(object.proofTry) ? bytesFromBase64(object.proofTry) : new Uint8Array(), + proofClient: isSet(object.proofClient) ? bytesFromBase64(object.proofClient) : new Uint8Array(), + proofConsensus: isSet(object.proofConsensus) ? bytesFromBase64(object.proofConsensus) : new Uint8Array(), + consensusHeight: isSet(object.consensusHeight) ? Height.fromJSON(object.consensusHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + hostConsensusStateProof: isSet(object.hostConsensusStateProof) + ? bytesFromBase64(object.hostConsensusStateProof) + : new Uint8Array(), + }; + }, + + toJSON(message: MsgConnectionOpenAck): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.counterpartyConnectionId !== undefined && (obj.counterpartyConnectionId = message.counterpartyConnectionId); + message.version !== undefined && (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.clientState !== undefined + && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofTry !== undefined + && (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofClient !== undefined + && (obj.proofClient = base64FromBytes( + message.proofClient !== undefined ? message.proofClient : new Uint8Array(), + )); + message.proofConsensus !== undefined + && (obj.proofConsensus = base64FromBytes( + message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array(), + )); + message.consensusHeight !== undefined + && (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + message.hostConsensusStateProof !== undefined + && (obj.hostConsensusStateProof = base64FromBytes( + message.hostConsensusStateProof !== undefined ? message.hostConsensusStateProof : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + message.connectionId = object.connectionId ?? ""; + message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; + message.version = (object.version !== undefined && object.version !== null) + ? Version.fromPartial(object.version) + : undefined; + message.clientState = (object.clientState !== undefined && object.clientState !== null) + ? Any.fromPartial(object.clientState) + : undefined; + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = (object.consensusHeight !== undefined && object.consensusHeight !== null) + ? Height.fromPartial(object.consensusHeight) + : undefined; + message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { + return {}; +} + +export const MsgConnectionOpenAckResponse = { + encode(_: MsgConnectionOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenAckResponse { + return {}; + }, + + toJSON(_: MsgConnectionOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, +}; + +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { connectionId: "", proofAck: new Uint8Array(), proofHeight: undefined, signer: "" }; +} + +export const MsgConnectionOpenConfirm = { + encode(message: MsgConnectionOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenConfirm { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + proofAck: isSet(object.proofAck) ? bytesFromBase64(object.proofAck) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgConnectionOpenConfirm): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.proofAck !== undefined + && (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined + && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + message.connectionId = object.connectionId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = (object.proofHeight !== undefined && object.proofHeight !== null) + ? Height.fromPartial(object.proofHeight) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { + return {}; +} + +export const MsgConnectionOpenConfirmResponse = { + encode(_: MsgConnectionOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenConfirmResponse { + return {}; + }, + + toJSON(_: MsgConnectionOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, +}; + +/** Msg defines the ibc/connection Msg service. */ +export interface Msg { + /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ + ConnectionOpenInit(request: MsgConnectionOpenInit): Promise; + /** ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ + ConnectionOpenTry(request: MsgConnectionOpenTry): Promise; + /** ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ + ConnectionOpenAck(request: MsgConnectionOpenAck): Promise; + /** + * ConnectionOpenConfirm defines a rpc handler method for + * MsgConnectionOpenConfirm. + */ + ConnectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ConnectionOpenInit = this.ConnectionOpenInit.bind(this); + this.ConnectionOpenTry = this.ConnectionOpenTry.bind(this); + this.ConnectionOpenAck = this.ConnectionOpenAck.bind(this); + this.ConnectionOpenConfirm = this.ConnectionOpenConfirm.bind(this); + } + ConnectionOpenInit(request: MsgConnectionOpenInit): Promise { + const data = MsgConnectionOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenInit", data); + return promise.then((data) => MsgConnectionOpenInitResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenTry(request: MsgConnectionOpenTry): Promise { + const data = MsgConnectionOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenTry", data); + return promise.then((data) => MsgConnectionOpenTryResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenAck(request: MsgConnectionOpenAck): Promise { + const data = MsgConnectionOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenAck", data); + return promise.then((data) => MsgConnectionOpenAckResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise { + const data = MsgConnectionOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); + return promise.then((data) => MsgConnectionOpenConfirmResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/index.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/index.ts index d804b3a8cc..22eb94e77f 100755 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/index.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/index.ts @@ -1,76 +1,7 @@ //@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgCreateDenom } from "./types/osmosis/tokenfactory/v1beta1/tx"; -import { MsgMint } from "./types/osmosis/tokenfactory/v1beta1/tx"; -import { MsgForceTransfer } from "./types/osmosis/tokenfactory/v1beta1/tx"; -import { MsgSetDenomMetadata } from "./types/osmosis/tokenfactory/v1beta1/tx"; -import { MsgBurn } from "./types/osmosis/tokenfactory/v1beta1/tx"; -import { MsgChangeAdmin } from "./types/osmosis/tokenfactory/v1beta1/tx"; - - -const types = [ - ["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], - ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], - ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer], - ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], - ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], - ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCreateDenom: (data: MsgCreateDenom): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", value: MsgCreateDenom.fromPartial( data ) }), - msgMint: (data: MsgMint): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", value: MsgMint.fromPartial( data ) }), - msgForceTransfer: (data: MsgForceTransfer): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", value: MsgForceTransfer.fromPartial( data ) }), - msgSetDenomMetadata: (data: MsgSetDenomMetadata): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", value: MsgSetDenomMetadata.fromPartial( data ) }), - msgBurn: (data: MsgBurn): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", value: MsgBurn.fromPartial( data ) }), - msgChangeAdmin: (data: MsgChangeAdmin): EncodeObject => ({ typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", value: MsgChangeAdmin.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/module.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/module.ts new file mode 100755 index 0000000000..2edeb2cacd --- /dev/null +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/module.ts @@ -0,0 +1,301 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgSetDenomMetadata } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgCreateDenom } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgBurn } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgMint } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgChangeAdmin } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgForceTransfer } from "./types/osmosis/tokenfactory/v1beta1/tx"; + +import { DenomAuthorityMetadata as typeDenomAuthorityMetadata} from "./types" +import { GenesisDenom as typeGenesisDenom} from "./types" +import { Params as typeParams} from "./types" + +export { MsgSetDenomMetadata, MsgCreateDenom, MsgBurn, MsgMint, MsgChangeAdmin, MsgForceTransfer }; + +type sendMsgSetDenomMetadataParams = { + value: MsgSetDenomMetadata, + fee?: StdFee, + memo?: string +}; + +type sendMsgCreateDenomParams = { + value: MsgCreateDenom, + fee?: StdFee, + memo?: string +}; + +type sendMsgBurnParams = { + value: MsgBurn, + fee?: StdFee, + memo?: string +}; + +type sendMsgMintParams = { + value: MsgMint, + fee?: StdFee, + memo?: string +}; + +type sendMsgChangeAdminParams = { + value: MsgChangeAdmin, + fee?: StdFee, + memo?: string +}; + +type sendMsgForceTransferParams = { + value: MsgForceTransfer, + fee?: StdFee, + memo?: string +}; + + +type msgSetDenomMetadataParams = { + value: MsgSetDenomMetadata, +}; + +type msgCreateDenomParams = { + value: MsgCreateDenom, +}; + +type msgBurnParams = { + value: MsgBurn, +}; + +type msgMintParams = { + value: MsgMint, +}; + +type msgChangeAdminParams = { + value: MsgChangeAdmin, +}; + +type msgForceTransferParams = { + value: MsgForceTransfer, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgSetDenomMetadata({ value, fee, memo }: sendMsgSetDenomMetadataParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgSetDenomMetadata: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgSetDenomMetadata({ value: MsgSetDenomMetadata.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgSetDenomMetadata: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCreateDenom({ value, fee, memo }: sendMsgCreateDenomParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreateDenom: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreateDenom({ value: MsgCreateDenom.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreateDenom: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgBurn({ value, fee, memo }: sendMsgBurnParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgBurn: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgBurn({ value: MsgBurn.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgBurn: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgMint({ value, fee, memo }: sendMsgMintParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgMint({ value: MsgMint.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgMint: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgChangeAdmin({ value, fee, memo }: sendMsgChangeAdminParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgChangeAdmin: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgChangeAdmin({ value: MsgChangeAdmin.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgChangeAdmin: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgForceTransfer({ value, fee, memo }: sendMsgForceTransferParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgForceTransfer: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgForceTransfer({ value: MsgForceTransfer.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgForceTransfer: Could not broadcast Tx: '+ e.message) + } + }, + + + msgSetDenomMetadata({ value }: msgSetDenomMetadataParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", value: MsgSetDenomMetadata.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgSetDenomMetadata: Could not create message: ' + e.message) + } + }, + + msgCreateDenom({ value }: msgCreateDenomParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", value: MsgCreateDenom.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreateDenom: Could not create message: ' + e.message) + } + }, + + msgBurn({ value }: msgBurnParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", value: MsgBurn.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgBurn: Could not create message: ' + e.message) + } + }, + + msgMint({ value }: msgMintParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", value: MsgMint.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgMint: Could not create message: ' + e.message) + } + }, + + msgChangeAdmin({ value }: msgChangeAdminParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", value: MsgChangeAdmin.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgChangeAdmin: Could not create message: ' + e.message) + } + }, + + msgForceTransfer({ value }: msgForceTransferParams): EncodeObject { + try { + return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", value: MsgForceTransfer.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgForceTransfer: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + DenomAuthorityMetadata: getStructure(typeDenomAuthorityMetadata.fromPartial({})), + GenesisDenom: getStructure(typeGenesisDenom.fromPartial({})), + Params: getStructure(typeParams.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + OsmosisTokenfactoryV1Beta1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/registry.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/registry.ts new file mode 100755 index 0000000000..d274e6129c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/registry.ts @@ -0,0 +1,20 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgSetDenomMetadata } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgCreateDenom } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgBurn } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgMint } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgChangeAdmin } from "./types/osmosis/tokenfactory/v1beta1/tx"; +import { MsgForceTransfer } from "./types/osmosis/tokenfactory/v1beta1/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], + ["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], + ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], + ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], + ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], + ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/rest.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/rest.ts index 2641ecd061..cd565aed90 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/rest.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/rest.ts @@ -16,7 +16,12 @@ export interface Osmosistokenfactoryv1Beta1Params { denom_creation_fee?: V1Beta1Coin[]; - /** @format uint64 */ + /** + * if denom_creation_fee is an empty array, then this field is used to add + * more gas consumption to the base cost. + * https://github.com/CosmWasm/token-factory/issues/11 + * @format uint64 + */ denom_creation_gas_consume?: string; } @@ -31,6 +36,16 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* DenomAuthorityMetadata specifies metadata for addresses that have specific +capabilities over a token factory denom. Right now there is only one Admin +permission, but is planned to be extended to the future. +*/ +export interface Tokenfactoryv1Beta1DenomAuthorityMetadata { + /** Can be empty for no admin, or a valid osmosis address */ + admin?: string; +} + /** * Coin defines a token with a denomination and an amount. @@ -42,15 +57,6 @@ export interface V1Beta1Coin { amount?: string; } -/** -* DenomAuthorityMetadata specifies metadata for addresses that have specific -capabilities over a token factory denom. Right now there is only one Admin -permission, but is planned to be extended to the future. -*/ -export interface V1Beta1DenomAuthorityMetadata { - admin?: string; -} - /** * DenomUnit represents a struct that describes a given denomination unit of the basic token. @@ -62,12 +68,14 @@ export interface V1Beta1DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). * @format int64 */ exponent?: number; + + /** aliases is a list of string aliases for the given denom */ aliases?: string[]; } @@ -77,6 +85,8 @@ a basic token. */ export interface V1Beta1Metadata { description?: string; + + /** denom_units represents the list of DenomUnit's for a given coin */ denom_units?: V1Beta1DenomUnit[]; /** base represents the base denom (should be the DenomUnit with exponent = 0). */ @@ -88,7 +98,10 @@ export interface V1Beta1Metadata { */ display?: string; - /** Since: cosmos-sdk 0.43 */ + /** + * name defines the name of the token (eg: Cosmos Atom) + * Since: cosmos-sdk 0.43 + */ name?: string; /** @@ -98,6 +111,21 @@ export interface V1Beta1Metadata { * Since: cosmos-sdk 0.43 */ symbol?: string; + + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; } export type V1Beta1MsgBurnResponse = object; @@ -122,6 +150,14 @@ MsgSetDenomMetadata message. */ export type V1Beta1MsgSetDenomMetadataResponse = object; +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1Beta1MsgUpdateParamsResponse = object; + /** * QueryDenomAuthorityMetadataResponse defines the response structure for the DenomAuthorityMetadata gRPC query. @@ -132,7 +168,7 @@ export interface V1Beta1QueryDenomAuthorityMetadataResponse { * capabilities over a token factory denom. Right now there is only one Admin * permission, but is planned to be extended to the future. */ - authority_metadata?: V1Beta1DenomAuthorityMetadata; + authority_metadata?: Tokenfactoryv1Beta1DenomAuthorityMetadata; } /** @@ -151,10 +187,11 @@ export interface V1Beta1QueryParamsResponse { params?: Osmosistokenfactoryv1Beta1Params; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -164,30 +201,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -195,149 +223,86 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types.ts new file mode 100755 index 0000000000..c13f543b8d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types.ts @@ -0,0 +1,12 @@ +//@ts-nocheck +import { DenomAuthorityMetadata } from "./types/osmosis/tokenfactory/v1beta1/authorityMetadata" +import { GenesisDenom } from "./types/osmosis/tokenfactory/v1beta1/genesis" +import { Params } from "./types/osmosis/tokenfactory/v1beta1/params" + + +export { + DenomAuthorityMetadata, + GenesisDenom, + Params, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/amino/amino.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/amino/amino.ts new file mode 100644 index 0000000000..ee57e724f1 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/amino/amino.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "amino"; diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/bank/v1beta1/bank.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/bank/v1beta1/bank.ts index f60bb6ec47..c6195bc484 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/bank/v1beta1/bank.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/bank/v1beta1/bank.ts @@ -1,14 +1,23 @@ //@ts-nocheck /* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../base/v1beta1/coin"; export const protobufPackage = "cosmos.bank.v1beta1"; /** Params defines the parameters for the bank module. */ export interface Params { - send_enabled: SendEnabled[]; - default_send_enabled: boolean; + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + * + * @deprecated + */ + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; } /** @@ -53,7 +62,7 @@ export interface DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -69,7 +78,7 @@ export interface DenomUnit { export interface Metadata { description: string; /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnit[]; + denomUnits: DenomUnit[]; /** base represents the base denom (should be the DenomUnit with exponent = 0). */ base: string; /** @@ -90,36 +99,48 @@ export interface Metadata { * Since: cosmos-sdk 0.43 */ symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; } -const baseParams: object = { default_send_enabled: false }; +function createBaseParams(): Params { + return { sendEnabled: [], defaultSendEnabled: false }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.send_enabled) { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.default_send_enabled === true) { - writer.uint32(16).bool(message.default_send_enabled); + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.send_enabled = []; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.send_enabled.push( - SendEnabled.decode(reader, reader.uint32()) - ); + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); break; case 2: - message.default_send_enabled = reader.bool(); + message.defaultSendEnabled = reader.bool(); break; default: reader.skipType(tag & 7); @@ -130,62 +151,39 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromJSON(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = Boolean(object.default_send_enabled); - } else { - message.default_send_enabled = false; - } - return message; + return { + sendEnabled: Array.isArray(object?.sendEnabled) + ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) + : [], + defaultSendEnabled: isSet(object.defaultSendEnabled) ? Boolean(object.defaultSendEnabled) : false, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - if (message.send_enabled) { - obj.send_enabled = message.send_enabled.map((e) => - e ? SendEnabled.toJSON(e) : undefined - ); + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => e ? SendEnabled.toJSON(e) : undefined); } else { - obj.send_enabled = []; + obj.sendEnabled = []; } - message.default_send_enabled !== undefined && - (obj.default_send_enabled = message.default_send_enabled); + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.send_enabled = []; - if (object.send_enabled !== undefined && object.send_enabled !== null) { - for (const e of object.send_enabled) { - message.send_enabled.push(SendEnabled.fromPartial(e)); - } - } - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.default_send_enabled = object.default_send_enabled; - } else { - message.default_send_enabled = false; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; + message.defaultSendEnabled = object.defaultSendEnabled ?? false; return message; }, }; -const baseSendEnabled: object = { denom: "", enabled: false }; +function createBaseSendEnabled(): SendEnabled { + return { denom: "", enabled: false }; +} export const SendEnabled = { - encode(message: SendEnabled, writer: Writer = Writer.create()): Writer { + encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -195,10 +193,10 @@ export const SendEnabled = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSendEnabled } as SendEnabled; + const message = createBaseSendEnabled(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -217,18 +215,10 @@ export const SendEnabled = { }, fromJSON(object: any): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = Boolean(object.enabled); - } else { - message.enabled = false; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, + }; }, toJSON(message: SendEnabled): unknown { @@ -238,26 +228,20 @@ export const SendEnabled = { return obj; }, - fromPartial(object: DeepPartial): SendEnabled { - const message = { ...baseSendEnabled } as SendEnabled; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = object.enabled; - } else { - message.enabled = false; - } + fromPartial, I>>(object: I): SendEnabled { + const message = createBaseSendEnabled(); + message.denom = object.denom ?? ""; + message.enabled = object.enabled ?? false; return message; }, }; -const baseInput: object = { address: "" }; +function createBaseInput(): Input { + return { address: "", coins: [] }; +} export const Input = { - encode(message: Input, writer: Writer = Writer.create()): Writer { + encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -267,11 +251,10 @@ export const Input = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Input { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Input { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseInput } as Input; - message.coins = []; + const message = createBaseInput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -290,53 +273,37 @@ export const Input = { }, fromJSON(object: any): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Input): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.coins = []; } return obj; }, - fromPartial(object: DeepPartial): Input { - const message = { ...baseInput } as Input; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Input { + const message = createBaseInput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseOutput: object = { address: "" }; +function createBaseOutput(): Output { + return { address: "", coins: [] }; +} export const Output = { - encode(message: Output, writer: Writer = Writer.create()): Writer { + encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -346,11 +313,10 @@ export const Output = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Output { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Output { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOutput } as Output; - message.coins = []; + const message = createBaseOutput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -369,64 +335,47 @@ export const Output = { }, fromJSON(object: any): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromJSON(e)); - } - } - return message; + return { + address: isSet(object.address) ? String(object.address) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + }; }, toJSON(message: Output): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); if (message.coins) { - obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.coins = message.coins.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.coins = []; } return obj; }, - fromPartial(object: DeepPartial): Output { - const message = { ...baseOutput } as Output; - message.coins = []; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.coins !== undefined && object.coins !== null) { - for (const e of object.coins) { - message.coins.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Output { + const message = createBaseOutput(); + message.address = object.address ?? ""; + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseSupply: object = {}; +function createBaseSupply(): Supply { + return { total: [] }; +} export const Supply = { - encode(message: Supply, writer: Writer = Writer.create()): Writer { + encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.total) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Supply { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSupply } as Supply; - message.total = []; + const message = createBaseSupply(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -442,42 +391,32 @@ export const Supply = { }, fromJSON(object: any): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromJSON(e)); - } - } - return message; + return { total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromJSON(e)) : [] }; }, toJSON(message: Supply): unknown { const obj: any = {}; if (message.total) { - obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); + obj.total = message.total.map((e) => e ? Coin.toJSON(e) : undefined); } else { obj.total = []; } return obj; }, - fromPartial(object: DeepPartial): Supply { - const message = { ...baseSupply } as Supply; - message.total = []; - if (object.total !== undefined && object.total !== null) { - for (const e of object.total) { - message.total.push(Coin.fromPartial(e)); - } - } + fromPartial, I>>(object: I): Supply { + const message = createBaseSupply(); + message.total = object.total?.map((e) => Coin.fromPartial(e)) || []; return message; }, }; -const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" }; +function createBaseDenomUnit(): DenomUnit { + return { denom: "", exponent: 0, aliases: [] }; +} export const DenomUnit = { - encode(message: DenomUnit, writer: Writer = Writer.create()): Writer { + encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -490,11 +429,10 @@ export const DenomUnit = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; + const message = createBaseDenomUnit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -516,30 +454,17 @@ export const DenomUnit = { }, fromJSON(object: any): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = Number(object.exponent); - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(String(e)); - } - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + exponent: isSet(object.exponent) ? Number(object.exponent) : 0, + aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => String(e)) : [], + }; }, toJSON(message: DenomUnit): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); - message.exponent !== undefined && (obj.exponent = message.exponent); + message.exponent !== undefined && (obj.exponent = Math.round(message.exponent)); if (message.aliases) { obj.aliases = message.aliases.map((e) => e); } else { @@ -548,42 +473,25 @@ export const DenomUnit = { return obj; }, - fromPartial(object: DeepPartial): DenomUnit { - const message = { ...baseDenomUnit } as DenomUnit; - message.aliases = []; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = object.exponent; - } else { - message.exponent = 0; - } - if (object.aliases !== undefined && object.aliases !== null) { - for (const e of object.aliases) { - message.aliases.push(e); - } - } + fromPartial, I>>(object: I): DenomUnit { + const message = createBaseDenomUnit(); + message.denom = object.denom ?? ""; + message.exponent = object.exponent ?? 0; + message.aliases = object.aliases?.map((e) => e) || []; return message; }, }; -const baseMetadata: object = { - description: "", - base: "", - display: "", - name: "", - symbol: "", -}; +function createBaseMetadata(): Metadata { + return { description: "", denomUnits: [], base: "", display: "", name: "", symbol: "", uri: "", uriHash: "" }; +} export const Metadata = { - encode(message: Metadata, writer: Writer = Writer.create()): Writer { + encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.description !== "") { writer.uint32(10).string(message.description); } - for (const v of message.denom_units) { + for (const v of message.denomUnits) { DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.base !== "") { @@ -598,14 +506,19 @@ export const Metadata = { if (message.symbol !== "") { writer.uint32(50).string(message.symbol); } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; + const message = createBaseMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -613,7 +526,7 @@ export const Metadata = { message.description = reader.string(); break; case 2: - message.denom_units.push(DenomUnit.decode(reader, reader.uint32())); + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); break; case 3: message.base = reader.string(); @@ -627,6 +540,12 @@ export const Metadata = { case 6: message.symbol = reader.string(); break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -636,103 +555,60 @@ export const Metadata = { }, fromJSON(object: any): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromJSON(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = String(object.base); - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = String(object.display); - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = String(object.symbol); - } else { - message.symbol = ""; - } - return message; + return { + description: isSet(object.description) ? String(object.description) : "", + denomUnits: Array.isArray(object?.denomUnits) ? object.denomUnits.map((e: any) => DenomUnit.fromJSON(e)) : [], + base: isSet(object.base) ? String(object.base) : "", + display: isSet(object.display) ? String(object.display) : "", + name: isSet(object.name) ? String(object.name) : "", + symbol: isSet(object.symbol) ? String(object.symbol) : "", + uri: isSet(object.uri) ? String(object.uri) : "", + uriHash: isSet(object.uriHash) ? String(object.uriHash) : "", + }; }, toJSON(message: Metadata): unknown { const obj: any = {}; - message.description !== undefined && - (obj.description = message.description); - if (message.denom_units) { - obj.denom_units = message.denom_units.map((e) => - e ? DenomUnit.toJSON(e) : undefined - ); + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map((e) => e ? DenomUnit.toJSON(e) : undefined); } else { - obj.denom_units = []; + obj.denomUnits = []; } message.base !== undefined && (obj.base = message.base); message.display !== undefined && (obj.display = message.display); message.name !== undefined && (obj.name = message.name); message.symbol !== undefined && (obj.symbol = message.symbol); + message.uri !== undefined && (obj.uri = message.uri); + message.uriHash !== undefined && (obj.uriHash = message.uriHash); return obj; }, - fromPartial(object: DeepPartial): Metadata { - const message = { ...baseMetadata } as Metadata; - message.denom_units = []; - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.denom_units !== undefined && object.denom_units !== null) { - for (const e of object.denom_units) { - message.denom_units.push(DenomUnit.fromPartial(e)); - } - } - if (object.base !== undefined && object.base !== null) { - message.base = object.base; - } else { - message.base = ""; - } - if (object.display !== undefined && object.display !== null) { - message.display = object.display; - } else { - message.display = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = object.symbol; - } else { - message.symbol = ""; - } + fromPartial, I>>(object: I): Metadata { + const message = createBaseMetadata(); + message.description = object.description ?? ""; + message.denomUnits = object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || []; + message.base = object.base ?? ""; + message.display = object.display ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 34ef35951f..0000000000 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,301 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/v1beta1/coin.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/v1beta1/coin.ts index f696140424..d11d12c100 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/v1beta1/coin.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -36,10 +36,12 @@ export interface DecProto { dec: string; } -const baseCoin: object = { denom: "", amount: "" }; +function createBaseCoin(): Coin { + return { denom: "", amount: "" }; +} export const Coin = { - encode(message: Coin, writer: Writer = Writer.create()): Writer { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -49,10 +51,10 @@ export const Coin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCoin } as Coin; + const message = createBaseCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -71,18 +73,10 @@ export const Coin = { }, fromJSON(object: any): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: Coin): unknown { @@ -92,26 +86,20 @@ export const Coin = { return obj; }, - fromPartial(object: DeepPartial): Coin { - const message = { ...baseCoin } as Coin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): Coin { + const message = createBaseCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseDecCoin: object = { denom: "", amount: "" }; +function createBaseDecCoin(): DecCoin { + return { denom: "", amount: "" }; +} export const DecCoin = { - encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -121,10 +109,10 @@ export const DecCoin = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecCoin } as DecCoin; + const message = createBaseDecCoin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -143,18 +131,10 @@ export const DecCoin = { }, fromJSON(object: any): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = String(object.amount); - } else { - message.amount = ""; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + }; }, toJSON(message: DecCoin): unknown { @@ -164,36 +144,30 @@ export const DecCoin = { return obj; }, - fromPartial(object: DeepPartial): DecCoin { - const message = { ...baseDecCoin } as DecCoin; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } else { - message.amount = ""; - } + fromPartial, I>>(object: I): DecCoin { + const message = createBaseDecCoin(); + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; return message; }, }; -const baseIntProto: object = { int: "" }; +function createBaseIntProto(): IntProto { + return { int: "" }; +} export const IntProto = { - encode(message: IntProto, writer: Writer = Writer.create()): Writer { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseIntProto } as IntProto; + const message = createBaseIntProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -209,13 +183,7 @@ export const IntProto = { }, fromJSON(object: any): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = String(object.int); - } else { - message.int = ""; - } - return message; + return { int: isSet(object.int) ? String(object.int) : "" }; }, toJSON(message: IntProto): unknown { @@ -224,31 +192,29 @@ export const IntProto = { return obj; }, - fromPartial(object: DeepPartial): IntProto { - const message = { ...baseIntProto } as IntProto; - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } else { - message.int = ""; - } + fromPartial, I>>(object: I): IntProto { + const message = createBaseIntProto(); + message.int = object.int ?? ""; return message; }, }; -const baseDecProto: object = { dec: "" }; +function createBaseDecProto(): DecProto { + return { dec: "" }; +} export const DecProto = { - encode(message: DecProto, writer: Writer = Writer.create()): Writer { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDecProto } as DecProto; + const message = createBaseDecProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,13 +230,7 @@ export const DecProto = { }, fromJSON(object: any): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = String(object.dec); - } else { - message.dec = ""; - } - return message; + return { dec: isSet(object.dec) ? String(object.dec) : "" }; }, toJSON(message: DecProto): unknown { @@ -279,24 +239,24 @@ export const DecProto = { return obj; }, - fromPartial(object: DeepPartial): DecProto { - const message = { ...baseDecProto } as DecProto; - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } else { - message.dec = ""; - } + fromPartial, I>>(object: I): DecProto { + const message = createBaseDecProto(); + message.dec = object.dec ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos_proto/cosmos.ts index b761cbd354..855969e891 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos_proto/cosmos.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/cosmos_proto/cosmos.ts @@ -1,3 +1,248 @@ //@ts-nocheck /* eslint-disable */ +import _m0 from "protobufjs/minimal"; + export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/api/http.ts index bc4b7f9f92..63d8278040 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/api/http.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/api/http.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -24,7 +24,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fullyDecodeReservedExpansion: boolean; } /** @@ -40,7 +40,6 @@ export interface Http { * 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}"; @@ -80,7 +79,6 @@ export interface Http { * 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}"; @@ -95,7 +93,6 @@ export interface Http { * SubMessage sub = 3; // `sub.subfield` becomes a parameter * } * - * * This enables a HTTP JSON to RPC mapping as below: * * HTTP | RPC @@ -111,7 +108,6 @@ export interface Http { * specifies the mapping. Consider a REST update method on the * message resource collection: * - * * service Messaging { * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { * option (google.api.http) = { @@ -125,7 +121,6 @@ export interface Http { * 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: @@ -152,7 +147,6 @@ export interface Http { * string text = 2; * } * - * * The following HTTP JSON to RPC mapping is enabled: * * HTTP | RPC @@ -183,7 +177,6 @@ export interface Http { * string user_id = 2; * } * - * * This enables the following two alternative HTTP JSON to RPC * mappings: * @@ -254,22 +247,34 @@ export interface HttpRule { */ selector: string; /** Used for listing and getting information about resources. */ - get: string | undefined; + get: + | string + | undefined; /** Used for updating a resource. */ - put: string | undefined; + put: + | string + | undefined; /** Used for creating a resource. */ - post: string | undefined; + post: + | string + | undefined; /** Used for deleting a resource. */ - delete: string | undefined; + delete: + | string + | undefined; /** Used for updating a resource. */ - patch: string | undefined; + 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; + 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 @@ -282,13 +287,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - response_body: string; + 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). */ - additional_bindings: HttpRule[]; + additionalBindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -299,24 +304,25 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fully_decode_reserved_expansion: false }; +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} export const Http = { - encode(message: Http, writer: Writer = Writer.create()): Writer { + 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.fully_decode_reserved_expansion === true) { - writer.uint32(16).bool(message.fully_decode_reserved_expansion); + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Http { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttp } as Http; - message.rules = []; + const message = createBaseHttp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -324,7 +330,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fully_decode_reserved_expansion = reader.bool(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -335,66 +341,51 @@ export const Http = { }, fromJSON(object: any): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromJSON(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = Boolean( - object.fully_decode_reserved_expansion - ); - } else { - message.fully_decode_reserved_expansion = false; - } - return message; + 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 - ); + obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { obj.rules = []; } - message.fully_decode_reserved_expansion !== undefined && - (obj.fully_decode_reserved_expansion = - message.fully_decode_reserved_expansion); + message.fullyDecodeReservedExpansion !== undefined + && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial(object: DeepPartial): Http { - const message = { ...baseHttp } as Http; - message.rules = []; - if (object.rules !== undefined && object.rules !== null) { - for (const e of object.rules) { - message.rules.push(HttpRule.fromPartial(e)); - } - } - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fully_decode_reserved_expansion = - object.fully_decode_reserved_expansion; - } else { - message.fully_decode_reserved_expansion = false; - } + fromPartial, I>>(object: I): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; return message; }, }; -const baseHttpRule: object = { selector: "", body: "", response_body: "" }; +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: Writer = Writer.create()): Writer { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -414,28 +405,24 @@ export const HttpRule = { writer.uint32(50).string(message.patch); } if (message.custom !== undefined) { - CustomHttpPattern.encode( - message.custom, - writer.uint32(66).fork() - ).ldelim(); + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); } if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.response_body !== "") { - writer.uint32(98).string(message.response_body); + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); } - for (const v of message.additional_bindings) { + for (const v of message.additionalBindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; + const message = createBaseHttpRule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -464,12 +451,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.response_body = reader.string(); + message.responseBody = reader.string(); break; case 11: - message.additional_bindings.push( - HttpRule.decode(reader, reader.uint32()) - ); + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -480,62 +465,20 @@ export const HttpRule = { }, fromJSON(object: any): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = String(object.selector); - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = String(object.get); - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = String(object.put); - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = String(object.post); - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = String(object.delete); - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = String(object.patch); - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromJSON(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = String(object.body); - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = String(object.response_body); - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromJSON(e)); - } - } - return message; + 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 { @@ -546,87 +489,42 @@ export const HttpRule = { 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.custom !== undefined + && (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.response_body !== undefined && - (obj.response_body = message.response_body); - if (message.additional_bindings) { - obj.additional_bindings = message.additional_bindings.map((e) => - e ? HttpRule.toJSON(e) : undefined - ); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined); } else { - obj.additional_bindings = []; + obj.additionalBindings = []; } return obj; }, - fromPartial(object: DeepPartial): HttpRule { - const message = { ...baseHttpRule } as HttpRule; - message.additional_bindings = []; - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } else { - message.selector = ""; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } else { - message.get = undefined; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } else { - message.put = undefined; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } else { - message.post = undefined; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } else { - message.delete = undefined; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } else { - message.patch = undefined; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromPartial(object.custom); - } else { - message.custom = undefined; - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } else { - message.body = ""; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.response_body = object.response_body; - } else { - message.response_body = ""; - } - if ( - object.additional_bindings !== undefined && - object.additional_bindings !== null - ) { - for (const e of object.additional_bindings) { - message.additional_bindings.push(HttpRule.fromPartial(e)); - } - } + 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; }, }; -const baseCustomHttpPattern: object = { kind: "", path: "" }; +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -636,10 +534,10 @@ export const CustomHttpPattern = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseCustomHttpPattern } as CustomHttpPattern; + const message = createBaseCustomHttpPattern(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -658,18 +556,7 @@ export const CustomHttpPattern = { }, fromJSON(object: any): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = String(object.kind); - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = String(object.path); - } else { - message.path = ""; - } - return message; + return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" }; }, toJSON(message: CustomHttpPattern): unknown { @@ -679,29 +566,25 @@ export const CustomHttpPattern = { return obj; }, - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = { ...baseCustomHttpPattern } as CustomHttpPattern; - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } else { - message.kind = ""; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } else { - message.path = ""; - } + 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 | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/protobuf/descriptor.ts index 641b324ff5..93db6f82d2 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/protobuf/descriptor.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -22,25 +22,29 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - public_dependency: number[]; + publicDependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weakDependency: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions | undefined; + options: + | FileOptions + | undefined; /** * 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. */ - source_code_info: SourceCodeInfo | undefined; + sourceCodeInfo: + | SourceCodeInfo + | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -53,17 +57,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; + 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. */ - reserved_name: string[]; + reservedName: string[]; } export interface DescriptorProto_ExtensionRange { @@ -88,7 +92,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -108,7 +112,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + typeName: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -121,20 +125,22 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + 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. */ - oneof_index: number; + 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. */ - json_name: string; - options: FieldOptions | undefined; + jsonName: string; + options: + | FieldOptions + | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it * tracks presence regardless of field type. @@ -158,7 +164,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3_optional: boolean; + proto3Optional: boolean; } export enum FieldDescriptorProto_Type { @@ -205,9 +211,7 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { switch (object) { case 1: case "TYPE_DOUBLE": @@ -270,9 +274,7 @@ export function fieldDescriptorProto_TypeFromJSON( } } -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; @@ -310,8 +312,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -323,9 +326,7 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { switch (object) { case 1: case "LABEL_OPTIONAL": @@ -343,9 +344,7 @@ export function fieldDescriptorProto_LabelFromJSON( } } -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; @@ -353,8 +352,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -368,18 +368,20 @@ export interface OneofDescriptorProto { export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; + options: + | EnumOptions + | undefined; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; + reservedRange: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reservedName: string[]; } /** @@ -418,13 +420,15 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; + inputType: string; + outputType: string; + options: + | MethodOptions + | undefined; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + clientStreaming: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + serverStreaming: boolean; } export interface FileOptions { @@ -434,7 +438,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + 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 @@ -442,7 +446,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - java_outer_classname: string; + 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 @@ -451,13 +455,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + javaMultipleFiles: boolean; /** * This option does nothing. * * @deprecated */ - java_generate_equals_and_hash: boolean; + 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 @@ -466,8 +470,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + 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: @@ -475,7 +479,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + 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 @@ -488,10 +492,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -503,49 +507,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - cc_enable_arenas: boolean; + ccEnableArenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objcClassPrefix: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + 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. */ - swift_prefix: string; + swiftPrefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + 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. */ - php_namespace: string; + 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. */ - php_metadata_namespace: string; + 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. */ - ruby_package: string; + rubyPackage: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -559,9 +563,7 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { switch (object) { case 1: case "SPEED": @@ -579,9 +581,7 @@ export function fileOptions_OptimizeModeFromJSON( } } -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; @@ -589,8 +589,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -615,13 +616,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + 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". */ - no_standard_descriptor_accessor: boolean; + noStandardDescriptorAccessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -652,9 +653,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface FieldOptions { @@ -705,7 +706,6 @@ export interface FieldOptions { * 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. @@ -728,7 +728,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -765,8 +765,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -806,14 +807,15 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumOptions { @@ -821,7 +823,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allowAlias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -830,7 +832,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptions { @@ -842,7 +844,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptions { @@ -854,7 +856,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } export interface MethodOptions { @@ -865,9 +867,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + idempotencyLevel: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; + uninterpretedOption: UninterpretedOption[]; } /** @@ -884,9 +886,7 @@ export enum MethodOptions_IdempotencyLevel { UNRECOGNIZED = -1, } -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": @@ -904,9 +904,7 @@ export function methodOptions_IdempotencyLevelFromJSON( } } -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; @@ -914,8 +912,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -933,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; } /** @@ -949,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: boolean; + namePart: string; + isExtension: boolean; } /** @@ -1090,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } /** @@ -1115,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - source_file: string; + sourceFile: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1129,28 +1128,27 @@ export interface GeneratedCodeInfo_Annotation { end: number; } -const baseFileDescriptorSet: object = {}; +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; + const message = createBaseFileDescriptorSet(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1161,54 +1159,45 @@ export const FileDescriptorSet = { }, fromJSON(object: any): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; + 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 - ); + obj.file = message.file.map((e) => e ? FileDescriptorProto.toJSON(e) : undefined); } else { obj.file = []; } return obj; }, - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } + fromPartial, I>>(object: I): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; }, }; -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1219,19 +1208,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.public_dependency) { + for (const v of message.publicDependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weak_dependency) { + for (const v of message.weakDependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.message_type) { + for (const v of message.messageType) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1243,11 +1232,8 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); } if (message.syntax !== "") { writer.uint32(98).string(message.syntax); @@ -1255,17 +1241,10 @@ export const FileDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; + const message = createBaseFileDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1282,50 +1261,39 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } } else { - message.public_dependency.push(reader.int32()); + message.publicDependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } } else { - message.weak_dependency.push(reader.int32()); + message.weakDependency.push(reader.int32()); } break; case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.source_code_info = SourceCodeInfo.decode( - reader, - reader.uint32() - ); + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); @@ -1339,86 +1307,26 @@ export const FileDescriptorProto = { }, fromJSON(object: any): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; + 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 { @@ -1430,144 +1338,82 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } else { - obj.public_dependency = []; + obj.publicDependency = []; } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } else { - obj.weak_dependency = []; + obj.weakDependency = []; } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.messageType) { + obj.messageType = message.messageType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.message_type = []; + obj.messageType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); + 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 - ); + 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); + 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(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } + 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; }, }; -const baseDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1577,48 +1423,34 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nested_type) { + for (const v of message.nestedType) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enum_type) { + for (const v of message.enumType) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); } - for (const v of message.oneof_decl) { + 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(82).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1626,45 +1458,31 @@ export const DescriptorProto = { message.name = reader.string(); break; case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: - message.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); break; case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); break; case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); break; case 10: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1675,215 +1493,102 @@ export const DescriptorProto = { }, fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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 - ); + obj.extension = message.extension.map((e) => e ? FieldDescriptorProto.toJSON(e) : undefined); } else { obj.extension = []; } - if (message.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => e ? DescriptorProto.toJSON(e) : undefined); } else { - obj.nested_type = []; + obj.nestedType = []; } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); + if (message.enumType) { + obj.enumType = message.enumType.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined); } else { - obj.enum_type = []; + obj.enumType = []; } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); } else { - obj.extension_range = []; + obj.extensionRange = []; } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined); } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1891,23 +1596,15 @@ export const DescriptorProto_ExtensionRange = { writer.uint32(16).int32(message.end); } if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; + const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1918,10 +1615,7 @@ export const DescriptorProto_ExtensionRange = { message.end = reader.int32(); break; case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1932,70 +1626,41 @@ export const DescriptorProto_ExtensionRange = { }, fromJSON(object: any): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); + 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( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2005,15 +1670,10 @@ export const DescriptorProto_ReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; + const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2032,74 +1692,47 @@ export const DescriptorProto_ReservedRange = { }, fromJSON(object: any): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseExtensionRangeOptions: object = {}; +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; + const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2110,66 +1743,48 @@ export const ExtensionRangeOptions = { }, fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; +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: Writer = Writer.create() - ): Writer { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2182,34 +1797,34 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.type_name !== "") { - writer.uint32(50).string(message.type_name); + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2226,25 +1841,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.type_name = reader.string(); + message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.default_value = reader.string(); + message.defaultValue = reader.string(); break; case 9: - message.oneof_index = reader.int32(); + message.oneofIndex = reader.int32(); break; case 10: - message.json_name = reader.string(); + message.jsonName = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3_optional = reader.bool(); + message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2255,163 +1870,62 @@ export const FieldDescriptorProto = { }, fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; + 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 = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_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.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); + 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(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } + 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; }, }; -const baseOneofDescriptorProto: object = { name: "" }; +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2421,10 +1935,10 @@ export const OneofDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2443,53 +1957,35 @@ export const OneofDescriptorProto = { }, fromJSON(object: any): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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); + message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2499,25 +1995,19 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.reserved_name) { + for (const v of message.reservedName) { writer.uint32(42).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; + const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2525,23 +2015,16 @@ export const EnumDescriptorProto = { message.name = reader.string(); break; case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); break; case 5: - message.reserved_name.push(reader.string()); + message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2552,112 +2035,61 @@ export const EnumDescriptorProto = { }, fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; + 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 - ); + 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => + 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.reserved_range = []; + obj.reservedRange = []; } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); } else { - obj.reserved_name = []; + obj.reservedName = []; } return obj; }, - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } + 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; }, }; -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -2667,15 +2099,10 @@ export const EnumDescriptorProto_EnumReservedRange = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2694,56 +2121,32 @@ export const EnumDescriptorProto_EnumReservedRange = { }, fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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 = message.start); - message.end !== undefined && (obj.end = message.end); + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; return message; }, }; -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2751,23 +2154,15 @@ export const EnumValueDescriptorProto = { writer.uint32(16).int32(message.number); } if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; + const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2789,70 +2184,39 @@ export const EnumValueDescriptorProto = { }, fromJSON(object: any): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined + && (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseServiceDescriptorProto: object = { name: "" }; +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2865,11 +2229,10 @@ export const ServiceDescriptorProto = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; + const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2877,9 +2240,7 @@ export const ServiceDescriptorProto = { message.name = reader.string(); break; case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = ServiceOptions.decode(reader, reader.uint32()); @@ -2893,105 +2254,75 @@ export const ServiceDescriptorProto = { }, fromJSON(object: any): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; + 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 - ); + 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); + message.options !== undefined + && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } + 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; }, }; -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2999,19 +2330,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.input_type = reader.string(); + message.inputType = reader.string(); break; case 3: - message.output_type = reader.string(); + message.outputType = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.client_streaming = reader.bool(); + message.clientStreaming = reader.bool(); break; case 6: - message.server_streaming = reader.bool(); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3022,270 +2353,205 @@ export const MethodDescriptorProto = { }, fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; + 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.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); + 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( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } + 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; }, }; -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; +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: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; + const message = createBaseFileOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.java_package = reader.string(); + message.javaPackage = reader.string(); break; case 8: - message.java_outer_classname = reader.string(); + message.javaOuterClassname = reader.string(); break; case 10: - message.java_multiple_files = reader.bool(); + message.javaMultipleFiles = reader.bool(); break; case 20: - message.java_generate_equals_and_hash = reader.bool(); + message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: - message.java_string_check_utf8 = reader.bool(); + message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimize_for = reader.int32() as any; + message.optimizeFor = reader.int32() as any; break; case 11: - message.go_package = reader.string(); + message.goPackage = reader.string(); break; case 16: - message.cc_generic_services = reader.bool(); + message.ccGenericServices = reader.bool(); break; case 17: - message.java_generic_services = reader.bool(); + message.javaGenericServices = reader.bool(); break; case 18: - message.py_generic_services = reader.bool(); + message.pyGenericServices = reader.bool(); break; case 42: - message.php_generic_services = reader.bool(); + message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.cc_enable_arenas = reader.bool(); + message.ccEnableArenas = reader.bool(); break; case 36: - message.objc_class_prefix = reader.string(); + message.objcClassPrefix = reader.string(); break; case 37: - message.csharp_namespace = reader.string(); + message.csharpNamespace = reader.string(); break; case 39: - message.swift_prefix = reader.string(); + message.swiftPrefix = reader.string(); break; case 40: - message.php_class_prefix = reader.string(); + message.phpClassPrefix = reader.string(); break; case 41: - message.php_namespace = reader.string(); + message.phpNamespace = reader.string(); break; case 44: - message.php_metadata_namespace = reader.string(); + message.phpMetadataNamespace = reader.string(); break; case 45: - message.ruby_package = reader.string(); + message.rubyPackage = reader.string(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3296,419 +2562,144 @@ export const FileOptions = { }, fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); + 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.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; + 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(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; + const message = createBaseMessageOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message_set_wire_format = reader.bool(); + message.messageSetWireFormat = reader.bool(); break; case 2: - message.no_standard_descriptor_accessor = reader.bool(); + message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.map_entry = reader.bool(); + message.mapEntry = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3719,119 +2710,51 @@ export const MessageOptions = { }, fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined + && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; +function createBaseFieldOptions(): FieldOptions { + return { ctype: 0, packed: false, jstype: 0, lazy: false, deprecated: false, weak: false, uninterpretedOption: [] }; +} export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ctype !== 0) { writer.uint32(8).int32(message.ctype); } @@ -3850,17 +2773,16 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; + const message = createBaseFieldOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3883,9 +2805,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -3896,136 +2816,69 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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, + 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.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.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseOneofOptions: object = {}; +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { + 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: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; + const message = createBaseOneofOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4036,80 +2889,63 @@ export const OneofOptions = { }, fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; }, toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; + const message = createBaseEnumOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allow_alias = reader.bool(); + message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4120,87 +2956,55 @@ export const EnumOptions = { }, fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseEnumValueOptions: object = { deprecated: false }; +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; + const message = createBaseEnumValueOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4208,9 +3012,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4221,75 +3023,52 @@ export const EnumValueOptions = { }, fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseServiceOptions: object = { deprecated: false }; +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + 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.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; + const message = createBaseServiceOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4297,9 +3076,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4310,78 +3087,55 @@ export const ServiceOptions = { }, fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + fromPartial, I>>(object: I): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); } - for (const v of message.uninterpreted_option) { + for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; + const message = createBaseMethodOptions(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4389,12 +3143,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotency_level = reader.int32() as any; + message.idempotencyLevel = reader.int32() as any; break; case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4405,149 +3157,104 @@ export const MethodOptions = { }, fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; + 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.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); + 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.uninterpreted_option = []; + obj.uninterpretedOption = []; } return obj; }, - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } + 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; }, }; -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { + 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(); + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; + 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()) - ); + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); break; case 3: - message.identifier_value = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); + message.positiveIntValue = longToNumber(reader.uint64() as Long); break; case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); + message.negativeIntValue = longToNumber(reader.int64() as Long); break; case 6: - message.double_value = reader.double(); + message.doubleValue = reader.double(); break; case 7: - message.string_value = reader.bytes(); + message.stringValue = reader.bytes(); break; case 8: - message.aggregate_value = reader.string(); + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -4558,174 +3265,76 @@ export const UninterpretedOption = { }, fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; + 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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 - ); + obj.name = message.name.map((e) => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); } else { obj.name = []; } - message.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined + && (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; return message; }, }; -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; + const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name_part = reader.string(); + message.namePart = reader.string(); break; case 2: - message.is_extension = reader.bool(); + message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4736,72 +3345,48 @@ export const UninterpretedOption_NamePart = { }, fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; + 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.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } + fromPartial, I>>(object: I): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; return message; }, }; -const baseSourceCodeInfo: object = {}; +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + 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: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; + 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()) - ); + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4812,53 +3397,36 @@ export const SourceCodeInfo = { }, fromJSON(object: any): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; + 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 - ); + obj.location = message.location.map((e) => e ? SourceCodeInfo_Location.toJSON(e) : undefined); } else { obj.location = []; } return obj; }, - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } + fromPartial, I>>(object: I): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, }; -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): Writer { + 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); @@ -4869,27 +3437,22 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); } - for (const v of message.leading_detached_comments) { + for (const v of message.leadingDetachedComments) { writer.uint32(50).string(v!); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; + const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4914,13 +3477,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leading_comments = reader.string(); + message.leadingComments = reader.string(); break; case 4: - message.trailing_comments = reader.string(); + message.trailingComments = reader.string(); break; case 6: - message.leading_detached_comments.push(reader.string()); + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4931,147 +3494,71 @@ export const SourceCodeInfo_Location = { }, fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } if (message.span) { - obj.span = message.span.map((e) => e); + obj.span = message.span.map((e) => Math.round(e)); } else { obj.span = []; } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); + 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.leading_detached_comments = []; + obj.leadingDetachedComments = []; } return obj; }, - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } + 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; }, }; -const baseGeneratedCodeInfo: object = {}; +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + 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(); + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; + 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()) - ); + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5082,59 +3569,43 @@ export const GeneratedCodeInfo = { }, fromJSON(object: any): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; + 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 - ); + obj.annotation = message.annotation.map((e) => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); } else { obj.annotation = []; } return obj; }, - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, }; -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { + 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.source_file !== "") { - writer.uint32(18).string(message.source_file); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5145,16 +3616,10 @@ export const GeneratedCodeInfo_Annotation = { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + 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 = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; + const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5169,7 +3634,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.source_file = reader.string(); + message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5186,122 +3651,92 @@ export const GeneratedCodeInfo_Annotation = { }, fromJSON(object: any): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; + 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) => e); + obj.path = message.path.map((e) => Math.round(e)); } else { obj.path = []; } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); + 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( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } + 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; + 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"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + 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; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); + 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("")); } - return btoa(bin.join("")); } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -5309,7 +3744,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/authorityMetadata.ts index 85aff8ab65..6185d72ea3 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/authorityMetadata.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -1,6 +1,6 @@ //@ts-nocheck /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "osmosis.tokenfactory.v1beta1"; @@ -14,23 +14,22 @@ export interface DenomAuthorityMetadata { admin: string; } -const baseDenomAuthorityMetadata: object = { admin: "" }; +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { admin: "" }; +} export const DenomAuthorityMetadata = { - encode( - message: DenomAuthorityMetadata, - writer: Writer = Writer.create() - ): Writer { + encode(message: DenomAuthorityMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.admin !== "") { writer.uint32(10).string(message.admin); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): DenomAuthorityMetadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): DenomAuthorityMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDenomAuthorityMetadata } as DenomAuthorityMetadata; + const message = createBaseDenomAuthorityMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -46,13 +45,7 @@ export const DenomAuthorityMetadata = { }, fromJSON(object: any): DenomAuthorityMetadata { - const message = { ...baseDenomAuthorityMetadata } as DenomAuthorityMetadata; - if (object.admin !== undefined && object.admin !== null) { - message.admin = String(object.admin); - } else { - message.admin = ""; - } - return message; + return { admin: isSet(object.admin) ? String(object.admin) : "" }; }, toJSON(message: DenomAuthorityMetadata): unknown { @@ -61,26 +54,24 @@ export const DenomAuthorityMetadata = { return obj; }, - fromPartial( - object: DeepPartial - ): DenomAuthorityMetadata { - const message = { ...baseDenomAuthorityMetadata } as DenomAuthorityMetadata; - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } else { - message.admin = ""; - } + fromPartial, I>>(object: I): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + message.admin = object.admin ?? ""; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/genesis.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/genesis.ts index 43729c96ff..8cecb955f3 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/genesis.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/genesis.ts @@ -1,8 +1,8 @@ //@ts-nocheck /* eslint-disable */ -import { Params } from "../../../osmosis/tokenfactory/v1beta1/params"; -import { DenomAuthorityMetadata } from "../../../osmosis/tokenfactory/v1beta1/authorityMetadata"; -import { Writer, Reader } from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; +import { DenomAuthorityMetadata } from "./authorityMetadata"; +import { Params } from "./params"; export const protobufPackage = "osmosis.tokenfactory.v1beta1"; @@ -10,7 +10,7 @@ export const protobufPackage = "osmosis.tokenfactory.v1beta1"; export interface GenesisState { /** params defines the paramaters of the module. */ params: Params | undefined; - factory_denoms: GenesisDenom[]; + factoryDenoms: GenesisDenom[]; } /** @@ -20,27 +20,28 @@ export interface GenesisState { */ export interface GenesisDenom { denom: string; - authority_metadata: DenomAuthorityMetadata | undefined; + authorityMetadata: DenomAuthorityMetadata | undefined; } -const baseGenesisState: object = {}; +function createBaseGenesisState(): GenesisState { + return { params: undefined, factoryDenoms: [] }; +} export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.factory_denoms) { + for (const v of message.factoryDenoms) { GenesisDenom.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.factory_denoms = []; + const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -48,9 +49,7 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.factory_denoms.push( - GenesisDenom.decode(reader, reader.uint32()) - ); + message.factoryDenoms.push(GenesisDenom.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -61,72 +60,54 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.factory_denoms = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - if (object.factory_denoms !== undefined && object.factory_denoms !== null) { - for (const e of object.factory_denoms) { - message.factory_denoms.push(GenesisDenom.fromJSON(e)); - } - } - return message; + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + factoryDenoms: Array.isArray(object?.factoryDenoms) + ? object.factoryDenoms.map((e: any) => GenesisDenom.fromJSON(e)) + : [], + }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.factory_denoms) { - obj.factory_denoms = message.factory_denoms.map((e) => - e ? GenesisDenom.toJSON(e) : undefined - ); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.factoryDenoms) { + obj.factoryDenoms = message.factoryDenoms.map((e) => e ? GenesisDenom.toJSON(e) : undefined); } else { - obj.factory_denoms = []; + obj.factoryDenoms = []; } return obj; }, - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.factory_denoms = []; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } - if (object.factory_denoms !== undefined && object.factory_denoms !== null) { - for (const e of object.factory_denoms) { - message.factory_denoms.push(GenesisDenom.fromPartial(e)); - } - } + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.factoryDenoms = object.factoryDenoms?.map((e) => GenesisDenom.fromPartial(e)) || []; return message; }, }; -const baseGenesisDenom: object = { denom: "" }; +function createBaseGenesisDenom(): GenesisDenom { + return { denom: "", authorityMetadata: undefined }; +} export const GenesisDenom = { - encode(message: GenesisDenom, writer: Writer = Writer.create()): Writer { + encode(message: GenesisDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } - if (message.authority_metadata !== undefined) { - DenomAuthorityMetadata.encode( - message.authority_metadata, - writer.uint32(18).fork() - ).ldelim(); + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): GenesisDenom { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisDenom { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisDenom } as GenesisDenom; + const message = createBaseGenesisDenom(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -134,10 +115,7 @@ export const GenesisDenom = { message.denom = reader.string(); break; case 2: - message.authority_metadata = DenomAuthorityMetadata.decode( - reader, - reader.uint32() - ); + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -148,63 +126,44 @@ export const GenesisDenom = { }, fromJSON(object: any): GenesisDenom { - const message = { ...baseGenesisDenom } as GenesisDenom; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if ( - object.authority_metadata !== undefined && - object.authority_metadata !== null - ) { - message.authority_metadata = DenomAuthorityMetadata.fromJSON( - object.authority_metadata - ); - } else { - message.authority_metadata = undefined; - } - return message; + return { + denom: isSet(object.denom) ? String(object.denom) : "", + authorityMetadata: isSet(object.authorityMetadata) + ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) + : undefined, + }; }, toJSON(message: GenesisDenom): unknown { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); - message.authority_metadata !== undefined && - (obj.authority_metadata = message.authority_metadata - ? DenomAuthorityMetadata.toJSON(message.authority_metadata) - : undefined); + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata + ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) + : undefined); return obj; }, - fromPartial(object: DeepPartial): GenesisDenom { - const message = { ...baseGenesisDenom } as GenesisDenom; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if ( - object.authority_metadata !== undefined && - object.authority_metadata !== null - ) { - message.authority_metadata = DenomAuthorityMetadata.fromPartial( - object.authority_metadata - ); - } else { - message.authority_metadata = undefined; - } + fromPartial, I>>(object: I): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = (object.authorityMetadata !== undefined && object.authorityMetadata !== null) + ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) + : undefined; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/params.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/params.ts index 159ec25a72..2192bd3c83 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/params.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/params.ts @@ -1,50 +1,49 @@ //@ts-nocheck /* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; export const protobufPackage = "osmosis.tokenfactory.v1beta1"; /** Params defines the parameters for the tokenfactory module. */ export interface Params { - denom_creation_fee: Coin[]; + denomCreationFee: Coin[]; /** - * if denom_creation_fee is an empty array, then this field is used to add more gas consumption - * to the base cost. + * if denom_creation_fee is an empty array, then this field is used to add + * more gas consumption to the base cost. * https://github.com/CosmWasm/token-factory/issues/11 */ - denom_creation_gas_consume: number; + denomCreationGasConsume: number; } -const baseParams: object = { denom_creation_gas_consume: 0 }; +function createBaseParams(): Params { + return { denomCreationFee: [], denomCreationGasConsume: 0 }; +} export const Params = { - encode(message: Params, writer: Writer = Writer.create()): Writer { - for (const v of message.denom_creation_fee) { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denomCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.denom_creation_gas_consume !== 0) { - writer.uint32(16).uint64(message.denom_creation_gas_consume); + if (message.denomCreationGasConsume !== 0) { + writer.uint32(16).uint64(message.denomCreationGasConsume); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): Params { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseParams } as Params; - message.denom_creation_fee = []; + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.denom_creation_fee.push(Coin.decode(reader, reader.uint32())); + message.denomCreationFee.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.denom_creation_gas_consume = longToNumber( - reader.uint64() as Long - ); + message.denomCreationGasConsume = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -55,87 +54,64 @@ export const Params = { }, fromJSON(object: any): Params { - const message = { ...baseParams } as Params; - message.denom_creation_fee = []; - if ( - object.denom_creation_fee !== undefined && - object.denom_creation_fee !== null - ) { - for (const e of object.denom_creation_fee) { - message.denom_creation_fee.push(Coin.fromJSON(e)); - } - } - if ( - object.denom_creation_gas_consume !== undefined && - object.denom_creation_gas_consume !== null - ) { - message.denom_creation_gas_consume = Number( - object.denom_creation_gas_consume - ); - } else { - message.denom_creation_gas_consume = 0; - } - return message; + return { + denomCreationFee: Array.isArray(object?.denomCreationFee) + ? object.denomCreationFee.map((e: any) => Coin.fromJSON(e)) + : [], + denomCreationGasConsume: isSet(object.denomCreationGasConsume) ? Number(object.denomCreationGasConsume) : 0, + }; }, toJSON(message: Params): unknown { const obj: any = {}; - if (message.denom_creation_fee) { - obj.denom_creation_fee = message.denom_creation_fee.map((e) => - e ? Coin.toJSON(e) : undefined - ); + if (message.denomCreationFee) { + obj.denomCreationFee = message.denomCreationFee.map((e) => e ? Coin.toJSON(e) : undefined); } else { - obj.denom_creation_fee = []; + obj.denomCreationFee = []; } - message.denom_creation_gas_consume !== undefined && - (obj.denom_creation_gas_consume = message.denom_creation_gas_consume); + message.denomCreationGasConsume !== undefined + && (obj.denomCreationGasConsume = Math.round(message.denomCreationGasConsume)); return obj; }, - fromPartial(object: DeepPartial): Params { - const message = { ...baseParams } as Params; - message.denom_creation_fee = []; - if ( - object.denom_creation_fee !== undefined && - object.denom_creation_fee !== null - ) { - for (const e of object.denom_creation_fee) { - message.denom_creation_fee.push(Coin.fromPartial(e)); - } - } - if ( - object.denom_creation_gas_consume !== undefined && - object.denom_creation_gas_consume !== null - ) { - message.denom_creation_gas_consume = object.denom_creation_gas_consume; - } else { - message.denom_creation_gas_consume = 0; - } + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee?.map((e) => Coin.fromPartial(e)) || []; + message.denomCreationGasConsume = object.denomCreationGasConsume ?? 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; + 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"; })(); -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); @@ -143,7 +119,11 @@ function longToNumber(long: Long): number { return long.toNumber(); } -if (util.Long !== Long) { - util.Long = Long as any; - configure(); +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/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/query.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/query.ts index 08f617b2c0..017d7f4915 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/query.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/query.ts @@ -1,13 +1,14 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Params } from "../../../osmosis/tokenfactory/v1beta1/params"; -import { DenomAuthorityMetadata } from "../../../osmosis/tokenfactory/v1beta1/authorityMetadata"; +import _m0 from "protobufjs/minimal"; +import { DenomAuthorityMetadata } from "./authorityMetadata"; +import { Params } from "./params"; export const protobufPackage = "osmosis.tokenfactory.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} +export interface QueryParamsRequest { +} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -28,7 +29,7 @@ export interface QueryDenomAuthorityMetadataRequest { * DenomAuthorityMetadata gRPC query. */ export interface QueryDenomAuthorityMetadataResponse { - authority_metadata: DenomAuthorityMetadata | undefined; + authorityMetadata: DenomAuthorityMetadata | undefined; } /** @@ -47,17 +48,19 @@ export interface QueryDenomsFromCreatorResponse { denoms: string[]; } -const baseQueryParamsRequest: object = {}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + const message = createBaseQueryParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -70,8 +73,7 @@ export const QueryParamsRequest = { }, fromJSON(_: any): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; - return message; + return {}; }, toJSON(_: QueryParamsRequest): unknown { @@ -79,29 +81,28 @@ export const QueryParamsRequest = { return obj; }, - fromPartial(_: DeepPartial): QueryParamsRequest { - const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); return message; }, }; -const baseQueryParamsResponse: object = {}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} export const QueryParamsResponse = { - encode( - message: QueryParamsResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + const message = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -117,55 +118,40 @@ export const QueryParamsResponse = { }, fromJSON(object: any): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromJSON(object.params); - } else { - message.params = undefined; - } - return message; + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, toJSON(message: QueryParamsResponse): unknown { const obj: any = {}; - message.params !== undefined && - (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryParamsResponse { - const message = { ...baseQueryParamsResponse } as QueryParamsResponse; - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } else { - message.params = undefined; - } + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; return message; }, }; -const baseQueryDenomAuthorityMetadataRequest: object = { denom: "" }; +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { denom: "" }; +} export const QueryDenomAuthorityMetadataRequest = { - encode( - message: QueryDenomAuthorityMetadataRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomAuthorityMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomAuthorityMetadataRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomAuthorityMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomAuthorityMetadataRequest, - } as QueryDenomAuthorityMetadataRequest; + const message = createBaseQueryDenomAuthorityMetadataRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -181,15 +167,7 @@ export const QueryDenomAuthorityMetadataRequest = { }, fromJSON(object: any): QueryDenomAuthorityMetadataRequest { - const message = { - ...baseQueryDenomAuthorityMetadataRequest, - } as QueryDenomAuthorityMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - return message; + return { denom: isSet(object.denom) ? String(object.denom) : "" }; }, toJSON(message: QueryDenomAuthorityMetadataRequest): unknown { @@ -198,54 +176,36 @@ export const QueryDenomAuthorityMetadataRequest = { return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDenomAuthorityMetadataRequest { - const message = { - ...baseQueryDenomAuthorityMetadataRequest, - } as QueryDenomAuthorityMetadataRequest; - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.denom = object.denom ?? ""; return message; }, }; -const baseQueryDenomAuthorityMetadataResponse: object = {}; +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { authorityMetadata: undefined }; +} export const QueryDenomAuthorityMetadataResponse = { - encode( - message: QueryDenomAuthorityMetadataResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.authority_metadata !== undefined) { - DenomAuthorityMetadata.encode( - message.authority_metadata, - writer.uint32(10).fork() - ).ldelim(); + encode(message: QueryDenomAuthorityMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomAuthorityMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomAuthorityMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomAuthorityMetadataResponse, - } as QueryDenomAuthorityMetadataResponse; + const message = createBaseQueryDenomAuthorityMetadataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority_metadata = DenomAuthorityMetadata.decode( - reader, - reader.uint32() - ); + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -256,73 +216,48 @@ export const QueryDenomAuthorityMetadataResponse = { }, fromJSON(object: any): QueryDenomAuthorityMetadataResponse { - const message = { - ...baseQueryDenomAuthorityMetadataResponse, - } as QueryDenomAuthorityMetadataResponse; - if ( - object.authority_metadata !== undefined && - object.authority_metadata !== null - ) { - message.authority_metadata = DenomAuthorityMetadata.fromJSON( - object.authority_metadata - ); - } else { - message.authority_metadata = undefined; - } - return message; + return { + authorityMetadata: isSet(object.authorityMetadata) + ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) + : undefined, + }; }, toJSON(message: QueryDenomAuthorityMetadataResponse): unknown { const obj: any = {}; - message.authority_metadata !== undefined && - (obj.authority_metadata = message.authority_metadata - ? DenomAuthorityMetadata.toJSON(message.authority_metadata) - : undefined); + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata + ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) + : undefined); return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDenomAuthorityMetadataResponse { - const message = { - ...baseQueryDenomAuthorityMetadataResponse, - } as QueryDenomAuthorityMetadataResponse; - if ( - object.authority_metadata !== undefined && - object.authority_metadata !== null - ) { - message.authority_metadata = DenomAuthorityMetadata.fromPartial( - object.authority_metadata - ); - } else { - message.authority_metadata = undefined; - } + const message = createBaseQueryDenomAuthorityMetadataResponse(); + message.authorityMetadata = (object.authorityMetadata !== undefined && object.authorityMetadata !== null) + ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) + : undefined; return message; }, }; -const baseQueryDenomsFromCreatorRequest: object = { creator: "" }; +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { creator: "" }; +} export const QueryDenomsFromCreatorRequest = { - encode( - message: QueryDenomsFromCreatorRequest, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomsFromCreatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.creator !== "") { writer.uint32(10).string(message.creator); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsFromCreatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsFromCreatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsFromCreatorRequest, - } as QueryDenomsFromCreatorRequest; + const message = createBaseQueryDenomsFromCreatorRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -338,15 +273,7 @@ export const QueryDenomsFromCreatorRequest = { }, fromJSON(object: any): QueryDenomsFromCreatorRequest { - const message = { - ...baseQueryDenomsFromCreatorRequest, - } as QueryDenomsFromCreatorRequest; - if (object.creator !== undefined && object.creator !== null) { - message.creator = String(object.creator); - } else { - message.creator = ""; - } - return message; + return { creator: isSet(object.creator) ? String(object.creator) : "" }; }, toJSON(message: QueryDenomsFromCreatorRequest): unknown { @@ -355,44 +282,31 @@ export const QueryDenomsFromCreatorRequest = { return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDenomsFromCreatorRequest { - const message = { - ...baseQueryDenomsFromCreatorRequest, - } as QueryDenomsFromCreatorRequest; - if (object.creator !== undefined && object.creator !== null) { - message.creator = object.creator; - } else { - message.creator = ""; - } + const message = createBaseQueryDenomsFromCreatorRequest(); + message.creator = object.creator ?? ""; return message; }, }; -const baseQueryDenomsFromCreatorResponse: object = { denoms: "" }; +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { denoms: [] }; +} export const QueryDenomsFromCreatorResponse = { - encode( - message: QueryDenomsFromCreatorResponse, - writer: Writer = Writer.create() - ): Writer { + encode(message: QueryDenomsFromCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.denoms) { writer.uint32(10).string(v!); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryDenomsFromCreatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsFromCreatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryDenomsFromCreatorResponse, - } as QueryDenomsFromCreatorResponse; - message.denoms = []; + const message = createBaseQueryDenomsFromCreatorResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -408,16 +322,7 @@ export const QueryDenomsFromCreatorResponse = { }, fromJSON(object: any): QueryDenomsFromCreatorResponse { - const message = { - ...baseQueryDenomsFromCreatorResponse, - } as QueryDenomsFromCreatorResponse; - message.denoms = []; - if (object.denoms !== undefined && object.denoms !== null) { - for (const e of object.denoms) { - message.denoms.push(String(e)); - } - } - return message; + return { denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => String(e)) : [] }; }, toJSON(message: QueryDenomsFromCreatorResponse): unknown { @@ -430,18 +335,11 @@ export const QueryDenomsFromCreatorResponse = { return obj; }, - fromPartial( - object: DeepPartial + fromPartial, I>>( + object: I, ): QueryDenomsFromCreatorResponse { - const message = { - ...baseQueryDenomsFromCreatorResponse, - } as QueryDenomsFromCreatorResponse; - message.denoms = []; - if (object.denoms !== undefined && object.denoms !== null) { - for (const e of object.denoms) { - message.denoms.push(e); - } - } + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map((e) => e) || []; return message; }, }; @@ -457,77 +355,56 @@ export interface Query { * DenomAuthorityMetadata defines a gRPC query method for fetching * DenomAuthorityMetadata for a particular denom. */ - DenomAuthorityMetadata( - request: QueryDenomAuthorityMetadataRequest - ): Promise; + DenomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise; /** * DenomsFromCreator defines a gRPC query method for fetching all * denominations created by a specific admin/creator. */ - DenomsFromCreator( - request: QueryDenomsFromCreatorRequest - ): Promise; + DenomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.Params = this.Params.bind(this); + this.DenomAuthorityMetadata = this.DenomAuthorityMetadata.bind(this); + this.DenomsFromCreator = this.DenomsFromCreator.bind(this); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Query", - "Params", - data - ); - return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); } - DenomAuthorityMetadata( - request: QueryDenomAuthorityMetadataRequest - ): Promise { + DenomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise { const data = QueryDenomAuthorityMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Query", - "DenomAuthorityMetadata", - data - ); - return promise.then((data) => - QueryDenomAuthorityMetadataResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "DenomAuthorityMetadata", data); + return promise.then((data) => QueryDenomAuthorityMetadataResponse.decode(new _m0.Reader(data))); } - DenomsFromCreator( - request: QueryDenomsFromCreatorRequest - ): Promise { + DenomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { const data = QueryDenomsFromCreatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Query", - "DenomsFromCreator", - data - ); - return promise.then((data) => - QueryDenomsFromCreatorResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); + return promise.then((data) => QueryDenomsFromCreatorResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/tx.ts b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/tx.ts index dd2bbc678b..1a06144aa4 100644 --- a/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/tx.ts +++ b/wormchain/ts-sdk/src/modules/osmosis.tokenfactory.v1beta1/types/osmosis/tokenfactory/v1beta1/tx.ts @@ -1,8 +1,9 @@ //@ts-nocheck /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import _m0 from "protobufjs/minimal"; import { Metadata } from "../../../cosmos/bank/v1beta1/bank"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Params } from "./params"; export const protobufPackage = "osmosis.tokenfactory.v1beta1"; @@ -28,7 +29,7 @@ export interface MsgCreateDenom { * It returns the full string of the newly created denom */ export interface MsgCreateDenomResponse { - new_token_denom: string; + newTokenDenom: string; } /** @@ -41,7 +42,8 @@ export interface MsgMint { mintToAddress: string; } -export interface MsgMintResponse {} +export interface MsgMintResponse { +} /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn @@ -53,7 +55,8 @@ export interface MsgBurn { burnFromAddress: string; } -export interface MsgBurnResponse {} +export interface MsgBurnResponse { +} /** * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign @@ -62,14 +65,15 @@ export interface MsgBurnResponse {} export interface MsgChangeAdmin { sender: string; denom: string; - new_admin: string; + newAdmin: string; } /** * MsgChangeAdminResponse defines the response structure for an executed * MsgChangeAdmin message. */ -export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponse { +} /** * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set @@ -84,7 +88,8 @@ export interface MsgSetDenomMetadata { * MsgSetDenomMetadataResponse defines the response structure for an executed * MsgSetDenomMetadata message. */ -export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponse { +} export interface MsgForceTransfer { sender: string; @@ -93,12 +98,40 @@ export interface MsgForceTransfer { transferToAddress: string; } -export interface MsgForceTransferResponse {} +export interface MsgForceTransferResponse { +} + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/mint parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} -const baseMsgCreateDenom: object = { sender: "", subdenom: "" }; +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { sender: "", subdenom: "" }; +} export const MsgCreateDenom = { - encode(message: MsgCreateDenom, writer: Writer = Writer.create()): Writer { + encode(message: MsgCreateDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -108,10 +141,10 @@ export const MsgCreateDenom = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgCreateDenom { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDenom { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgCreateDenom } as MsgCreateDenom; + const message = createBaseMsgCreateDenom(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -130,18 +163,10 @@ export const MsgCreateDenom = { }, fromJSON(object: any): MsgCreateDenom { - const message = { ...baseMsgCreateDenom } as MsgCreateDenom; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.subdenom !== undefined && object.subdenom !== null) { - message.subdenom = String(object.subdenom); - } else { - message.subdenom = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + subdenom: isSet(object.subdenom) ? String(object.subdenom) : "", + }; }, toJSON(message: MsgCreateDenom): unknown { @@ -151,44 +176,35 @@ export const MsgCreateDenom = { return obj; }, - fromPartial(object: DeepPartial): MsgCreateDenom { - const message = { ...baseMsgCreateDenom } as MsgCreateDenom; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.subdenom !== undefined && object.subdenom !== null) { - message.subdenom = object.subdenom; - } else { - message.subdenom = ""; - } + fromPartial, I>>(object: I): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.subdenom = object.subdenom ?? ""; return message; }, }; -const baseMsgCreateDenomResponse: object = { new_token_denom: "" }; +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { newTokenDenom: "" }; +} export const MsgCreateDenomResponse = { - encode( - message: MsgCreateDenomResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.new_token_denom !== "") { - writer.uint32(10).string(message.new_token_denom); + encode(message: MsgCreateDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.newTokenDenom !== "") { + writer.uint32(10).string(message.newTokenDenom); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgCreateDenomResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgCreateDenomResponse } as MsgCreateDenomResponse; + const message = createBaseMsgCreateDenomResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.new_token_denom = reader.string(); + message.newTokenDenom = reader.string(); break; default: reader.skipType(tag & 7); @@ -199,45 +215,28 @@ export const MsgCreateDenomResponse = { }, fromJSON(object: any): MsgCreateDenomResponse { - const message = { ...baseMsgCreateDenomResponse } as MsgCreateDenomResponse; - if ( - object.new_token_denom !== undefined && - object.new_token_denom !== null - ) { - message.new_token_denom = String(object.new_token_denom); - } else { - message.new_token_denom = ""; - } - return message; + return { newTokenDenom: isSet(object.newTokenDenom) ? String(object.newTokenDenom) : "" }; }, toJSON(message: MsgCreateDenomResponse): unknown { const obj: any = {}; - message.new_token_denom !== undefined && - (obj.new_token_denom = message.new_token_denom); + message.newTokenDenom !== undefined && (obj.newTokenDenom = message.newTokenDenom); return obj; }, - fromPartial( - object: DeepPartial - ): MsgCreateDenomResponse { - const message = { ...baseMsgCreateDenomResponse } as MsgCreateDenomResponse; - if ( - object.new_token_denom !== undefined && - object.new_token_denom !== null - ) { - message.new_token_denom = object.new_token_denom; - } else { - message.new_token_denom = ""; - } + fromPartial, I>>(object: I): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + message.newTokenDenom = object.newTokenDenom ?? ""; return message; }, }; -const baseMsgMint: object = { sender: "", mintToAddress: "" }; +function createBaseMsgMint(): MsgMint { + return { sender: "", amount: undefined, mintToAddress: "" }; +} export const MsgMint = { - encode(message: MsgMint, writer: Writer = Writer.create()): Writer { + encode(message: MsgMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -250,10 +249,10 @@ export const MsgMint = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgMint { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMint } as MsgMint; + const message = createBaseMsgMint(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -275,67 +274,45 @@ export const MsgMint = { }, fromJSON(object: any): MsgMint { - const message = { ...baseMsgMint } as MsgMint; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - if (object.mintToAddress !== undefined && object.mintToAddress !== null) { - message.mintToAddress = String(object.mintToAddress); - } else { - message.mintToAddress = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + mintToAddress: isSet(object.mintToAddress) ? String(object.mintToAddress) : "", + }; }, toJSON(message: MsgMint): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.mintToAddress !== undefined && - (obj.mintToAddress = message.mintToAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.mintToAddress !== undefined && (obj.mintToAddress = message.mintToAddress); return obj; }, - fromPartial(object: DeepPartial): MsgMint { - const message = { ...baseMsgMint } as MsgMint; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - if (object.mintToAddress !== undefined && object.mintToAddress !== null) { - message.mintToAddress = object.mintToAddress; - } else { - message.mintToAddress = ""; - } + fromPartial, I>>(object: I): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + message.mintToAddress = object.mintToAddress ?? ""; return message; }, }; -const baseMsgMintResponse: object = {}; +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} export const MsgMintResponse = { - encode(_: MsgMintResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgMintResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgMintResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMintResponse } as MsgMintResponse; + const message = createBaseMsgMintResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -348,8 +325,7 @@ export const MsgMintResponse = { }, fromJSON(_: any): MsgMintResponse { - const message = { ...baseMsgMintResponse } as MsgMintResponse; - return message; + return {}; }, toJSON(_: MsgMintResponse): unknown { @@ -357,16 +333,18 @@ export const MsgMintResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgMintResponse { - const message = { ...baseMsgMintResponse } as MsgMintResponse; + fromPartial, I>>(_: I): MsgMintResponse { + const message = createBaseMsgMintResponse(); return message; }, }; -const baseMsgBurn: object = { sender: "", burnFromAddress: "" }; +function createBaseMsgBurn(): MsgBurn { + return { sender: "", amount: undefined, burnFromAddress: "" }; +} export const MsgBurn = { - encode(message: MsgBurn, writer: Writer = Writer.create()): Writer { + encode(message: MsgBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -379,10 +357,10 @@ export const MsgBurn = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgBurn { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurn { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgBurn } as MsgBurn; + const message = createBaseMsgBurn(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -404,73 +382,45 @@ export const MsgBurn = { }, fromJSON(object: any): MsgBurn { - const message = { ...baseMsgBurn } as MsgBurn; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - if ( - object.burnFromAddress !== undefined && - object.burnFromAddress !== null - ) { - message.burnFromAddress = String(object.burnFromAddress); - } else { - message.burnFromAddress = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + burnFromAddress: isSet(object.burnFromAddress) ? String(object.burnFromAddress) : "", + }; }, toJSON(message: MsgBurn): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.burnFromAddress !== undefined && - (obj.burnFromAddress = message.burnFromAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.burnFromAddress !== undefined && (obj.burnFromAddress = message.burnFromAddress); return obj; }, - fromPartial(object: DeepPartial): MsgBurn { - const message = { ...baseMsgBurn } as MsgBurn; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; - } - if ( - object.burnFromAddress !== undefined && - object.burnFromAddress !== null - ) { - message.burnFromAddress = object.burnFromAddress; - } else { - message.burnFromAddress = ""; - } + fromPartial, I>>(object: I): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + message.burnFromAddress = object.burnFromAddress ?? ""; return message; }, }; -const baseMsgBurnResponse: object = {}; +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} export const MsgBurnResponse = { - encode(_: MsgBurnResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgBurnResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgBurnResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurnResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgBurnResponse } as MsgBurnResponse; + const message = createBaseMsgBurnResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -483,8 +433,7 @@ export const MsgBurnResponse = { }, fromJSON(_: any): MsgBurnResponse { - const message = { ...baseMsgBurnResponse } as MsgBurnResponse; - return message; + return {}; }, toJSON(_: MsgBurnResponse): unknown { @@ -492,32 +441,34 @@ export const MsgBurnResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgBurnResponse { - const message = { ...baseMsgBurnResponse } as MsgBurnResponse; + fromPartial, I>>(_: I): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); return message; }, }; -const baseMsgChangeAdmin: object = { sender: "", denom: "", new_admin: "" }; +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { sender: "", denom: "", newAdmin: "" }; +} export const MsgChangeAdmin = { - encode(message: MsgChangeAdmin, writer: Writer = Writer.create()): Writer { + encode(message: MsgChangeAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.denom !== "") { writer.uint32(18).string(message.denom); } - if (message.new_admin !== "") { - writer.uint32(26).string(message.new_admin); + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); } return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgChangeAdmin { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChangeAdmin } as MsgChangeAdmin; + const message = createBaseMsgChangeAdmin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -528,7 +479,7 @@ export const MsgChangeAdmin = { message.denom = reader.string(); break; case 3: - message.new_admin = reader.string(); + message.newAdmin = reader.string(); break; default: reader.skipType(tag & 7); @@ -539,65 +490,43 @@ export const MsgChangeAdmin = { }, fromJSON(object: any): MsgChangeAdmin { - const message = { ...baseMsgChangeAdmin } as MsgChangeAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = String(object.denom); - } else { - message.denom = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = String(object.new_admin); - } else { - message.new_admin = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "", + }; }, toJSON(message: MsgChangeAdmin): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.denom !== undefined && (obj.denom = message.denom); - message.new_admin !== undefined && (obj.new_admin = message.new_admin); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); return obj; }, - fromPartial(object: DeepPartial): MsgChangeAdmin { - const message = { ...baseMsgChangeAdmin } as MsgChangeAdmin; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } else { - message.denom = ""; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.new_admin = object.new_admin; - } else { - message.new_admin = ""; - } + fromPartial, I>>(object: I): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.newAdmin = object.newAdmin ?? ""; return message; }, }; -const baseMsgChangeAdminResponse: object = {}; +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} export const MsgChangeAdminResponse = { - encode(_: MsgChangeAdminResponse, writer: Writer = Writer.create()): Writer { + encode(_: MsgChangeAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgChangeAdminResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgChangeAdminResponse } as MsgChangeAdminResponse; + const message = createBaseMsgChangeAdminResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -610,8 +539,7 @@ export const MsgChangeAdminResponse = { }, fromJSON(_: any): MsgChangeAdminResponse { - const message = { ...baseMsgChangeAdminResponse } as MsgChangeAdminResponse; - return message; + return {}; }, toJSON(_: MsgChangeAdminResponse): unknown { @@ -619,19 +547,18 @@ export const MsgChangeAdminResponse = { return obj; }, - fromPartial(_: DeepPartial): MsgChangeAdminResponse { - const message = { ...baseMsgChangeAdminResponse } as MsgChangeAdminResponse; + fromPartial, I>>(_: I): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); return message; }, }; -const baseMsgSetDenomMetadata: object = { sender: "" }; +function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { + return { sender: "", metadata: undefined }; +} export const MsgSetDenomMetadata = { - encode( - message: MsgSetDenomMetadata, - writer: Writer = Writer.create() - ): Writer { + encode(message: MsgSetDenomMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -641,10 +568,10 @@ export const MsgSetDenomMetadata = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgSetDenomMetadata { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetDenomMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgSetDenomMetadata } as MsgSetDenomMetadata; + const message = createBaseMsgSetDenomMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -663,65 +590,42 @@ export const MsgSetDenomMetadata = { }, fromJSON(object: any): MsgSetDenomMetadata { - const message = { ...baseMsgSetDenomMetadata } as MsgSetDenomMetadata; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromJSON(object.metadata); - } else { - message.metadata = undefined; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined, + }; }, toJSON(message: MsgSetDenomMetadata): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.metadata !== undefined && - (obj.metadata = message.metadata - ? Metadata.toJSON(message.metadata) - : undefined); + message.metadata !== undefined && (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); return obj; }, - fromPartial(object: DeepPartial): MsgSetDenomMetadata { - const message = { ...baseMsgSetDenomMetadata } as MsgSetDenomMetadata; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromPartial(object.metadata); - } else { - message.metadata = undefined; - } + fromPartial, I>>(object: I): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata(); + message.sender = object.sender ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? Metadata.fromPartial(object.metadata) + : undefined; return message; }, }; -const baseMsgSetDenomMetadataResponse: object = {}; +function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { + return {}; +} export const MsgSetDenomMetadataResponse = { - encode( - _: MsgSetDenomMetadataResponse, - writer: Writer = Writer.create() - ): Writer { + encode(_: MsgSetDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgSetDenomMetadataResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetDenomMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgSetDenomMetadataResponse, - } as MsgSetDenomMetadataResponse; + const message = createBaseMsgSetDenomMetadataResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -734,10 +638,7 @@ export const MsgSetDenomMetadataResponse = { }, fromJSON(_: any): MsgSetDenomMetadataResponse { - const message = { - ...baseMsgSetDenomMetadataResponse, - } as MsgSetDenomMetadataResponse; - return message; + return {}; }, toJSON(_: MsgSetDenomMetadataResponse): unknown { @@ -745,24 +646,18 @@ export const MsgSetDenomMetadataResponse = { return obj; }, - fromPartial( - _: DeepPartial - ): MsgSetDenomMetadataResponse { - const message = { - ...baseMsgSetDenomMetadataResponse, - } as MsgSetDenomMetadataResponse; + fromPartial, I>>(_: I): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse(); return message; }, }; -const baseMsgForceTransfer: object = { - sender: "", - transferFromAddress: "", - transferToAddress: "", -}; +function createBaseMsgForceTransfer(): MsgForceTransfer { + return { sender: "", amount: undefined, transferFromAddress: "", transferToAddress: "" }; +} export const MsgForceTransfer = { - encode(message: MsgForceTransfer, writer: Writer = Writer.create()): Writer { + encode(message: MsgForceTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -778,10 +673,10 @@ export const MsgForceTransfer = { return writer; }, - decode(input: Reader | Uint8Array, length?: number): MsgForceTransfer { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceTransfer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgForceTransfer } as MsgForceTransfer; + const message = createBaseMsgForceTransfer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -806,99 +701,147 @@ export const MsgForceTransfer = { }, fromJSON(object: any): MsgForceTransfer { - const message = { ...baseMsgForceTransfer } as MsgForceTransfer; - if (object.sender !== undefined && object.sender !== null) { - message.sender = String(object.sender); - } else { - message.sender = ""; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromJSON(object.amount); - } else { - message.amount = undefined; - } - if ( - object.transferFromAddress !== undefined && - object.transferFromAddress !== null - ) { - message.transferFromAddress = String(object.transferFromAddress); - } else { - message.transferFromAddress = ""; - } - if ( - object.transferToAddress !== undefined && - object.transferToAddress !== null - ) { - message.transferToAddress = String(object.transferToAddress); - } else { - message.transferToAddress = ""; - } - return message; + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + transferFromAddress: isSet(object.transferFromAddress) ? String(object.transferFromAddress) : "", + transferToAddress: isSet(object.transferToAddress) ? String(object.transferToAddress) : "", + }; }, toJSON(message: MsgForceTransfer): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.amount !== undefined && - (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.transferFromAddress !== undefined && - (obj.transferFromAddress = message.transferFromAddress); - message.transferToAddress !== undefined && - (obj.transferToAddress = message.transferToAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.transferFromAddress !== undefined && (obj.transferFromAddress = message.transferFromAddress); + message.transferToAddress !== undefined && (obj.transferToAddress = message.transferToAddress); return obj; }, - fromPartial(object: DeepPartial): MsgForceTransfer { - const message = { ...baseMsgForceTransfer } as MsgForceTransfer; - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } else { - message.sender = ""; + fromPartial, I>>(object: I): MsgForceTransfer { + const message = createBaseMsgForceTransfer(); + message.sender = object.sender ?? ""; + message.amount = (object.amount !== undefined && object.amount !== null) + ? Coin.fromPartial(object.amount) + : undefined; + message.transferFromAddress = object.transferFromAddress ?? ""; + message.transferToAddress = object.transferToAddress ?? ""; + return message; + }, +}; + +function createBaseMsgForceTransferResponse(): MsgForceTransferResponse { + return {}; +} + +export const MsgForceTransferResponse = { + encode(_: MsgForceTransferResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceTransferResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromPartial(object.amount); - } else { - message.amount = undefined; + return message; + }, + + fromJSON(_: any): MsgForceTransferResponse { + return {}; + }, + + toJSON(_: MsgForceTransferResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if ( - object.transferFromAddress !== undefined && - object.transferFromAddress !== null - ) { - message.transferFromAddress = object.transferFromAddress; - } else { - message.transferFromAddress = ""; + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); } - if ( - object.transferToAddress !== undefined && - object.transferToAddress !== null - ) { - message.transferToAddress = object.transferToAddress; - } else { - message.transferToAddress = ""; + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, }; -const baseMsgForceTransferResponse: object = {}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} -export const MsgForceTransferResponse = { - encode( - _: MsgForceTransferResponse, - writer: Writer = Writer.create() - ): Writer { +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): MsgForceTransferResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgForceTransferResponse, - } as MsgForceTransferResponse; + const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -910,24 +853,17 @@ export const MsgForceTransferResponse = { return message; }, - fromJSON(_: any): MsgForceTransferResponse { - const message = { - ...baseMsgForceTransferResponse, - } as MsgForceTransferResponse; - return message; + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; }, - toJSON(_: MsgForceTransferResponse): unknown { + toJSON(_: MsgUpdateParamsResponse): unknown { const obj: any = {}; return obj; }, - fromPartial( - _: DeepPartial - ): MsgForceTransferResponse { - const message = { - ...baseMsgForceTransferResponse, - } as MsgForceTransferResponse; + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); return message; }, }; @@ -938,103 +874,87 @@ export interface Msg { Mint(request: MsgMint): Promise; Burn(request: MsgBurn): Promise; ChangeAdmin(request: MsgChangeAdmin): Promise; - SetDenomMetadata( - request: MsgSetDenomMetadata - ): Promise; + SetDenomMetadata(request: MsgSetDenomMetadata): Promise; ForceTransfer(request: MsgForceTransfer): Promise; + /** + * UpdateParams defines a governance operation for updating the x/mint module + * parameters. The authority is hard-coded to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; + this.CreateDenom = this.CreateDenom.bind(this); + this.Mint = this.Mint.bind(this); + this.Burn = this.Burn.bind(this); + this.ChangeAdmin = this.ChangeAdmin.bind(this); + this.SetDenomMetadata = this.SetDenomMetadata.bind(this); + this.ForceTransfer = this.ForceTransfer.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); } CreateDenom(request: MsgCreateDenom): Promise { const data = MsgCreateDenom.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "CreateDenom", - data - ); - return promise.then((data) => - MsgCreateDenomResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "CreateDenom", data); + return promise.then((data) => MsgCreateDenomResponse.decode(new _m0.Reader(data))); } Mint(request: MsgMint): Promise { const data = MsgMint.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "Mint", - data - ); - return promise.then((data) => MsgMintResponse.decode(new Reader(data))); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "Mint", data); + return promise.then((data) => MsgMintResponse.decode(new _m0.Reader(data))); } Burn(request: MsgBurn): Promise { const data = MsgBurn.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "Burn", - data - ); - return promise.then((data) => MsgBurnResponse.decode(new Reader(data))); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "Burn", data); + return promise.then((data) => MsgBurnResponse.decode(new _m0.Reader(data))); } ChangeAdmin(request: MsgChangeAdmin): Promise { const data = MsgChangeAdmin.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "ChangeAdmin", - data - ); - return promise.then((data) => - MsgChangeAdminResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "ChangeAdmin", data); + return promise.then((data) => MsgChangeAdminResponse.decode(new _m0.Reader(data))); } - SetDenomMetadata( - request: MsgSetDenomMetadata - ): Promise { + SetDenomMetadata(request: MsgSetDenomMetadata): Promise { const data = MsgSetDenomMetadata.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "SetDenomMetadata", - data - ); - return promise.then((data) => - MsgSetDenomMetadataResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); + return promise.then((data) => MsgSetDenomMetadataResponse.decode(new _m0.Reader(data))); } ForceTransfer(request: MsgForceTransfer): Promise { const data = MsgForceTransfer.encode(request).finish(); - const promise = this.rpc.request( - "osmosis.tokenfactory.v1beta1.Msg", - "ForceTransfer", - data - ); - return promise.then((data) => - MsgForceTransferResponse.decode(new Reader(data)) - ); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "ForceTransfer", data); + return promise.then((data) => MsgForceTransferResponse.decode(new _m0.Reader(data))); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); } } interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/index.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/module.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/module.ts new file mode 100755 index 0000000000..001da2b268 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/module.ts @@ -0,0 +1,101 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; + +import { Params as typeParams} from "./types" +import { InFlightPacket as typeInFlightPacket} from "./types" + +export { }; + + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Params: getStructure(typeParams.fromPartial({})), + InFlightPacket: getStructure(typeInFlightPacket.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + PacketforwardV1: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/registry.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/registry.ts new file mode 100755 index 0000000000..89275ad23d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/registry.ts @@ -0,0 +1,8 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; + +const msgTypes: Array<[string, GeneratedType]> = [ + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/rest.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/rest.ts new file mode 100644 index 0000000000..b0c920ae31 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/rest.ts @@ -0,0 +1,187 @@ +//@ts-nocheck +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Params defines the set of packetforward parameters. + */ +export interface Packetforwardv1Params { + fee_percentage?: string; +} + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** +* MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. + +Since: cosmos-sdk 0.47 +*/ +export type V1MsgUpdateParamsResponse = object; + +/** + * QueryParamsResponse is the response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Packetforwardv1Params; +} + +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + +export type QueryParamsType = Record; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseType; + /** request body */ + body?: unknown; +} + +export type RequestParams = Omit; + +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; +} + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { + return { + ...this.instance.defaults, + ...params1, + ...(params2 || {}), + headers: { + ...(this.instance.defaults.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } + + public request = async ({ + secure, + path, + type, + query, + format, + body, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } + + return this.instance.request({ + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + params: query, + responseType: responseFormat, + data: body, + url: path, + }); + }; +} + +/** + * @title packetforward/v1/genesis.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Params queries all parameters of the packetforward module. + * @request GET:/ibc/apps/packetforward/v1/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/ibc/apps/packetforward/v1/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types.ts new file mode 100755 index 0000000000..ed83463f87 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types.ts @@ -0,0 +1,10 @@ +//@ts-nocheck +import { Params } from "./types/packetforward/v1/genesis" +import { InFlightPacket } from "./types/packetforward/v1/genesis" + + +export { + Params, + InFlightPacket, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/genesis.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/genesis.ts new file mode 100644 index 0000000000..16b8933d2c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/genesis.ts @@ -0,0 +1,477 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "packetforward.v1"; + +/** GenesisState defines the packetforward genesis state */ +export interface GenesisState { + params: + | Params + | undefined; + /** + * key - information about forwarded packet: src_channel + * (parsedReceiver.Channel), src_port (parsedReceiver.Port), sequence value - + * information about original packet for refunding if necessary: retries, + * srcPacketSender, srcPacket.DestinationChannel, srcPacket.DestinationPort + */ + inFlightPackets: { [key: string]: InFlightPacket }; +} + +export interface GenesisState_InFlightPacketsEntry { + key: string; + value: InFlightPacket | undefined; +} + +/** Params defines the set of packetforward parameters. */ +export interface Params { + feePercentage: string; +} + +/** + * InFlightPacket contains information about original packet for + * writing the acknowledgement and refunding if necessary. + */ +export interface InFlightPacket { + originalSenderAddress: string; + refundChannelId: string; + refundPortId: string; + packetSrcChannelId: string; + packetSrcPortId: string; + packetTimeoutTimestamp: number; + packetTimeoutHeight: string; + packetData: Uint8Array; + refundSequence: number; + retriesRemaining: number; + timeout: number; + nonrefundable: boolean; +} + +function createBaseGenesisState(): GenesisState { + return { params: undefined, inFlightPackets: {} }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + Object.entries(message.inFlightPackets).forEach(([key, value]) => { + GenesisState_InFlightPacketsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + const entry2 = GenesisState_InFlightPacketsEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.inFlightPackets[entry2.key] = entry2.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + inFlightPackets: isObject(object.inFlightPackets) + ? Object.entries(object.inFlightPackets).reduce<{ [key: string]: InFlightPacket }>((acc, [key, value]) => { + acc[key] = InFlightPacket.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + obj.inFlightPackets = {}; + if (message.inFlightPackets) { + Object.entries(message.inFlightPackets).forEach(([k, v]) => { + obj.inFlightPackets[k] = InFlightPacket.toJSON(v); + }); + } + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + message.inFlightPackets = Object.entries(object.inFlightPackets ?? {}).reduce<{ [key: string]: InFlightPacket }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = InFlightPacket.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseGenesisState_InFlightPacketsEntry(): GenesisState_InFlightPacketsEntry { + return { key: "", value: undefined }; +} + +export const GenesisState_InFlightPacketsEntry = { + encode(message: GenesisState_InFlightPacketsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + InFlightPacket.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState_InFlightPacketsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_InFlightPacketsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = InFlightPacket.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState_InFlightPacketsEntry { + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? InFlightPacket.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: GenesisState_InFlightPacketsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value ? InFlightPacket.toJSON(message.value) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): GenesisState_InFlightPacketsEntry { + const message = createBaseGenesisState_InFlightPacketsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? InFlightPacket.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseParams(): Params { + return { feePercentage: "" }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.feePercentage !== "") { + writer.uint32(10).string(message.feePercentage); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feePercentage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { feePercentage: isSet(object.feePercentage) ? String(object.feePercentage) : "" }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.feePercentage !== undefined && (obj.feePercentage = message.feePercentage); + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.feePercentage = object.feePercentage ?? ""; + return message; + }, +}; + +function createBaseInFlightPacket(): InFlightPacket { + return { + originalSenderAddress: "", + refundChannelId: "", + refundPortId: "", + packetSrcChannelId: "", + packetSrcPortId: "", + packetTimeoutTimestamp: 0, + packetTimeoutHeight: "", + packetData: new Uint8Array(), + refundSequence: 0, + retriesRemaining: 0, + timeout: 0, + nonrefundable: false, + }; +} + +export const InFlightPacket = { + encode(message: InFlightPacket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.originalSenderAddress !== "") { + writer.uint32(10).string(message.originalSenderAddress); + } + if (message.refundChannelId !== "") { + writer.uint32(18).string(message.refundChannelId); + } + if (message.refundPortId !== "") { + writer.uint32(26).string(message.refundPortId); + } + if (message.packetSrcChannelId !== "") { + writer.uint32(34).string(message.packetSrcChannelId); + } + if (message.packetSrcPortId !== "") { + writer.uint32(42).string(message.packetSrcPortId); + } + if (message.packetTimeoutTimestamp !== 0) { + writer.uint32(48).uint64(message.packetTimeoutTimestamp); + } + if (message.packetTimeoutHeight !== "") { + writer.uint32(58).string(message.packetTimeoutHeight); + } + if (message.packetData.length !== 0) { + writer.uint32(66).bytes(message.packetData); + } + if (message.refundSequence !== 0) { + writer.uint32(72).uint64(message.refundSequence); + } + if (message.retriesRemaining !== 0) { + writer.uint32(80).int32(message.retriesRemaining); + } + if (message.timeout !== 0) { + writer.uint32(88).uint64(message.timeout); + } + if (message.nonrefundable === true) { + writer.uint32(96).bool(message.nonrefundable); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InFlightPacket { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInFlightPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.originalSenderAddress = reader.string(); + break; + case 2: + message.refundChannelId = reader.string(); + break; + case 3: + message.refundPortId = reader.string(); + break; + case 4: + message.packetSrcChannelId = reader.string(); + break; + case 5: + message.packetSrcPortId = reader.string(); + break; + case 6: + message.packetTimeoutTimestamp = longToNumber(reader.uint64() as Long); + break; + case 7: + message.packetTimeoutHeight = reader.string(); + break; + case 8: + message.packetData = reader.bytes(); + break; + case 9: + message.refundSequence = longToNumber(reader.uint64() as Long); + break; + case 10: + message.retriesRemaining = reader.int32(); + break; + case 11: + message.timeout = longToNumber(reader.uint64() as Long); + break; + case 12: + message.nonrefundable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InFlightPacket { + return { + originalSenderAddress: isSet(object.originalSenderAddress) ? String(object.originalSenderAddress) : "", + refundChannelId: isSet(object.refundChannelId) ? String(object.refundChannelId) : "", + refundPortId: isSet(object.refundPortId) ? String(object.refundPortId) : "", + packetSrcChannelId: isSet(object.packetSrcChannelId) ? String(object.packetSrcChannelId) : "", + packetSrcPortId: isSet(object.packetSrcPortId) ? String(object.packetSrcPortId) : "", + packetTimeoutTimestamp: isSet(object.packetTimeoutTimestamp) ? Number(object.packetTimeoutTimestamp) : 0, + packetTimeoutHeight: isSet(object.packetTimeoutHeight) ? String(object.packetTimeoutHeight) : "", + packetData: isSet(object.packetData) ? bytesFromBase64(object.packetData) : new Uint8Array(), + refundSequence: isSet(object.refundSequence) ? Number(object.refundSequence) : 0, + retriesRemaining: isSet(object.retriesRemaining) ? Number(object.retriesRemaining) : 0, + timeout: isSet(object.timeout) ? Number(object.timeout) : 0, + nonrefundable: isSet(object.nonrefundable) ? Boolean(object.nonrefundable) : false, + }; + }, + + toJSON(message: InFlightPacket): unknown { + const obj: any = {}; + message.originalSenderAddress !== undefined && (obj.originalSenderAddress = message.originalSenderAddress); + message.refundChannelId !== undefined && (obj.refundChannelId = message.refundChannelId); + message.refundPortId !== undefined && (obj.refundPortId = message.refundPortId); + message.packetSrcChannelId !== undefined && (obj.packetSrcChannelId = message.packetSrcChannelId); + message.packetSrcPortId !== undefined && (obj.packetSrcPortId = message.packetSrcPortId); + message.packetTimeoutTimestamp !== undefined + && (obj.packetTimeoutTimestamp = Math.round(message.packetTimeoutTimestamp)); + message.packetTimeoutHeight !== undefined && (obj.packetTimeoutHeight = message.packetTimeoutHeight); + message.packetData !== undefined + && (obj.packetData = base64FromBytes(message.packetData !== undefined ? message.packetData : new Uint8Array())); + message.refundSequence !== undefined && (obj.refundSequence = Math.round(message.refundSequence)); + message.retriesRemaining !== undefined && (obj.retriesRemaining = Math.round(message.retriesRemaining)); + message.timeout !== undefined && (obj.timeout = Math.round(message.timeout)); + message.nonrefundable !== undefined && (obj.nonrefundable = message.nonrefundable); + return obj; + }, + + fromPartial, I>>(object: I): InFlightPacket { + const message = createBaseInFlightPacket(); + message.originalSenderAddress = object.originalSenderAddress ?? ""; + message.refundChannelId = object.refundChannelId ?? ""; + message.refundPortId = object.refundPortId ?? ""; + message.packetSrcChannelId = object.packetSrcChannelId ?? ""; + message.packetSrcPortId = object.packetSrcPortId ?? ""; + message.packetTimeoutTimestamp = object.packetTimeoutTimestamp ?? 0; + message.packetTimeoutHeight = object.packetTimeoutHeight ?? ""; + message.packetData = object.packetData ?? new Uint8Array(); + message.refundSequence = object.refundSequence ?? 0; + message.retriesRemaining = object.retriesRemaining ?? 0; + message.timeout = object.timeout ?? 0; + message.nonrefundable = object.nonrefundable ?? false; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/query.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/query.ts new file mode 100644 index 0000000000..5e57f2cdd4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/query.ts @@ -0,0 +1,142 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Params } from "./genesis"; + +export const protobufPackage = "packetforward.v1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { params: undefined }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** Params queries all parameters of the packetforward module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("packetforward.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/tx.ts b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/tx.ts new file mode 100644 index 0000000000..1176cce1ba --- /dev/null +++ b/wormchain/ts-sdk/src/modules/packetforward.v1/types/packetforward/v1/tx.ts @@ -0,0 +1,173 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Params } from "./genesis"; + +export const protobufPackage = "packetforward.v1"; + +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/packetforward parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} + +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse { +} + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { authority: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = (object.params !== undefined && object.params !== null) + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +/** Msg defines the Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/packetforward module + * parameters. The authority is hard-coded to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + UpdateParams(request: MsgUpdateParams): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UpdateParams = this.UpdateParams.bind(this); + } + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("packetforward.v1.Msg", "UpdateParams", data); + return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/index.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/index.ts new file mode 100755 index 0000000000..22eb94e77f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/index.ts @@ -0,0 +1,7 @@ +//@ts-nocheck +import Module from './module'; +import { txClient, queryClient, registry } from './module'; +import { msgTypes } from './registry'; + +export * from "./types"; +export { Module, msgTypes, txClient, queryClient, registry }; diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/module.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/module.ts new file mode 100755 index 0000000000..69b4a0b3b0 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/module.ts @@ -0,0 +1,455 @@ +//@ts-nocheck +// Generated by Ignite ignite.com/cli + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate"; +import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing"; +import { msgTypes } from './registry'; +import { IgniteClient } from "../client" +import { MissingWalletError } from "../helpers" +import { Api } from "./rest"; +import { MsgExecuteGovernanceVAA } from "./types/wormchain/wormhole/tx"; +import { MsgCreateAllowlistEntryRequest } from "./types/wormchain/wormhole/tx"; +import { MsgRegisterAccountAsGuardian } from "./types/wormchain/wormhole/tx"; +import { MsgStoreCode } from "./types/wormchain/wormhole/tx"; +import { MsgExecuteGatewayGovernanceVaa } from "./types/wormchain/wormhole/tx"; +import { MsgInstantiateContract } from "./types/wormchain/wormhole/tx"; +import { MsgDeleteWasmInstantiateAllowlist } from "./types/wormchain/wormhole/tx"; +import { MsgAddWasmInstantiateAllowlist } from "./types/wormchain/wormhole/tx"; +import { MsgDeleteAllowlistEntryRequest } from "./types/wormchain/wormhole/tx"; +import { MsgMigrateContract } from "./types/wormchain/wormhole/tx"; + +import { Config as typeConfig} from "./types" +import { ConsensusGuardianSetIndex as typeConsensusGuardianSetIndex} from "./types" +import { EventGuardianSetUpdate as typeEventGuardianSetUpdate} from "./types" +import { EventPostedMessage as typeEventPostedMessage} from "./types" +import { EventGuardianRegistered as typeEventGuardianRegistered} from "./types" +import { EventConsensusSetUpdate as typeEventConsensusSetUpdate} from "./types" +import { GuardianKey as typeGuardianKey} from "./types" +import { GuardianValidator as typeGuardianValidator} from "./types" +import { GuardianSet as typeGuardianSet} from "./types" +import { ValidatorAllowedAddress as typeValidatorAllowedAddress} from "./types" +import { WasmInstantiateAllowedContractCodeId as typeWasmInstantiateAllowedContractCodeId} from "./types" +import { IbcComposabilityMwContract as typeIbcComposabilityMwContract} from "./types" +import { ReplayProtection as typeReplayProtection} from "./types" +import { SequenceCounter as typeSequenceCounter} from "./types" + +export { MsgExecuteGovernanceVAA, MsgCreateAllowlistEntryRequest, MsgRegisterAccountAsGuardian, MsgStoreCode, MsgExecuteGatewayGovernanceVaa, MsgInstantiateContract, MsgDeleteWasmInstantiateAllowlist, MsgAddWasmInstantiateAllowlist, MsgDeleteAllowlistEntryRequest, MsgMigrateContract }; + +type sendMsgExecuteGovernanceVAAParams = { + value: MsgExecuteGovernanceVAA, + fee?: StdFee, + memo?: string +}; + +type sendMsgCreateAllowlistEntryRequestParams = { + value: MsgCreateAllowlistEntryRequest, + fee?: StdFee, + memo?: string +}; + +type sendMsgRegisterAccountAsGuardianParams = { + value: MsgRegisterAccountAsGuardian, + fee?: StdFee, + memo?: string +}; + +type sendMsgStoreCodeParams = { + value: MsgStoreCode, + fee?: StdFee, + memo?: string +}; + +type sendMsgExecuteGatewayGovernanceVaaParams = { + value: MsgExecuteGatewayGovernanceVaa, + fee?: StdFee, + memo?: string +}; + +type sendMsgInstantiateContractParams = { + value: MsgInstantiateContract, + fee?: StdFee, + memo?: string +}; + +type sendMsgDeleteWasmInstantiateAllowlistParams = { + value: MsgDeleteWasmInstantiateAllowlist, + fee?: StdFee, + memo?: string +}; + +type sendMsgAddWasmInstantiateAllowlistParams = { + value: MsgAddWasmInstantiateAllowlist, + fee?: StdFee, + memo?: string +}; + +type sendMsgDeleteAllowlistEntryRequestParams = { + value: MsgDeleteAllowlistEntryRequest, + fee?: StdFee, + memo?: string +}; + +type sendMsgMigrateContractParams = { + value: MsgMigrateContract, + fee?: StdFee, + memo?: string +}; + + +type msgExecuteGovernanceVAAParams = { + value: MsgExecuteGovernanceVAA, +}; + +type msgCreateAllowlistEntryRequestParams = { + value: MsgCreateAllowlistEntryRequest, +}; + +type msgRegisterAccountAsGuardianParams = { + value: MsgRegisterAccountAsGuardian, +}; + +type msgStoreCodeParams = { + value: MsgStoreCode, +}; + +type msgExecuteGatewayGovernanceVaaParams = { + value: MsgExecuteGatewayGovernanceVaa, +}; + +type msgInstantiateContractParams = { + value: MsgInstantiateContract, +}; + +type msgDeleteWasmInstantiateAllowlistParams = { + value: MsgDeleteWasmInstantiateAllowlist, +}; + +type msgAddWasmInstantiateAllowlistParams = { + value: MsgAddWasmInstantiateAllowlist, +}; + +type msgDeleteAllowlistEntryRequestParams = { + value: MsgDeleteAllowlistEntryRequest, +}; + +type msgMigrateContractParams = { + value: MsgMigrateContract, +}; + + +export const registry = new Registry(msgTypes); + +type Field = { + name: string; + type: unknown; +} +function getStructure(template) { + const structure: {fields: Field[]} = { fields: [] } + for (let [key, value] of Object.entries(template)) { + let field = { name: key, type: typeof value } + structure.fields.push(field) + } + return structure +} +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string + prefix: string + signer?: OfflineSigner +} + +export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => { + + return { + + async sendMsgExecuteGovernanceVAA({ value, fee, memo }: sendMsgExecuteGovernanceVAAParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgExecuteGovernanceVAA: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgExecuteGovernanceVAA({ value: MsgExecuteGovernanceVAA.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgExecuteGovernanceVAA: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgCreateAllowlistEntryRequest({ value, fee, memo }: sendMsgCreateAllowlistEntryRequestParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgCreateAllowlistEntryRequest: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgCreateAllowlistEntryRequest({ value: MsgCreateAllowlistEntryRequest.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgCreateAllowlistEntryRequest: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgRegisterAccountAsGuardian({ value, fee, memo }: sendMsgRegisterAccountAsGuardianParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgRegisterAccountAsGuardian: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgRegisterAccountAsGuardian({ value: MsgRegisterAccountAsGuardian.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgRegisterAccountAsGuardian: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgStoreCode({ value, fee, memo }: sendMsgStoreCodeParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgStoreCode: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgStoreCode({ value: MsgStoreCode.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgStoreCode: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgExecuteGatewayGovernanceVaa({ value, fee, memo }: sendMsgExecuteGatewayGovernanceVaaParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgExecuteGatewayGovernanceVaa: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgExecuteGatewayGovernanceVaa({ value: MsgExecuteGatewayGovernanceVaa.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgExecuteGatewayGovernanceVaa: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgInstantiateContract({ value, fee, memo }: sendMsgInstantiateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgInstantiateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgInstantiateContract({ value: MsgInstantiateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgInstantiateContract: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDeleteWasmInstantiateAllowlist({ value, fee, memo }: sendMsgDeleteWasmInstantiateAllowlistParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDeleteWasmInstantiateAllowlist: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDeleteWasmInstantiateAllowlist({ value: MsgDeleteWasmInstantiateAllowlist.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDeleteWasmInstantiateAllowlist: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgAddWasmInstantiateAllowlist({ value, fee, memo }: sendMsgAddWasmInstantiateAllowlistParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgAddWasmInstantiateAllowlist: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgAddWasmInstantiateAllowlist({ value: MsgAddWasmInstantiateAllowlist.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgAddWasmInstantiateAllowlist: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDeleteAllowlistEntryRequest({ value, fee, memo }: sendMsgDeleteAllowlistEntryRequestParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDeleteAllowlistEntryRequest: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDeleteAllowlistEntryRequest({ value: MsgDeleteAllowlistEntryRequest.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDeleteAllowlistEntryRequest: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgMigrateContract({ value, fee, memo }: sendMsgMigrateContractParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgMigrateContract: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgMigrateContract({ value: MsgMigrateContract.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgMigrateContract: Could not broadcast Tx: '+ e.message) + } + }, + + + msgExecuteGovernanceVAA({ value }: msgExecuteGovernanceVAAParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgExecuteGovernanceVAA", value: MsgExecuteGovernanceVAA.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgExecuteGovernanceVAA: Could not create message: ' + e.message) + } + }, + + msgCreateAllowlistEntryRequest({ value }: msgCreateAllowlistEntryRequestParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgCreateAllowlistEntryRequest", value: MsgCreateAllowlistEntryRequest.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgCreateAllowlistEntryRequest: Could not create message: ' + e.message) + } + }, + + msgRegisterAccountAsGuardian({ value }: msgRegisterAccountAsGuardianParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgRegisterAccountAsGuardian", value: MsgRegisterAccountAsGuardian.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgRegisterAccountAsGuardian: Could not create message: ' + e.message) + } + }, + + msgStoreCode({ value }: msgStoreCodeParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgStoreCode", value: MsgStoreCode.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgStoreCode: Could not create message: ' + e.message) + } + }, + + msgExecuteGatewayGovernanceVaa({ value }: msgExecuteGatewayGovernanceVaaParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgExecuteGatewayGovernanceVaa", value: MsgExecuteGatewayGovernanceVaa.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgExecuteGatewayGovernanceVaa: Could not create message: ' + e.message) + } + }, + + msgInstantiateContract({ value }: msgInstantiateContractParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgInstantiateContract", value: MsgInstantiateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgInstantiateContract: Could not create message: ' + e.message) + } + }, + + msgDeleteWasmInstantiateAllowlist({ value }: msgDeleteWasmInstantiateAllowlistParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist", value: MsgDeleteWasmInstantiateAllowlist.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDeleteWasmInstantiateAllowlist: Could not create message: ' + e.message) + } + }, + + msgAddWasmInstantiateAllowlist({ value }: msgAddWasmInstantiateAllowlistParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgAddWasmInstantiateAllowlist", value: MsgAddWasmInstantiateAllowlist.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgAddWasmInstantiateAllowlist: Could not create message: ' + e.message) + } + }, + + msgDeleteAllowlistEntryRequest({ value }: msgDeleteAllowlistEntryRequestParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgDeleteAllowlistEntryRequest", value: MsgDeleteAllowlistEntryRequest.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDeleteAllowlistEntryRequest: Could not create message: ' + e.message) + } + }, + + msgMigrateContract({ value }: msgMigrateContractParams): EncodeObject { + try { + return { typeUrl: "/wormchain.wormhole.MsgMigrateContract", value: MsgMigrateContract.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgMigrateContract: Could not create message: ' + e.message) + } + }, + + } +}; + +interface QueryClientOptions { + addr: string +} + +export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseURL: addr }); +}; + +class SDKModule { + public query: ReturnType; + public tx: ReturnType; + public structure: Record; + public registry: Array<[string, GeneratedType]> = []; + + constructor(client: IgniteClient) { + + this.query = queryClient({ addr: client.env.apiURL }); + this.updateTX(client); + this.structure = { + Config: getStructure(typeConfig.fromPartial({})), + ConsensusGuardianSetIndex: getStructure(typeConsensusGuardianSetIndex.fromPartial({})), + EventGuardianSetUpdate: getStructure(typeEventGuardianSetUpdate.fromPartial({})), + EventPostedMessage: getStructure(typeEventPostedMessage.fromPartial({})), + EventGuardianRegistered: getStructure(typeEventGuardianRegistered.fromPartial({})), + EventConsensusSetUpdate: getStructure(typeEventConsensusSetUpdate.fromPartial({})), + GuardianKey: getStructure(typeGuardianKey.fromPartial({})), + GuardianValidator: getStructure(typeGuardianValidator.fromPartial({})), + GuardianSet: getStructure(typeGuardianSet.fromPartial({})), + ValidatorAllowedAddress: getStructure(typeValidatorAllowedAddress.fromPartial({})), + WasmInstantiateAllowedContractCodeId: getStructure(typeWasmInstantiateAllowedContractCodeId.fromPartial({})), + IbcComposabilityMwContract: getStructure(typeIbcComposabilityMwContract.fromPartial({})), + ReplayProtection: getStructure(typeReplayProtection.fromPartial({})), + SequenceCounter: getStructure(typeSequenceCounter.fromPartial({})), + + }; + client.on('signer-changed',(signer) => { + this.updateTX(client); + }) + } + updateTX(client: IgniteClient) { + const methods = txClient({ + signer: client.signer, + addr: client.env.rpcURL, + prefix: client.env.prefix ?? "cosmos", + }) + + this.tx = methods; + for (let m in methods) { + this.tx[m] = methods[m].bind(this.tx); + } + } +}; + +const Module = (test: IgniteClient) => { + return { + module: { + WormchainWormhole: new SDKModule(test) + }, + registry: msgTypes + } +} +export default Module; \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/registry.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/registry.ts new file mode 100755 index 0000000000..c9fff24704 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/registry.ts @@ -0,0 +1,28 @@ +//@ts-nocheck +import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgExecuteGovernanceVAA } from "./types/wormchain/wormhole/tx"; +import { MsgCreateAllowlistEntryRequest } from "./types/wormchain/wormhole/tx"; +import { MsgRegisterAccountAsGuardian } from "./types/wormchain/wormhole/tx"; +import { MsgStoreCode } from "./types/wormchain/wormhole/tx"; +import { MsgExecuteGatewayGovernanceVaa } from "./types/wormchain/wormhole/tx"; +import { MsgInstantiateContract } from "./types/wormchain/wormhole/tx"; +import { MsgDeleteWasmInstantiateAllowlist } from "./types/wormchain/wormhole/tx"; +import { MsgAddWasmInstantiateAllowlist } from "./types/wormchain/wormhole/tx"; +import { MsgDeleteAllowlistEntryRequest } from "./types/wormchain/wormhole/tx"; +import { MsgMigrateContract } from "./types/wormchain/wormhole/tx"; + +const msgTypes: Array<[string, GeneratedType]> = [ + ["/wormchain.wormhole.MsgExecuteGovernanceVAA", MsgExecuteGovernanceVAA], + ["/wormchain.wormhole.MsgCreateAllowlistEntryRequest", MsgCreateAllowlistEntryRequest], + ["/wormchain.wormhole.MsgRegisterAccountAsGuardian", MsgRegisterAccountAsGuardian], + ["/wormchain.wormhole.MsgStoreCode", MsgStoreCode], + ["/wormchain.wormhole.MsgExecuteGatewayGovernanceVaa", MsgExecuteGatewayGovernanceVaa], + ["/wormchain.wormhole.MsgInstantiateContract", MsgInstantiateContract], + ["/wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist", MsgDeleteWasmInstantiateAllowlist], + ["/wormchain.wormhole.MsgAddWasmInstantiateAllowlist", MsgAddWasmInstantiateAllowlist], + ["/wormchain.wormhole.MsgDeleteAllowlistEntryRequest", MsgDeleteAllowlistEntryRequest], + ["/wormchain.wormhole.MsgMigrateContract", MsgMigrateContract], + +]; + +export { msgTypes } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/rest.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/rest.ts similarity index 75% rename from wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/rest.ts rename to wormchain/ts-sdk/src/modules/wormchain.wormhole/rest.ts index 90dadfb944..1198c90c4f 100644 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/rest.ts +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/rest.ts @@ -77,14 +77,23 @@ corresponding request message has used PageRequest. } */ export interface V1Beta1PageResponse { - /** @format byte */ + /** + * 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. + * @format byte + */ next_key?: string; - /** @format uint64 */ + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + * @format uint64 + */ total?: string; } -export interface WormholeConfig { +export interface WormchainwormholeConfig { /** @format uint64 */ guardian_set_expiration?: string; @@ -98,14 +107,12 @@ export interface WormholeConfig { chain_id?: number; } -export interface WormholeConsensusGuardianSetIndex { +export interface WormchainwormholeConsensusGuardianSetIndex { /** @format int64 */ index?: number; } -export type WormholeEmptyResponse = object; - -export interface WormholeGuardianSet { +export interface WormchainwormholeGuardianSet { /** @format int64 */ index?: number; keys?: string[]; @@ -114,7 +121,7 @@ export interface WormholeGuardianSet { expirationTime?: string; } -export interface WormholeGuardianValidator { +export interface WormchainwormholeGuardianValidator { /** @format byte */ guardianKey?: string; @@ -122,6 +129,19 @@ export interface WormholeGuardianValidator { validatorAddr?: string; } +export interface WormchainwormholeReplayProtection { + index?: string; +} + +export interface WormchainwormholeSequenceCounter { + index?: string; + + /** @format uint64 */ + sequence?: string; +} + +export type WormholeEmptyResponse = object; + export type WormholeMsgAllowlistResponse = object; export type WormholeMsgExecuteGovernanceVAAResponse = object; @@ -130,7 +150,10 @@ export interface WormholeMsgInstantiateContractResponse { /** Address is the bech32 address of the new contract instance. */ address?: string; - /** @format byte */ + /** + * Data contains base64-encoded bytes to returned from the contract + * @format byte + */ data?: string; } @@ -138,24 +161,34 @@ export interface WormholeMsgInstantiateContractResponse { * MsgMigrateContractResponse returns contract migration result data. */ export interface WormholeMsgMigrateContractResponse { - /** @format byte */ + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + * @format byte + */ data?: string; } export type WormholeMsgRegisterAccountAsGuardianResponse = object; export interface WormholeMsgStoreCodeResponse { - /** @format uint64 */ + /** + * CodeID is the reference to the stored WASM code + * @format uint64 + */ code_id?: string; - /** @format byte */ + /** + * Checksum is the sha256 hash of the stored code + * @format byte + */ checksum?: string; } export type WormholeMsgWasmInstantiateAllowlistResponse = object; export interface WormholeQueryAllGuardianSetResponse { - GuardianSet?: WormholeGuardianSet[]; + GuardianSet?: WormchainwormholeGuardianSet[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -170,7 +203,7 @@ export interface WormholeQueryAllGuardianSetResponse { } export interface WormholeQueryAllGuardianValidatorResponse { - guardianValidator?: WormholeGuardianValidator[]; + guardianValidator?: WormchainwormholeGuardianValidator[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -185,7 +218,7 @@ export interface WormholeQueryAllGuardianValidatorResponse { } export interface WormholeQueryAllReplayProtectionResponse { - replayProtection?: WormholeReplayProtection[]; + replayProtection?: WormchainwormholeReplayProtection[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -200,7 +233,7 @@ export interface WormholeQueryAllReplayProtectionResponse { } export interface WormholeQueryAllSequenceCounterResponse { - sequenceCounter?: WormholeSequenceCounter[]; + sequenceCounter?: WormchainwormholeSequenceCounter[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -245,27 +278,27 @@ export interface WormholeQueryAllWasmInstantiateAllowlistResponse { } export interface WormholeQueryGetConfigResponse { - Config?: WormholeConfig; + Config?: WormchainwormholeConfig; } export interface WormholeQueryGetConsensusGuardianSetIndexResponse { - ConsensusGuardianSetIndex?: WormholeConsensusGuardianSetIndex; + ConsensusGuardianSetIndex?: WormchainwormholeConsensusGuardianSetIndex; } export interface WormholeQueryGetGuardianSetResponse { - GuardianSet?: WormholeGuardianSet; + GuardianSet?: WormchainwormholeGuardianSet; } export interface WormholeQueryGetGuardianValidatorResponse { - guardianValidator?: WormholeGuardianValidator; + guardianValidator?: WormchainwormholeGuardianValidator; } export interface WormholeQueryGetReplayProtectionResponse { - replayProtection?: WormholeReplayProtection; + replayProtection?: WormchainwormholeReplayProtection; } export interface WormholeQueryGetSequenceCounterResponse { - sequenceCounter?: WormholeSequenceCounter; + sequenceCounter?: WormchainwormholeSequenceCounter; } export interface WormholeQueryIbcComposabilityMwContractResponse { @@ -293,34 +326,33 @@ export interface WormholeQueryValidatorAllowlistResponse { pagination?: V1Beta1PageResponse; } -export interface WormholeReplayProtection { - index?: string; -} - -export interface WormholeSequenceCounter { - index?: string; - - /** @format uint64 */ - sequence?: string; -} - export interface WormholeValidatorAllowedAddress { + /** the validator/guardian that controls this entry */ validator_address?: string; + + /** the allowlisted account */ allowed_address?: string; + + /** human readable name */ name?: string; } export interface WormholeWasmInstantiateAllowedContractCodeId { + /** bech32 address of the contract that can call wasm instantiate without a VAA */ contract_address?: string; - /** @format uint64 */ + /** + * reference to the stored WASM code that can be instantiated + * @format uint64 + */ code_id?: string; } +import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; + export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; -export interface FullRequestParams extends Omit { +export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ @@ -330,30 +362,21 @@ export interface FullRequestParams extends Omit { /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ - format?: keyof Omit; + format?: ResponseType; /** request body */ body?: unknown; - /** base url */ - baseUrl?: string; - /** request cancellation token */ - cancelToken?: CancelToken; } export type RequestParams = Omit; -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: (securityData: SecurityDataType) => RequestParams | void; -} - -export interface HttpResponse extends Response { - data: D; - error: E; +export interface ApiConfig extends Omit { + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | AxiosRequestConfig | void; + secure?: boolean; + format?: ResponseType; } -type CancelToken = Symbol | string | number; - export enum ContentType { Json = "application/json", FormData = "multipart/form-data", @@ -361,155 +384,92 @@ export enum ContentType { } export class HttpClient { - public baseUrl: string = ""; - private securityData: SecurityDataType = null as any; - private securityWorker: null | ApiConfig["securityWorker"] = null; - private abortControllers = new Map(); - - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; - - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); + public instance: AxiosInstance; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private secure?: boolean; + private format?: ResponseType; + + constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) { + this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" }); + this.secure = secure; + this.format = format; + this.securityWorker = securityWorker; } - public setSecurityData = (data: SecurityDataType) => { + public setSecurityData = (data: SecurityDataType | null) => { this.securityData = data; }; - private addQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - - return ( - encodeURIComponent(key) + - "=" + - encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) - ); - } - - protected toQueryString(rawQuery?: QueryParamsType): string { - const query = rawQuery || {}; - const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); - return keys - .map((key) => - typeof query[key] === "object" && !Array.isArray(query[key]) - ? this.toQueryString(query[key] as QueryParamsType) - : this.addQueryParam(query, key), - ) - .join("&"); - } - - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? `?${queryString}` : ""; - } - - private contentFormatters: Record any> = { - [ContentType.Json]: (input: any) => - input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((data, key) => { - data.append(key, input[key]); - return data; - }, new FormData()), - [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), - }; - - private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig { return { - ...this.baseApiParams, + ...this.instance.defaults, ...params1, ...(params2 || {}), headers: { - ...(this.baseApiParams.headers || {}), + ...(this.instance.defaults.headers || {}), ...(params1.headers || {}), ...((params2 && params2.headers) || {}), }, }; } - private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { - if (this.abortControllers.has(cancelToken)) { - const abortController = this.abortControllers.get(cancelToken); - if (abortController) { - return abortController.signal; - } - return void 0; - } - - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; - - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); - - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + private createFormData(input: Record): FormData { + return Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()); + } - public request = ({ - body, + public request = async ({ secure, path, type, query, - format = "json", - baseUrl, - cancelToken, + format, + body, ...params - }: FullRequestParams): Promise> => { - const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; const requestParams = this.mergeRequestParams(params, secureParams); - const queryString = query && this.toQueryString(query); - const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = (format && this.format) || void 0; + + if (type === ContentType.FormData && body && body !== null && typeof body === "object") { + requestParams.headers.common = { Accept: "*/*" }; + requestParams.headers.post = {}; + requestParams.headers.put = {}; + + body = this.createFormData(body as Record); + } - return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + return this.instance.request({ ...requestParams, headers: { ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), ...(requestParams.headers || {}), }, - signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, - body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), - }).then(async (response) => { - const r = response as HttpResponse; - r.data = (null as unknown) as T; - r.error = (null as unknown) as E; - - const data = await response[format]() - .then((data) => { - if (r.ok) { - r.data = data; - } else { - r.error = data; - } - return r; - }) - .catch((e) => { - r.error = e; - return r; - }); - - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } - - if (!response.ok) throw data; - return data; + params: query, + responseType: responseFormat, + data: body, + url: path, }); }; } /** - * @title wormhole/config.proto + * @title wormchain/wormhole/config.proto * @version version not set */ export class Api extends HttpClient { @@ -546,7 +506,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/wormhole_foundation/wormchain/wormhole/allowlist/${validator_address}`, + path: `/wormhole_foundation/wormchain/wormhole/allowlist/${validatorAddress}`, method: "GET", query: query, format: "json", diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types.ts new file mode 100755 index 0000000000..24f5670101 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types.ts @@ -0,0 +1,34 @@ +//@ts-nocheck +import { Config } from "./types/wormchain/wormhole/config" +import { ConsensusGuardianSetIndex } from "./types/wormchain/wormhole/consensus_guardian_set_index" +import { EventGuardianSetUpdate } from "./types/wormchain/wormhole/events" +import { EventPostedMessage } from "./types/wormchain/wormhole/events" +import { EventGuardianRegistered } from "./types/wormchain/wormhole/events" +import { EventConsensusSetUpdate } from "./types/wormchain/wormhole/events" +import { GuardianKey } from "./types/wormchain/wormhole/guardian" +import { GuardianValidator } from "./types/wormchain/wormhole/guardian" +import { GuardianSet } from "./types/wormchain/wormhole/guardian" +import { ValidatorAllowedAddress } from "./types/wormchain/wormhole/guardian" +import { WasmInstantiateAllowedContractCodeId } from "./types/wormchain/wormhole/guardian" +import { IbcComposabilityMwContract } from "./types/wormchain/wormhole/guardian" +import { ReplayProtection } from "./types/wormchain/wormhole/replay_protection" +import { SequenceCounter } from "./types/wormchain/wormhole/sequence_counter" + + +export { + Config, + ConsensusGuardianSetIndex, + EventGuardianSetUpdate, + EventPostedMessage, + EventGuardianRegistered, + EventConsensusSetUpdate, + GuardianKey, + GuardianValidator, + GuardianSet, + ValidatorAllowedAddress, + WasmInstantiateAllowedContractCodeId, + IbcComposabilityMwContract, + ReplayProtection, + SequenceCounter, + + } \ No newline at end of file diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 0000000000..fb308b28f4 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +/* 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: number; + /** + * 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: number; + /** + * 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: number; +} + +function createBasePageRequest(): PageRequest { + return { key: new Uint8Array(), offset: 0, limit: 0, 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 !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(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) ? Number(object.offset) : 0, + limit: isSet(object.limit) ? Number(object.limit) : 0, + 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 = Math.round(message.offset)); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + 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 ?? 0; + message.limit = object.limit ?? 0; + message.countTotal = object.countTotal ?? false; + message.reverse = object.reverse ?? false; + return message; + }, +}; + +function createBasePageResponse(): PageResponse { + return { nextKey: new Uint8Array(), total: 0 }; +} + +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 !== 0) { + 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 = longToNumber(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) ? Number(object.total) : 0, + }; + }, + + 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 = Math.round(message.total)); + return obj; + }, + + fromPartial, I>>(object: I): PageResponse { + const message = createBasePageResponse(); + message.nextKey = object.nextKey ?? new Uint8Array(); + message.total = object.total ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/msg/v1/msg.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000000..fd9a503096 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos/msg/v1/msg.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "cosmos.msg.v1"; diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos_proto/cosmos.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos_proto/cosmos.ts new file mode 100644 index 0000000000..855969e891 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/cosmos_proto/cosmos.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +export enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0, + SCALAR_TYPE_STRING = 1, + SCALAR_TYPE_BYTES = 2, + UNRECOGNIZED = -1, +} + +export function scalarTypeFromJSON(object: any): ScalarType { + switch (object) { + case 0: + case "SCALAR_TYPE_UNSPECIFIED": + return ScalarType.SCALAR_TYPE_UNSPECIFIED; + case 1: + case "SCALAR_TYPE_STRING": + return ScalarType.SCALAR_TYPE_STRING; + case 2: + case "SCALAR_TYPE_BYTES": + return ScalarType.SCALAR_TYPE_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return ScalarType.UNRECOGNIZED; + } +} + +export function scalarTypeToJSON(object: ScalarType): string { + switch (object) { + case ScalarType.SCALAR_TYPE_UNSPECIFIED: + return "SCALAR_TYPE_UNSPECIFIED"; + case ScalarType.SCALAR_TYPE_STRING: + return "SCALAR_TYPE_STRING"; + case ScalarType.SCALAR_TYPE_BYTES: + return "SCALAR_TYPE_BYTES"; + case ScalarType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * InterfaceDescriptor describes an interface type to be used with + * accepts_interface and implements_interface and declared by declare_interface. + */ +export interface InterfaceDescriptor { + /** + * name is the name of the interface. It should be a short-name (without + * a period) such that the fully qualified name of the interface will be + * package.name, ex. for the package a.b and interface named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the interface and its + * purpose. + */ + description: string; +} + +/** + * ScalarDescriptor describes an scalar type to be used with + * the scalar field option and declared by declare_scalar. + * Scalars extend simple protobuf built-in types with additional + * syntax and semantics, for instance to represent big integers. + * Scalars should ideally define an encoding such that there is only one + * valid syntactical representation for a given semantic meaning, + * i.e. the encoding should be deterministic. + */ +export interface ScalarDescriptor { + /** + * name is the name of the scalar. It should be a short-name (without + * a period) such that the fully qualified name of the scalar will be + * package.name, ex. for the package a.b and scalar named C, the + * fully-qualified name will be a.b.C. + */ + name: string; + /** + * description is a human-readable description of the scalar and its + * encoding format. For instance a big integer or decimal scalar should + * specify precisely the expected encoding format. + */ + description: string; + /** + * field_type is the type of field with which this scalar can be used. + * Scalars can be used with one and only one type of field so that + * encoding standards and simple and clear. Currently only string and + * bytes fields are supported for scalars. + */ + fieldType: ScalarType[]; +} + +function createBaseInterfaceDescriptor(): InterfaceDescriptor { + return { name: "", description: "" }; +} + +export const InterfaceDescriptor = { + encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInterfaceDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + }; + }, + + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial, I>>(object: I): InterfaceDescriptor { + const message = createBaseInterfaceDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseScalarDescriptor(): ScalarDescriptor { + return { name: "", description: "", fieldType: [] }; +} + +export const ScalarDescriptor = { + encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.fieldType) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScalarDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.fieldType.push(reader.int32() as any); + } + } else { + message.fieldType.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [], + }; + }, + + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, + + fromPartial, I>>(object: I): ScalarDescriptor { + const message = createBaseScalarDescriptor(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.fieldType = object.fieldType?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/gogoproto/gogo.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/gogoproto/gogo.ts new file mode 100644 index 0000000000..cdc6bc59ea --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/gogoproto/gogo.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/annotations.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/annotations.ts new file mode 100644 index 0000000000..b42a510775 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/annotations.ts @@ -0,0 +1,3 @@ +//@ts-nocheck +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/http.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/http.ts new file mode 100644 index 0000000000..63d8278040 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/api/http.ts @@ -0,0 +1,590 @@ +//@ts-nocheck +/* eslint-disable */ +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/protobuf/descriptor.ts new file mode 100644 index 0000000000..93db6f82d2 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/google/protobuf/descriptor.ts @@ -0,0 +1,3754 @@ +//@ts-nocheck +/* 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 + | undefined; + /** + * 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 + | undefined; + /** + * 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 | undefined; + 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 | undefined; +} + +/** + * 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. + * TODO(kenton): Base-64 encode? + */ + 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 + | undefined; + /** + * 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 | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: + | EnumOptions + | undefined; + /** + * 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 | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** 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 + | undefined; + /** 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. + */ + lazy: 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: number; + negativeIntValue: number; + 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], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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>>( + 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, 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.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 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, + 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.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.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: 0, + negativeIntValue: 0, + 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 !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + 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 = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negativeIntValue = longToNumber(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) ? Number(object.positiveIntValue) : 0, + negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0, + 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 = Math.round(message.positiveIntValue)); + message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue)); + 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 ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/config.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/config.ts new file mode 100644 index 0000000000..cd57bcb5c3 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/config.ts @@ -0,0 +1,164 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface Config { + guardianSetExpiration: number; + governanceEmitter: Uint8Array; + governanceChain: number; + chainId: number; +} + +function createBaseConfig(): Config { + return { guardianSetExpiration: 0, governanceEmitter: new Uint8Array(), governanceChain: 0, chainId: 0 }; +} + +export const Config = { + encode(message: Config, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.guardianSetExpiration !== 0) { + writer.uint32(8).uint64(message.guardianSetExpiration); + } + if (message.governanceEmitter.length !== 0) { + writer.uint32(18).bytes(message.governanceEmitter); + } + if (message.governanceChain !== 0) { + writer.uint32(24).uint32(message.governanceChain); + } + if (message.chainId !== 0) { + writer.uint32(32).uint32(message.chainId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Config { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianSetExpiration = longToNumber(reader.uint64() as Long); + break; + case 2: + message.governanceEmitter = reader.bytes(); + break; + case 3: + message.governanceChain = reader.uint32(); + break; + case 4: + message.chainId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Config { + return { + guardianSetExpiration: isSet(object.guardianSetExpiration) ? Number(object.guardianSetExpiration) : 0, + governanceEmitter: isSet(object.governanceEmitter) ? bytesFromBase64(object.governanceEmitter) : new Uint8Array(), + governanceChain: isSet(object.governanceChain) ? Number(object.governanceChain) : 0, + chainId: isSet(object.chainId) ? Number(object.chainId) : 0, + }; + }, + + toJSON(message: Config): unknown { + const obj: any = {}; + message.guardianSetExpiration !== undefined + && (obj.guardianSetExpiration = Math.round(message.guardianSetExpiration)); + message.governanceEmitter !== undefined + && (obj.governanceEmitter = base64FromBytes( + message.governanceEmitter !== undefined ? message.governanceEmitter : new Uint8Array(), + )); + message.governanceChain !== undefined && (obj.governanceChain = Math.round(message.governanceChain)); + message.chainId !== undefined && (obj.chainId = Math.round(message.chainId)); + return obj; + }, + + fromPartial, I>>(object: I): Config { + const message = createBaseConfig(); + message.guardianSetExpiration = object.guardianSetExpiration ?? 0; + message.governanceEmitter = object.governanceEmitter ?? new Uint8Array(); + message.governanceChain = object.governanceChain ?? 0; + message.chainId = object.chainId ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/consensus_guardian_set_index.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/consensus_guardian_set_index.ts new file mode 100644 index 0000000000..4941638ef0 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/consensus_guardian_set_index.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface ConsensusGuardianSetIndex { + index: number; +} + +function createBaseConsensusGuardianSetIndex(): ConsensusGuardianSetIndex { + return { index: 0 }; +} + +export const ConsensusGuardianSetIndex = { + encode(message: ConsensusGuardianSetIndex, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusGuardianSetIndex { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusGuardianSetIndex(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusGuardianSetIndex { + return { index: isSet(object.index) ? Number(object.index) : 0 }; + }, + + toJSON(message: ConsensusGuardianSetIndex): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = Math.round(message.index)); + return obj; + }, + + fromPartial, I>>(object: I): ConsensusGuardianSetIndex { + const message = createBaseConsensusGuardianSetIndex(); + message.index = object.index ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/events.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/events.ts new file mode 100644 index 0000000000..91a7c05a82 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/events.ts @@ -0,0 +1,367 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface EventGuardianSetUpdate { + oldIndex: number; + newIndex: number; +} + +export interface EventPostedMessage { + emitter: Uint8Array; + sequence: number; + nonce: number; + time: number; + payload: Uint8Array; +} + +export interface EventGuardianRegistered { + guardianKey: Uint8Array; + validatorKey: Uint8Array; +} + +export interface EventConsensusSetUpdate { + oldIndex: number; + newIndex: number; +} + +function createBaseEventGuardianSetUpdate(): EventGuardianSetUpdate { + return { oldIndex: 0, newIndex: 0 }; +} + +export const EventGuardianSetUpdate = { + encode(message: EventGuardianSetUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.oldIndex !== 0) { + writer.uint32(8).uint32(message.oldIndex); + } + if (message.newIndex !== 0) { + writer.uint32(16).uint32(message.newIndex); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventGuardianSetUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGuardianSetUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oldIndex = reader.uint32(); + break; + case 2: + message.newIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventGuardianSetUpdate { + return { + oldIndex: isSet(object.oldIndex) ? Number(object.oldIndex) : 0, + newIndex: isSet(object.newIndex) ? Number(object.newIndex) : 0, + }; + }, + + toJSON(message: EventGuardianSetUpdate): unknown { + const obj: any = {}; + message.oldIndex !== undefined && (obj.oldIndex = Math.round(message.oldIndex)); + message.newIndex !== undefined && (obj.newIndex = Math.round(message.newIndex)); + return obj; + }, + + fromPartial, I>>(object: I): EventGuardianSetUpdate { + const message = createBaseEventGuardianSetUpdate(); + message.oldIndex = object.oldIndex ?? 0; + message.newIndex = object.newIndex ?? 0; + return message; + }, +}; + +function createBaseEventPostedMessage(): EventPostedMessage { + return { emitter: new Uint8Array(), sequence: 0, nonce: 0, time: 0, payload: new Uint8Array() }; +} + +export const EventPostedMessage = { + encode(message: EventPostedMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.emitter.length !== 0) { + writer.uint32(10).bytes(message.emitter); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + if (message.nonce !== 0) { + writer.uint32(24).uint32(message.nonce); + } + if (message.time !== 0) { + writer.uint32(32).uint64(message.time); + } + if (message.payload.length !== 0) { + writer.uint32(42).bytes(message.payload); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventPostedMessage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventPostedMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.emitter = reader.bytes(); + break; + case 2: + message.sequence = longToNumber(reader.uint64() as Long); + break; + case 3: + message.nonce = reader.uint32(); + break; + case 4: + message.time = longToNumber(reader.uint64() as Long); + break; + case 5: + message.payload = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventPostedMessage { + return { + emitter: isSet(object.emitter) ? bytesFromBase64(object.emitter) : new Uint8Array(), + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + nonce: isSet(object.nonce) ? Number(object.nonce) : 0, + time: isSet(object.time) ? Number(object.time) : 0, + payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(), + }; + }, + + toJSON(message: EventPostedMessage): unknown { + const obj: any = {}; + message.emitter !== undefined + && (obj.emitter = base64FromBytes(message.emitter !== undefined ? message.emitter : new Uint8Array())); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + message.nonce !== undefined && (obj.nonce = Math.round(message.nonce)); + message.time !== undefined && (obj.time = Math.round(message.time)); + message.payload !== undefined + && (obj.payload = base64FromBytes(message.payload !== undefined ? message.payload : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): EventPostedMessage { + const message = createBaseEventPostedMessage(); + message.emitter = object.emitter ?? new Uint8Array(); + message.sequence = object.sequence ?? 0; + message.nonce = object.nonce ?? 0; + message.time = object.time ?? 0; + message.payload = object.payload ?? new Uint8Array(); + return message; + }, +}; + +function createBaseEventGuardianRegistered(): EventGuardianRegistered { + return { guardianKey: new Uint8Array(), validatorKey: new Uint8Array() }; +} + +export const EventGuardianRegistered = { + encode(message: EventGuardianRegistered, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.guardianKey.length !== 0) { + writer.uint32(10).bytes(message.guardianKey); + } + if (message.validatorKey.length !== 0) { + writer.uint32(18).bytes(message.validatorKey); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventGuardianRegistered { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventGuardianRegistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianKey = reader.bytes(); + break; + case 2: + message.validatorKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventGuardianRegistered { + return { + guardianKey: isSet(object.guardianKey) ? bytesFromBase64(object.guardianKey) : new Uint8Array(), + validatorKey: isSet(object.validatorKey) ? bytesFromBase64(object.validatorKey) : new Uint8Array(), + }; + }, + + toJSON(message: EventGuardianRegistered): unknown { + const obj: any = {}; + message.guardianKey !== undefined + && (obj.guardianKey = base64FromBytes( + message.guardianKey !== undefined ? message.guardianKey : new Uint8Array(), + )); + message.validatorKey !== undefined + && (obj.validatorKey = base64FromBytes( + message.validatorKey !== undefined ? message.validatorKey : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): EventGuardianRegistered { + const message = createBaseEventGuardianRegistered(); + message.guardianKey = object.guardianKey ?? new Uint8Array(); + message.validatorKey = object.validatorKey ?? new Uint8Array(); + return message; + }, +}; + +function createBaseEventConsensusSetUpdate(): EventConsensusSetUpdate { + return { oldIndex: 0, newIndex: 0 }; +} + +export const EventConsensusSetUpdate = { + encode(message: EventConsensusSetUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.oldIndex !== 0) { + writer.uint32(8).uint32(message.oldIndex); + } + if (message.newIndex !== 0) { + writer.uint32(16).uint32(message.newIndex); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventConsensusSetUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventConsensusSetUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oldIndex = reader.uint32(); + break; + case 2: + message.newIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventConsensusSetUpdate { + return { + oldIndex: isSet(object.oldIndex) ? Number(object.oldIndex) : 0, + newIndex: isSet(object.newIndex) ? Number(object.newIndex) : 0, + }; + }, + + toJSON(message: EventConsensusSetUpdate): unknown { + const obj: any = {}; + message.oldIndex !== undefined && (obj.oldIndex = Math.round(message.oldIndex)); + message.newIndex !== undefined && (obj.newIndex = Math.round(message.newIndex)); + return obj; + }, + + fromPartial, I>>(object: I): EventConsensusSetUpdate { + const message = createBaseEventConsensusSetUpdate(); + message.oldIndex = object.oldIndex ?? 0; + message.newIndex = object.newIndex ?? 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/genesis.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/genesis.ts new file mode 100644 index 0000000000..f4b87bc01c --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/genesis.ts @@ -0,0 +1,233 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Config } from "./config"; +import { ConsensusGuardianSetIndex } from "./consensus_guardian_set_index"; +import { + GuardianSet, + GuardianValidator, + IbcComposabilityMwContract, + ValidatorAllowedAddress, + WasmInstantiateAllowedContractCodeId, +} from "./guardian"; +import { ReplayProtection } from "./replay_protection"; +import { SequenceCounter } from "./sequence_counter"; + +export const protobufPackage = "wormchain.wormhole"; + +/** GenesisState defines the wormhole module's genesis state. */ +export interface GenesisState { + guardianSetList: GuardianSet[]; + config: Config | undefined; + replayProtectionList: ReplayProtection[]; + sequenceCounterList: SequenceCounter[]; + consensusGuardianSetIndex: ConsensusGuardianSetIndex | undefined; + guardianValidatorList: GuardianValidator[]; + allowedAddresses: ValidatorAllowedAddress[]; + wasmInstantiateAllowlist: WasmInstantiateAllowedContractCodeId[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + ibcComposabilityMwContract: IbcComposabilityMwContract | undefined; +} + +function createBaseGenesisState(): GenesisState { + return { + guardianSetList: [], + config: undefined, + replayProtectionList: [], + sequenceCounterList: [], + consensusGuardianSetIndex: undefined, + guardianValidatorList: [], + allowedAddresses: [], + wasmInstantiateAllowlist: [], + ibcComposabilityMwContract: undefined, + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.guardianSetList) { + GuardianSet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.config !== undefined) { + Config.encode(message.config, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.replayProtectionList) { + ReplayProtection.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.sequenceCounterList) { + SequenceCounter.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.consensusGuardianSetIndex !== undefined) { + ConsensusGuardianSetIndex.encode(message.consensusGuardianSetIndex, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.guardianValidatorList) { + GuardianValidator.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.allowedAddresses) { + ValidatorAllowedAddress.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.wasmInstantiateAllowlist) { + WasmInstantiateAllowedContractCodeId.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.ibcComposabilityMwContract !== undefined) { + IbcComposabilityMwContract.encode(message.ibcComposabilityMwContract, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianSetList.push(GuardianSet.decode(reader, reader.uint32())); + break; + case 2: + message.config = Config.decode(reader, reader.uint32()); + break; + case 3: + message.replayProtectionList.push(ReplayProtection.decode(reader, reader.uint32())); + break; + case 4: + message.sequenceCounterList.push(SequenceCounter.decode(reader, reader.uint32())); + break; + case 5: + message.consensusGuardianSetIndex = ConsensusGuardianSetIndex.decode(reader, reader.uint32()); + break; + case 6: + message.guardianValidatorList.push(GuardianValidator.decode(reader, reader.uint32())); + break; + case 7: + message.allowedAddresses.push(ValidatorAllowedAddress.decode(reader, reader.uint32())); + break; + case 8: + message.wasmInstantiateAllowlist.push(WasmInstantiateAllowedContractCodeId.decode(reader, reader.uint32())); + break; + case 9: + message.ibcComposabilityMwContract = IbcComposabilityMwContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + guardianSetList: Array.isArray(object?.guardianSetList) + ? object.guardianSetList.map((e: any) => GuardianSet.fromJSON(e)) + : [], + config: isSet(object.config) ? Config.fromJSON(object.config) : undefined, + replayProtectionList: Array.isArray(object?.replayProtectionList) + ? object.replayProtectionList.map((e: any) => ReplayProtection.fromJSON(e)) + : [], + sequenceCounterList: Array.isArray(object?.sequenceCounterList) + ? object.sequenceCounterList.map((e: any) => SequenceCounter.fromJSON(e)) + : [], + consensusGuardianSetIndex: isSet(object.consensusGuardianSetIndex) + ? ConsensusGuardianSetIndex.fromJSON(object.consensusGuardianSetIndex) + : undefined, + guardianValidatorList: Array.isArray(object?.guardianValidatorList) + ? object.guardianValidatorList.map((e: any) => GuardianValidator.fromJSON(e)) + : [], + allowedAddresses: Array.isArray(object?.allowedAddresses) + ? object.allowedAddresses.map((e: any) => ValidatorAllowedAddress.fromJSON(e)) + : [], + wasmInstantiateAllowlist: Array.isArray(object?.wasmInstantiateAllowlist) + ? object.wasmInstantiateAllowlist.map((e: any) => WasmInstantiateAllowedContractCodeId.fromJSON(e)) + : [], + ibcComposabilityMwContract: isSet(object.ibcComposabilityMwContract) + ? IbcComposabilityMwContract.fromJSON(object.ibcComposabilityMwContract) + : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.guardianSetList) { + obj.guardianSetList = message.guardianSetList.map((e) => e ? GuardianSet.toJSON(e) : undefined); + } else { + obj.guardianSetList = []; + } + message.config !== undefined && (obj.config = message.config ? Config.toJSON(message.config) : undefined); + if (message.replayProtectionList) { + obj.replayProtectionList = message.replayProtectionList.map((e) => e ? ReplayProtection.toJSON(e) : undefined); + } else { + obj.replayProtectionList = []; + } + if (message.sequenceCounterList) { + obj.sequenceCounterList = message.sequenceCounterList.map((e) => e ? SequenceCounter.toJSON(e) : undefined); + } else { + obj.sequenceCounterList = []; + } + message.consensusGuardianSetIndex !== undefined + && (obj.consensusGuardianSetIndex = message.consensusGuardianSetIndex + ? ConsensusGuardianSetIndex.toJSON(message.consensusGuardianSetIndex) + : undefined); + if (message.guardianValidatorList) { + obj.guardianValidatorList = message.guardianValidatorList.map((e) => e ? GuardianValidator.toJSON(e) : undefined); + } else { + obj.guardianValidatorList = []; + } + if (message.allowedAddresses) { + obj.allowedAddresses = message.allowedAddresses.map((e) => e ? ValidatorAllowedAddress.toJSON(e) : undefined); + } else { + obj.allowedAddresses = []; + } + if (message.wasmInstantiateAllowlist) { + obj.wasmInstantiateAllowlist = message.wasmInstantiateAllowlist.map((e) => + e ? WasmInstantiateAllowedContractCodeId.toJSON(e) : undefined + ); + } else { + obj.wasmInstantiateAllowlist = []; + } + message.ibcComposabilityMwContract !== undefined + && (obj.ibcComposabilityMwContract = message.ibcComposabilityMwContract + ? IbcComposabilityMwContract.toJSON(message.ibcComposabilityMwContract) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.guardianSetList = object.guardianSetList?.map((e) => GuardianSet.fromPartial(e)) || []; + message.config = (object.config !== undefined && object.config !== null) + ? Config.fromPartial(object.config) + : undefined; + message.replayProtectionList = object.replayProtectionList?.map((e) => ReplayProtection.fromPartial(e)) || []; + message.sequenceCounterList = object.sequenceCounterList?.map((e) => SequenceCounter.fromPartial(e)) || []; + message.consensusGuardianSetIndex = + (object.consensusGuardianSetIndex !== undefined && object.consensusGuardianSetIndex !== null) + ? ConsensusGuardianSetIndex.fromPartial(object.consensusGuardianSetIndex) + : undefined; + message.guardianValidatorList = object.guardianValidatorList?.map((e) => GuardianValidator.fromPartial(e)) || []; + message.allowedAddresses = object.allowedAddresses?.map((e) => ValidatorAllowedAddress.fromPartial(e)) || []; + message.wasmInstantiateAllowlist = + object.wasmInstantiateAllowlist?.map((e) => WasmInstantiateAllowedContractCodeId.fromPartial(e)) || []; + message.ibcComposabilityMwContract = + (object.ibcComposabilityMwContract !== undefined && object.ibcComposabilityMwContract !== null) + ? IbcComposabilityMwContract.fromPartial(object.ibcComposabilityMwContract) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/guardian.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/guardian.ts new file mode 100644 index 0000000000..262738432d --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/guardian.ts @@ -0,0 +1,473 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface GuardianKey { + key: Uint8Array; +} + +export interface GuardianValidator { + guardianKey: Uint8Array; + validatorAddr: Uint8Array; +} + +export interface GuardianSet { + index: number; + keys: Uint8Array[]; + expirationTime: number; +} + +export interface ValidatorAllowedAddress { + /** the validator/guardian that controls this entry */ + validatorAddress: string; + /** the allowlisted account */ + allowedAddress: string; + /** human readable name */ + name: string; +} + +export interface WasmInstantiateAllowedContractCodeId { + /** bech32 address of the contract that can call wasm instantiate without a VAA */ + contractAddress: string; + /** reference to the stored WASM code that can be instantiated */ + codeId: number; +} + +export interface IbcComposabilityMwContract { + /** + * bech32 address of the contract that is used by the ibc composability + * middleware + */ + contractAddress: string; +} + +function createBaseGuardianKey(): GuardianKey { + return { key: new Uint8Array() }; +} + +export const GuardianKey = { + encode(message: GuardianKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GuardianKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGuardianKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GuardianKey { + return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() }; + }, + + toJSON(message: GuardianKey): unknown { + const obj: any = {}; + message.key !== undefined + && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): GuardianKey { + const message = createBaseGuardianKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, +}; + +function createBaseGuardianValidator(): GuardianValidator { + return { guardianKey: new Uint8Array(), validatorAddr: new Uint8Array() }; +} + +export const GuardianValidator = { + encode(message: GuardianValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.guardianKey.length !== 0) { + writer.uint32(10).bytes(message.guardianKey); + } + if (message.validatorAddr.length !== 0) { + writer.uint32(18).bytes(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GuardianValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGuardianValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianKey = reader.bytes(); + break; + case 2: + message.validatorAddr = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GuardianValidator { + return { + guardianKey: isSet(object.guardianKey) ? bytesFromBase64(object.guardianKey) : new Uint8Array(), + validatorAddr: isSet(object.validatorAddr) ? bytesFromBase64(object.validatorAddr) : new Uint8Array(), + }; + }, + + toJSON(message: GuardianValidator): unknown { + const obj: any = {}; + message.guardianKey !== undefined + && (obj.guardianKey = base64FromBytes( + message.guardianKey !== undefined ? message.guardianKey : new Uint8Array(), + )); + message.validatorAddr !== undefined + && (obj.validatorAddr = base64FromBytes( + message.validatorAddr !== undefined ? message.validatorAddr : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>(object: I): GuardianValidator { + const message = createBaseGuardianValidator(); + message.guardianKey = object.guardianKey ?? new Uint8Array(); + message.validatorAddr = object.validatorAddr ?? new Uint8Array(); + return message; + }, +}; + +function createBaseGuardianSet(): GuardianSet { + return { index: 0, keys: [], expirationTime: 0 }; +} + +export const GuardianSet = { + encode(message: GuardianSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + for (const v of message.keys) { + writer.uint32(18).bytes(v!); + } + if (message.expirationTime !== 0) { + writer.uint32(24).uint64(message.expirationTime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GuardianSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGuardianSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.keys.push(reader.bytes()); + break; + case 3: + message.expirationTime = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GuardianSet { + return { + index: isSet(object.index) ? Number(object.index) : 0, + keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => bytesFromBase64(e)) : [], + expirationTime: isSet(object.expirationTime) ? Number(object.expirationTime) : 0, + }; + }, + + toJSON(message: GuardianSet): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = Math.round(message.index)); + if (message.keys) { + obj.keys = message.keys.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.keys = []; + } + message.expirationTime !== undefined && (obj.expirationTime = Math.round(message.expirationTime)); + return obj; + }, + + fromPartial, I>>(object: I): GuardianSet { + const message = createBaseGuardianSet(); + message.index = object.index ?? 0; + message.keys = object.keys?.map((e) => e) || []; + message.expirationTime = object.expirationTime ?? 0; + return message; + }, +}; + +function createBaseValidatorAllowedAddress(): ValidatorAllowedAddress { + return { validatorAddress: "", allowedAddress: "", name: "" }; +} + +export const ValidatorAllowedAddress = { + encode(message: ValidatorAllowedAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.allowedAddress !== "") { + writer.uint32(18).string(message.allowedAddress); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAllowedAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorAllowedAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.allowedAddress = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorAllowedAddress { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + allowedAddress: isSet(object.allowedAddress) ? String(object.allowedAddress) : "", + name: isSet(object.name) ? String(object.name) : "", + }; + }, + + toJSON(message: ValidatorAllowedAddress): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.allowedAddress !== undefined && (obj.allowedAddress = message.allowedAddress); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>(object: I): ValidatorAllowedAddress { + const message = createBaseValidatorAllowedAddress(); + message.validatorAddress = object.validatorAddress ?? ""; + message.allowedAddress = object.allowedAddress ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseWasmInstantiateAllowedContractCodeId(): WasmInstantiateAllowedContractCodeId { + return { contractAddress: "", codeId: 0 }; +} + +export const WasmInstantiateAllowedContractCodeId = { + encode(message: WasmInstantiateAllowedContractCodeId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.codeId !== 0) { + writer.uint32(16).uint64(message.codeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WasmInstantiateAllowedContractCodeId { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWasmInstantiateAllowedContractCodeId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.codeId = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WasmInstantiateAllowedContractCodeId { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + }; + }, + + toJSON(message: WasmInstantiateAllowedContractCodeId): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): WasmInstantiateAllowedContractCodeId { + const message = createBaseWasmInstantiateAllowedContractCodeId(); + message.contractAddress = object.contractAddress ?? ""; + message.codeId = object.codeId ?? 0; + return message; + }, +}; + +function createBaseIbcComposabilityMwContract(): IbcComposabilityMwContract { + return { contractAddress: "" }; +} + +export const IbcComposabilityMwContract = { + encode(message: IbcComposabilityMwContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IbcComposabilityMwContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIbcComposabilityMwContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IbcComposabilityMwContract { + return { contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" }; + }, + + toJSON(message: IbcComposabilityMwContract): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + + fromPartial, I>>(object: I): IbcComposabilityMwContract { + const message = createBaseIbcComposabilityMwContract(); + message.contractAddress = object.contractAddress ?? ""; + 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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/query.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/query.ts new file mode 100644 index 0000000000..06e235647e --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/query.ts @@ -0,0 +1,2001 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../cosmos/base/query/v1beta1/pagination"; +import { Config } from "./config"; +import { ConsensusGuardianSetIndex } from "./consensus_guardian_set_index"; +import { + GuardianSet, + GuardianValidator, + ValidatorAllowedAddress, + WasmInstantiateAllowedContractCodeId, +} from "./guardian"; +import { ReplayProtection } from "./replay_protection"; +import { SequenceCounter } from "./sequence_counter"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface QueryAllValidatorAllowlist { + pagination: PageRequest | undefined; +} + +/** all allowlisted entries by all validators */ +export interface QueryAllValidatorAllowlistResponse { + allowlist: ValidatorAllowedAddress[]; + pagination: PageResponse | undefined; +} + +export interface QueryValidatorAllowlist { + validatorAddress: string; + pagination: PageRequest | undefined; +} + +/** all allowlisted entries by a specific validator */ +export interface QueryValidatorAllowlistResponse { + validatorAddress: string; + allowlist: ValidatorAllowedAddress[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetGuardianSetRequest { + index: number; +} + +export interface QueryGetGuardianSetResponse { + GuardianSet: GuardianSet | undefined; +} + +export interface QueryAllGuardianSetRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllGuardianSetResponse { + GuardianSet: GuardianSet[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetConfigRequest { +} + +export interface QueryGetConfigResponse { + Config: Config | undefined; +} + +export interface QueryGetReplayProtectionRequest { + index: string; +} + +export interface QueryGetReplayProtectionResponse { + replayProtection: ReplayProtection | undefined; +} + +export interface QueryAllReplayProtectionRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllReplayProtectionResponse { + replayProtection: ReplayProtection[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetSequenceCounterRequest { + index: string; +} + +export interface QueryGetSequenceCounterResponse { + sequenceCounter: SequenceCounter | undefined; +} + +export interface QueryAllSequenceCounterRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllSequenceCounterResponse { + sequenceCounter: SequenceCounter[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetConsensusGuardianSetIndexRequest { +} + +export interface QueryGetConsensusGuardianSetIndexResponse { + ConsensusGuardianSetIndex: ConsensusGuardianSetIndex | undefined; +} + +export interface QueryGetGuardianValidatorRequest { + guardianKey: Uint8Array; +} + +export interface QueryGetGuardianValidatorResponse { + guardianValidator: GuardianValidator | undefined; +} + +export interface QueryAllGuardianValidatorRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllGuardianValidatorResponse { + guardianValidator: GuardianValidator[]; + pagination: PageResponse | undefined; +} + +export interface QueryLatestGuardianSetIndexRequest { +} + +export interface QueryLatestGuardianSetIndexResponse { + latestGuardianSetIndex: number; +} + +export interface QueryIbcComposabilityMwContractRequest { +} + +export interface QueryIbcComposabilityMwContractResponse { + contractAddress: string; +} + +export interface QueryAllWasmInstantiateAllowlist { + pagination: PageRequest | undefined; +} + +/** all allowlisted entries by all validators */ +export interface QueryAllWasmInstantiateAllowlistResponse { + allowlist: WasmInstantiateAllowedContractCodeId[]; + pagination: PageResponse | undefined; +} + +function createBaseQueryAllValidatorAllowlist(): QueryAllValidatorAllowlist { + return { pagination: undefined }; +} + +export const QueryAllValidatorAllowlist = { + encode(message: QueryAllValidatorAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllValidatorAllowlist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllValidatorAllowlist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllValidatorAllowlist { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllValidatorAllowlist): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryAllValidatorAllowlist { + const message = createBaseQueryAllValidatorAllowlist(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllValidatorAllowlistResponse(): QueryAllValidatorAllowlistResponse { + return { allowlist: [], pagination: undefined }; +} + +export const QueryAllValidatorAllowlistResponse = { + encode(message: QueryAllValidatorAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowlist) { + ValidatorAllowedAddress.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllValidatorAllowlistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllValidatorAllowlistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowlist.push(ValidatorAllowedAddress.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllValidatorAllowlistResponse { + return { + allowlist: Array.isArray(object?.allowlist) + ? object.allowlist.map((e: any) => ValidatorAllowedAddress.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllValidatorAllowlistResponse): unknown { + const obj: any = {}; + if (message.allowlist) { + obj.allowlist = message.allowlist.map((e) => e ? ValidatorAllowedAddress.toJSON(e) : undefined); + } else { + obj.allowlist = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllValidatorAllowlistResponse { + const message = createBaseQueryAllValidatorAllowlistResponse(); + message.allowlist = object.allowlist?.map((e) => ValidatorAllowedAddress.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryValidatorAllowlist(): QueryValidatorAllowlist { + return { validatorAddress: "", pagination: undefined }; +} + +export const QueryValidatorAllowlist = { + encode(message: QueryValidatorAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorAllowlist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorAllowlist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorAllowlist { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryValidatorAllowlist): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryValidatorAllowlist { + const message = createBaseQueryValidatorAllowlist(); + message.validatorAddress = object.validatorAddress ?? ""; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryValidatorAllowlistResponse(): QueryValidatorAllowlistResponse { + return { validatorAddress: "", allowlist: [], pagination: undefined }; +} + +export const QueryValidatorAllowlistResponse = { + encode(message: QueryValidatorAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.allowlist) { + ValidatorAllowedAddress.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorAllowlistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorAllowlistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.allowlist.push(ValidatorAllowedAddress.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorAllowlistResponse { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + allowlist: Array.isArray(object?.allowlist) + ? object.allowlist.map((e: any) => ValidatorAllowedAddress.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryValidatorAllowlistResponse): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.allowlist) { + obj.allowlist = message.allowlist.map((e) => e ? ValidatorAllowedAddress.toJSON(e) : undefined); + } else { + obj.allowlist = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryValidatorAllowlistResponse { + const message = createBaseQueryValidatorAllowlistResponse(); + message.validatorAddress = object.validatorAddress ?? ""; + message.allowlist = object.allowlist?.map((e) => ValidatorAllowedAddress.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetGuardianSetRequest(): QueryGetGuardianSetRequest { + return { index: 0 }; +} + +export const QueryGetGuardianSetRequest = { + encode(message: QueryGetGuardianSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetGuardianSetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetGuardianSetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetGuardianSetRequest { + return { index: isSet(object.index) ? Number(object.index) : 0 }; + }, + + toJSON(message: QueryGetGuardianSetRequest): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = Math.round(message.index)); + return obj; + }, + + fromPartial, I>>(object: I): QueryGetGuardianSetRequest { + const message = createBaseQueryGetGuardianSetRequest(); + message.index = object.index ?? 0; + return message; + }, +}; + +function createBaseQueryGetGuardianSetResponse(): QueryGetGuardianSetResponse { + return { GuardianSet: undefined }; +} + +export const QueryGetGuardianSetResponse = { + encode(message: QueryGetGuardianSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.GuardianSet !== undefined) { + GuardianSet.encode(message.GuardianSet, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetGuardianSetResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetGuardianSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.GuardianSet = GuardianSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetGuardianSetResponse { + return { GuardianSet: isSet(object.GuardianSet) ? GuardianSet.fromJSON(object.GuardianSet) : undefined }; + }, + + toJSON(message: QueryGetGuardianSetResponse): unknown { + const obj: any = {}; + message.GuardianSet !== undefined + && (obj.GuardianSet = message.GuardianSet ? GuardianSet.toJSON(message.GuardianSet) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryGetGuardianSetResponse { + const message = createBaseQueryGetGuardianSetResponse(); + message.GuardianSet = (object.GuardianSet !== undefined && object.GuardianSet !== null) + ? GuardianSet.fromPartial(object.GuardianSet) + : undefined; + return message; + }, +}; + +function createBaseQueryAllGuardianSetRequest(): QueryAllGuardianSetRequest { + return { pagination: undefined }; +} + +export const QueryAllGuardianSetRequest = { + encode(message: QueryAllGuardianSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllGuardianSetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGuardianSetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllGuardianSetRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllGuardianSetRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryAllGuardianSetRequest { + const message = createBaseQueryAllGuardianSetRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllGuardianSetResponse(): QueryAllGuardianSetResponse { + return { GuardianSet: [], pagination: undefined }; +} + +export const QueryAllGuardianSetResponse = { + encode(message: QueryAllGuardianSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.GuardianSet) { + GuardianSet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllGuardianSetResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGuardianSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.GuardianSet.push(GuardianSet.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllGuardianSetResponse { + return { + GuardianSet: Array.isArray(object?.GuardianSet) + ? object.GuardianSet.map((e: any) => GuardianSet.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllGuardianSetResponse): unknown { + const obj: any = {}; + if (message.GuardianSet) { + obj.GuardianSet = message.GuardianSet.map((e) => e ? GuardianSet.toJSON(e) : undefined); + } else { + obj.GuardianSet = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryAllGuardianSetResponse { + const message = createBaseQueryAllGuardianSetResponse(); + message.GuardianSet = object.GuardianSet?.map((e) => GuardianSet.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetConfigRequest(): QueryGetConfigRequest { + return {}; +} + +export const QueryGetConfigRequest = { + encode(_: QueryGetConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetConfigRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryGetConfigRequest { + return {}; + }, + + toJSON(_: QueryGetConfigRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): QueryGetConfigRequest { + const message = createBaseQueryGetConfigRequest(); + return message; + }, +}; + +function createBaseQueryGetConfigResponse(): QueryGetConfigResponse { + return { Config: undefined }; +} + +export const QueryGetConfigResponse = { + encode(message: QueryGetConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.Config !== undefined) { + Config.encode(message.Config, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetConfigResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.Config = Config.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetConfigResponse { + return { Config: isSet(object.Config) ? Config.fromJSON(object.Config) : undefined }; + }, + + toJSON(message: QueryGetConfigResponse): unknown { + const obj: any = {}; + message.Config !== undefined && (obj.Config = message.Config ? Config.toJSON(message.Config) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): QueryGetConfigResponse { + const message = createBaseQueryGetConfigResponse(); + message.Config = (object.Config !== undefined && object.Config !== null) + ? Config.fromPartial(object.Config) + : undefined; + return message; + }, +}; + +function createBaseQueryGetReplayProtectionRequest(): QueryGetReplayProtectionRequest { + return { index: "" }; +} + +export const QueryGetReplayProtectionRequest = { + encode(message: QueryGetReplayProtectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetReplayProtectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetReplayProtectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetReplayProtectionRequest { + return { index: isSet(object.index) ? String(object.index) : "" }; + }, + + toJSON(message: QueryGetReplayProtectionRequest): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetReplayProtectionRequest { + const message = createBaseQueryGetReplayProtectionRequest(); + message.index = object.index ?? ""; + return message; + }, +}; + +function createBaseQueryGetReplayProtectionResponse(): QueryGetReplayProtectionResponse { + return { replayProtection: undefined }; +} + +export const QueryGetReplayProtectionResponse = { + encode(message: QueryGetReplayProtectionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.replayProtection !== undefined) { + ReplayProtection.encode(message.replayProtection, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetReplayProtectionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetReplayProtectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.replayProtection = ReplayProtection.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetReplayProtectionResponse { + return { + replayProtection: isSet(object.replayProtection) ? ReplayProtection.fromJSON(object.replayProtection) : undefined, + }; + }, + + toJSON(message: QueryGetReplayProtectionResponse): unknown { + const obj: any = {}; + message.replayProtection !== undefined && (obj.replayProtection = message.replayProtection + ? ReplayProtection.toJSON(message.replayProtection) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetReplayProtectionResponse { + const message = createBaseQueryGetReplayProtectionResponse(); + message.replayProtection = (object.replayProtection !== undefined && object.replayProtection !== null) + ? ReplayProtection.fromPartial(object.replayProtection) + : undefined; + return message; + }, +}; + +function createBaseQueryAllReplayProtectionRequest(): QueryAllReplayProtectionRequest { + return { pagination: undefined }; +} + +export const QueryAllReplayProtectionRequest = { + encode(message: QueryAllReplayProtectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllReplayProtectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllReplayProtectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllReplayProtectionRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllReplayProtectionRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllReplayProtectionRequest { + const message = createBaseQueryAllReplayProtectionRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllReplayProtectionResponse(): QueryAllReplayProtectionResponse { + return { replayProtection: [], pagination: undefined }; +} + +export const QueryAllReplayProtectionResponse = { + encode(message: QueryAllReplayProtectionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.replayProtection) { + ReplayProtection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllReplayProtectionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllReplayProtectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.replayProtection.push(ReplayProtection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllReplayProtectionResponse { + return { + replayProtection: Array.isArray(object?.replayProtection) + ? object.replayProtection.map((e: any) => ReplayProtection.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllReplayProtectionResponse): unknown { + const obj: any = {}; + if (message.replayProtection) { + obj.replayProtection = message.replayProtection.map((e) => e ? ReplayProtection.toJSON(e) : undefined); + } else { + obj.replayProtection = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllReplayProtectionResponse { + const message = createBaseQueryAllReplayProtectionResponse(); + message.replayProtection = object.replayProtection?.map((e) => ReplayProtection.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetSequenceCounterRequest(): QueryGetSequenceCounterRequest { + return { index: "" }; +} + +export const QueryGetSequenceCounterRequest = { + encode(message: QueryGetSequenceCounterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetSequenceCounterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetSequenceCounterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetSequenceCounterRequest { + return { index: isSet(object.index) ? String(object.index) : "" }; + }, + + toJSON(message: QueryGetSequenceCounterRequest): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetSequenceCounterRequest { + const message = createBaseQueryGetSequenceCounterRequest(); + message.index = object.index ?? ""; + return message; + }, +}; + +function createBaseQueryGetSequenceCounterResponse(): QueryGetSequenceCounterResponse { + return { sequenceCounter: undefined }; +} + +export const QueryGetSequenceCounterResponse = { + encode(message: QueryGetSequenceCounterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sequenceCounter !== undefined) { + SequenceCounter.encode(message.sequenceCounter, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetSequenceCounterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetSequenceCounterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequenceCounter = SequenceCounter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetSequenceCounterResponse { + return { + sequenceCounter: isSet(object.sequenceCounter) ? SequenceCounter.fromJSON(object.sequenceCounter) : undefined, + }; + }, + + toJSON(message: QueryGetSequenceCounterResponse): unknown { + const obj: any = {}; + message.sequenceCounter !== undefined + && (obj.sequenceCounter = message.sequenceCounter ? SequenceCounter.toJSON(message.sequenceCounter) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetSequenceCounterResponse { + const message = createBaseQueryGetSequenceCounterResponse(); + message.sequenceCounter = (object.sequenceCounter !== undefined && object.sequenceCounter !== null) + ? SequenceCounter.fromPartial(object.sequenceCounter) + : undefined; + return message; + }, +}; + +function createBaseQueryAllSequenceCounterRequest(): QueryAllSequenceCounterRequest { + return { pagination: undefined }; +} + +export const QueryAllSequenceCounterRequest = { + encode(message: QueryAllSequenceCounterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllSequenceCounterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllSequenceCounterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllSequenceCounterRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllSequenceCounterRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllSequenceCounterRequest { + const message = createBaseQueryAllSequenceCounterRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllSequenceCounterResponse(): QueryAllSequenceCounterResponse { + return { sequenceCounter: [], pagination: undefined }; +} + +export const QueryAllSequenceCounterResponse = { + encode(message: QueryAllSequenceCounterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.sequenceCounter) { + SequenceCounter.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllSequenceCounterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllSequenceCounterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequenceCounter.push(SequenceCounter.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllSequenceCounterResponse { + return { + sequenceCounter: Array.isArray(object?.sequenceCounter) + ? object.sequenceCounter.map((e: any) => SequenceCounter.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllSequenceCounterResponse): unknown { + const obj: any = {}; + if (message.sequenceCounter) { + obj.sequenceCounter = message.sequenceCounter.map((e) => e ? SequenceCounter.toJSON(e) : undefined); + } else { + obj.sequenceCounter = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllSequenceCounterResponse { + const message = createBaseQueryAllSequenceCounterResponse(); + message.sequenceCounter = object.sequenceCounter?.map((e) => SequenceCounter.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetConsensusGuardianSetIndexRequest(): QueryGetConsensusGuardianSetIndexRequest { + return {}; +} + +export const QueryGetConsensusGuardianSetIndexRequest = { + encode(_: QueryGetConsensusGuardianSetIndexRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetConsensusGuardianSetIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetConsensusGuardianSetIndexRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryGetConsensusGuardianSetIndexRequest { + return {}; + }, + + toJSON(_: QueryGetConsensusGuardianSetIndexRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): QueryGetConsensusGuardianSetIndexRequest { + const message = createBaseQueryGetConsensusGuardianSetIndexRequest(); + return message; + }, +}; + +function createBaseQueryGetConsensusGuardianSetIndexResponse(): QueryGetConsensusGuardianSetIndexResponse { + return { ConsensusGuardianSetIndex: undefined }; +} + +export const QueryGetConsensusGuardianSetIndexResponse = { + encode(message: QueryGetConsensusGuardianSetIndexResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.ConsensusGuardianSetIndex !== undefined) { + ConsensusGuardianSetIndex.encode(message.ConsensusGuardianSetIndex, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetConsensusGuardianSetIndexResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetConsensusGuardianSetIndexResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ConsensusGuardianSetIndex = ConsensusGuardianSetIndex.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetConsensusGuardianSetIndexResponse { + return { + ConsensusGuardianSetIndex: isSet(object.ConsensusGuardianSetIndex) + ? ConsensusGuardianSetIndex.fromJSON(object.ConsensusGuardianSetIndex) + : undefined, + }; + }, + + toJSON(message: QueryGetConsensusGuardianSetIndexResponse): unknown { + const obj: any = {}; + message.ConsensusGuardianSetIndex !== undefined + && (obj.ConsensusGuardianSetIndex = message.ConsensusGuardianSetIndex + ? ConsensusGuardianSetIndex.toJSON(message.ConsensusGuardianSetIndex) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetConsensusGuardianSetIndexResponse { + const message = createBaseQueryGetConsensusGuardianSetIndexResponse(); + message.ConsensusGuardianSetIndex = + (object.ConsensusGuardianSetIndex !== undefined && object.ConsensusGuardianSetIndex !== null) + ? ConsensusGuardianSetIndex.fromPartial(object.ConsensusGuardianSetIndex) + : undefined; + return message; + }, +}; + +function createBaseQueryGetGuardianValidatorRequest(): QueryGetGuardianValidatorRequest { + return { guardianKey: new Uint8Array() }; +} + +export const QueryGetGuardianValidatorRequest = { + encode(message: QueryGetGuardianValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.guardianKey.length !== 0) { + writer.uint32(10).bytes(message.guardianKey); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetGuardianValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetGuardianValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetGuardianValidatorRequest { + return { guardianKey: isSet(object.guardianKey) ? bytesFromBase64(object.guardianKey) : new Uint8Array() }; + }, + + toJSON(message: QueryGetGuardianValidatorRequest): unknown { + const obj: any = {}; + message.guardianKey !== undefined + && (obj.guardianKey = base64FromBytes( + message.guardianKey !== undefined ? message.guardianKey : new Uint8Array(), + )); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetGuardianValidatorRequest { + const message = createBaseQueryGetGuardianValidatorRequest(); + message.guardianKey = object.guardianKey ?? new Uint8Array(); + return message; + }, +}; + +function createBaseQueryGetGuardianValidatorResponse(): QueryGetGuardianValidatorResponse { + return { guardianValidator: undefined }; +} + +export const QueryGetGuardianValidatorResponse = { + encode(message: QueryGetGuardianValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.guardianValidator !== undefined) { + GuardianValidator.encode(message.guardianValidator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetGuardianValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetGuardianValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianValidator = GuardianValidator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetGuardianValidatorResponse { + return { + guardianValidator: isSet(object.guardianValidator) + ? GuardianValidator.fromJSON(object.guardianValidator) + : undefined, + }; + }, + + toJSON(message: QueryGetGuardianValidatorResponse): unknown { + const obj: any = {}; + message.guardianValidator !== undefined && (obj.guardianValidator = message.guardianValidator + ? GuardianValidator.toJSON(message.guardianValidator) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetGuardianValidatorResponse { + const message = createBaseQueryGetGuardianValidatorResponse(); + message.guardianValidator = (object.guardianValidator !== undefined && object.guardianValidator !== null) + ? GuardianValidator.fromPartial(object.guardianValidator) + : undefined; + return message; + }, +}; + +function createBaseQueryAllGuardianValidatorRequest(): QueryAllGuardianValidatorRequest { + return { pagination: undefined }; +} + +export const QueryAllGuardianValidatorRequest = { + encode(message: QueryAllGuardianValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllGuardianValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGuardianValidatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllGuardianValidatorRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllGuardianValidatorRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllGuardianValidatorRequest { + const message = createBaseQueryAllGuardianValidatorRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllGuardianValidatorResponse(): QueryAllGuardianValidatorResponse { + return { guardianValidator: [], pagination: undefined }; +} + +export const QueryAllGuardianValidatorResponse = { + encode(message: QueryAllGuardianValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.guardianValidator) { + GuardianValidator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllGuardianValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGuardianValidatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.guardianValidator.push(GuardianValidator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllGuardianValidatorResponse { + return { + guardianValidator: Array.isArray(object?.guardianValidator) + ? object.guardianValidator.map((e: any) => GuardianValidator.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllGuardianValidatorResponse): unknown { + const obj: any = {}; + if (message.guardianValidator) { + obj.guardianValidator = message.guardianValidator.map((e) => e ? GuardianValidator.toJSON(e) : undefined); + } else { + obj.guardianValidator = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllGuardianValidatorResponse { + const message = createBaseQueryAllGuardianValidatorResponse(); + message.guardianValidator = object.guardianValidator?.map((e) => GuardianValidator.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryLatestGuardianSetIndexRequest(): QueryLatestGuardianSetIndexRequest { + return {}; +} + +export const QueryLatestGuardianSetIndexRequest = { + encode(_: QueryLatestGuardianSetIndexRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLatestGuardianSetIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestGuardianSetIndexRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryLatestGuardianSetIndexRequest { + return {}; + }, + + toJSON(_: QueryLatestGuardianSetIndexRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): QueryLatestGuardianSetIndexRequest { + const message = createBaseQueryLatestGuardianSetIndexRequest(); + return message; + }, +}; + +function createBaseQueryLatestGuardianSetIndexResponse(): QueryLatestGuardianSetIndexResponse { + return { latestGuardianSetIndex: 0 }; +} + +export const QueryLatestGuardianSetIndexResponse = { + encode(message: QueryLatestGuardianSetIndexResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.latestGuardianSetIndex !== 0) { + writer.uint32(8).uint32(message.latestGuardianSetIndex); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryLatestGuardianSetIndexResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLatestGuardianSetIndexResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestGuardianSetIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryLatestGuardianSetIndexResponse { + return { latestGuardianSetIndex: isSet(object.latestGuardianSetIndex) ? Number(object.latestGuardianSetIndex) : 0 }; + }, + + toJSON(message: QueryLatestGuardianSetIndexResponse): unknown { + const obj: any = {}; + message.latestGuardianSetIndex !== undefined + && (obj.latestGuardianSetIndex = Math.round(message.latestGuardianSetIndex)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryLatestGuardianSetIndexResponse { + const message = createBaseQueryLatestGuardianSetIndexResponse(); + message.latestGuardianSetIndex = object.latestGuardianSetIndex ?? 0; + return message; + }, +}; + +function createBaseQueryIbcComposabilityMwContractRequest(): QueryIbcComposabilityMwContractRequest { + return {}; +} + +export const QueryIbcComposabilityMwContractRequest = { + encode(_: QueryIbcComposabilityMwContractRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryIbcComposabilityMwContractRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIbcComposabilityMwContractRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryIbcComposabilityMwContractRequest { + return {}; + }, + + toJSON(_: QueryIbcComposabilityMwContractRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): QueryIbcComposabilityMwContractRequest { + const message = createBaseQueryIbcComposabilityMwContractRequest(); + return message; + }, +}; + +function createBaseQueryIbcComposabilityMwContractResponse(): QueryIbcComposabilityMwContractResponse { + return { contractAddress: "" }; +} + +export const QueryIbcComposabilityMwContractResponse = { + encode(message: QueryIbcComposabilityMwContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryIbcComposabilityMwContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIbcComposabilityMwContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryIbcComposabilityMwContractResponse { + return { contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" }; + }, + + toJSON(message: QueryIbcComposabilityMwContractResponse): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryIbcComposabilityMwContractResponse { + const message = createBaseQueryIbcComposabilityMwContractResponse(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, +}; + +function createBaseQueryAllWasmInstantiateAllowlist(): QueryAllWasmInstantiateAllowlist { + return { pagination: undefined }; +} + +export const QueryAllWasmInstantiateAllowlist = { + encode(message: QueryAllWasmInstantiateAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllWasmInstantiateAllowlist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllWasmInstantiateAllowlist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllWasmInstantiateAllowlist { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllWasmInstantiateAllowlist): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllWasmInstantiateAllowlist { + const message = createBaseQueryAllWasmInstantiateAllowlist(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllWasmInstantiateAllowlistResponse(): QueryAllWasmInstantiateAllowlistResponse { + return { allowlist: [], pagination: undefined }; +} + +export const QueryAllWasmInstantiateAllowlistResponse = { + encode(message: QueryAllWasmInstantiateAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowlist) { + WasmInstantiateAllowedContractCodeId.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllWasmInstantiateAllowlistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllWasmInstantiateAllowlistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowlist.push(WasmInstantiateAllowedContractCodeId.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllWasmInstantiateAllowlistResponse { + return { + allowlist: Array.isArray(object?.allowlist) + ? object.allowlist.map((e: any) => WasmInstantiateAllowedContractCodeId.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllWasmInstantiateAllowlistResponse): unknown { + const obj: any = {}; + if (message.allowlist) { + obj.allowlist = message.allowlist.map((e) => e ? WasmInstantiateAllowedContractCodeId.toJSON(e) : undefined); + } else { + obj.allowlist = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllWasmInstantiateAllowlistResponse { + const message = createBaseQueryAllWasmInstantiateAllowlistResponse(); + message.allowlist = object.allowlist?.map((e) => WasmInstantiateAllowedContractCodeId.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a guardianSet by index. */ + GuardianSet(request: QueryGetGuardianSetRequest): Promise; + /** Queries a list of guardianSet items. */ + GuardianSetAll(request: QueryAllGuardianSetRequest): Promise; + /** Queries a config by index. */ + Config(request: QueryGetConfigRequest): Promise; + /** Queries a replayProtection by index. */ + ReplayProtection(request: QueryGetReplayProtectionRequest): Promise; + /** Queries a list of replayProtection items. */ + ReplayProtectionAll(request: QueryAllReplayProtectionRequest): Promise; + /** Queries a sequenceCounter by index. */ + SequenceCounter(request: QueryGetSequenceCounterRequest): Promise; + /** Queries a list of sequenceCounter items. */ + SequenceCounterAll(request: QueryAllSequenceCounterRequest): Promise; + /** Queries a ConsensusGuardianSetIndex by index. */ + ConsensusGuardianSetIndex( + request: QueryGetConsensusGuardianSetIndexRequest, + ): Promise; + /** Queries a GuardianValidator by index. */ + GuardianValidator(request: QueryGetGuardianValidatorRequest): Promise; + /** Queries a list of GuardianValidator items. */ + GuardianValidatorAll(request: QueryAllGuardianValidatorRequest): Promise; + /** Queries a list of LatestGuardianSetIndex items. */ + LatestGuardianSetIndex(request: QueryLatestGuardianSetIndexRequest): Promise; + AllowlistAll(request: QueryAllValidatorAllowlist): Promise; + Allowlist(request: QueryValidatorAllowlist): Promise; + IbcComposabilityMwContract( + request: QueryIbcComposabilityMwContractRequest, + ): Promise; + WasmInstantiateAllowlistAll( + request: QueryAllWasmInstantiateAllowlist, + ): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.GuardianSet = this.GuardianSet.bind(this); + this.GuardianSetAll = this.GuardianSetAll.bind(this); + this.Config = this.Config.bind(this); + this.ReplayProtection = this.ReplayProtection.bind(this); + this.ReplayProtectionAll = this.ReplayProtectionAll.bind(this); + this.SequenceCounter = this.SequenceCounter.bind(this); + this.SequenceCounterAll = this.SequenceCounterAll.bind(this); + this.ConsensusGuardianSetIndex = this.ConsensusGuardianSetIndex.bind(this); + this.GuardianValidator = this.GuardianValidator.bind(this); + this.GuardianValidatorAll = this.GuardianValidatorAll.bind(this); + this.LatestGuardianSetIndex = this.LatestGuardianSetIndex.bind(this); + this.AllowlistAll = this.AllowlistAll.bind(this); + this.Allowlist = this.Allowlist.bind(this); + this.IbcComposabilityMwContract = this.IbcComposabilityMwContract.bind(this); + this.WasmInstantiateAllowlistAll = this.WasmInstantiateAllowlistAll.bind(this); + } + GuardianSet(request: QueryGetGuardianSetRequest): Promise { + const data = QueryGetGuardianSetRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "GuardianSet", data); + return promise.then((data) => QueryGetGuardianSetResponse.decode(new _m0.Reader(data))); + } + + GuardianSetAll(request: QueryAllGuardianSetRequest): Promise { + const data = QueryAllGuardianSetRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "GuardianSetAll", data); + return promise.then((data) => QueryAllGuardianSetResponse.decode(new _m0.Reader(data))); + } + + Config(request: QueryGetConfigRequest): Promise { + const data = QueryGetConfigRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "Config", data); + return promise.then((data) => QueryGetConfigResponse.decode(new _m0.Reader(data))); + } + + ReplayProtection(request: QueryGetReplayProtectionRequest): Promise { + const data = QueryGetReplayProtectionRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "ReplayProtection", data); + return promise.then((data) => QueryGetReplayProtectionResponse.decode(new _m0.Reader(data))); + } + + ReplayProtectionAll(request: QueryAllReplayProtectionRequest): Promise { + const data = QueryAllReplayProtectionRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "ReplayProtectionAll", data); + return promise.then((data) => QueryAllReplayProtectionResponse.decode(new _m0.Reader(data))); + } + + SequenceCounter(request: QueryGetSequenceCounterRequest): Promise { + const data = QueryGetSequenceCounterRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "SequenceCounter", data); + return promise.then((data) => QueryGetSequenceCounterResponse.decode(new _m0.Reader(data))); + } + + SequenceCounterAll(request: QueryAllSequenceCounterRequest): Promise { + const data = QueryAllSequenceCounterRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "SequenceCounterAll", data); + return promise.then((data) => QueryAllSequenceCounterResponse.decode(new _m0.Reader(data))); + } + + ConsensusGuardianSetIndex( + request: QueryGetConsensusGuardianSetIndexRequest, + ): Promise { + const data = QueryGetConsensusGuardianSetIndexRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "ConsensusGuardianSetIndex", data); + return promise.then((data) => QueryGetConsensusGuardianSetIndexResponse.decode(new _m0.Reader(data))); + } + + GuardianValidator(request: QueryGetGuardianValidatorRequest): Promise { + const data = QueryGetGuardianValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "GuardianValidator", data); + return promise.then((data) => QueryGetGuardianValidatorResponse.decode(new _m0.Reader(data))); + } + + GuardianValidatorAll(request: QueryAllGuardianValidatorRequest): Promise { + const data = QueryAllGuardianValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "GuardianValidatorAll", data); + return promise.then((data) => QueryAllGuardianValidatorResponse.decode(new _m0.Reader(data))); + } + + LatestGuardianSetIndex(request: QueryLatestGuardianSetIndexRequest): Promise { + const data = QueryLatestGuardianSetIndexRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "LatestGuardianSetIndex", data); + return promise.then((data) => QueryLatestGuardianSetIndexResponse.decode(new _m0.Reader(data))); + } + + AllowlistAll(request: QueryAllValidatorAllowlist): Promise { + const data = QueryAllValidatorAllowlist.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "AllowlistAll", data); + return promise.then((data) => QueryAllValidatorAllowlistResponse.decode(new _m0.Reader(data))); + } + + Allowlist(request: QueryValidatorAllowlist): Promise { + const data = QueryValidatorAllowlist.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "Allowlist", data); + return promise.then((data) => QueryValidatorAllowlistResponse.decode(new _m0.Reader(data))); + } + + IbcComposabilityMwContract( + request: QueryIbcComposabilityMwContractRequest, + ): Promise { + const data = QueryIbcComposabilityMwContractRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "IbcComposabilityMwContract", data); + return promise.then((data) => QueryIbcComposabilityMwContractResponse.decode(new _m0.Reader(data))); + } + + WasmInstantiateAllowlistAll( + request: QueryAllWasmInstantiateAllowlist, + ): Promise { + const data = QueryAllWasmInstantiateAllowlist.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Query", "WasmInstantiateAllowlistAll", data); + return promise.then((data) => QueryAllWasmInstantiateAllowlistResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/replay_protection.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/replay_protection.ts new file mode 100644 index 0000000000..6a3dcc9c66 --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/replay_protection.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface ReplayProtection { + index: string; +} + +function createBaseReplayProtection(): ReplayProtection { + return { index: "" }; +} + +export const ReplayProtection = { + encode(message: ReplayProtection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReplayProtection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReplayProtection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReplayProtection { + return { index: isSet(object.index) ? String(object.index) : "" }; + }, + + toJSON(message: ReplayProtection): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial, I>>(object: I): ReplayProtection { + const message = createBaseReplayProtection(); + message.index = object.index ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/sequence_counter.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/sequence_counter.ts new file mode 100644 index 0000000000..fb7cdd6d0f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/sequence_counter.ts @@ -0,0 +1,115 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface SequenceCounter { + index: string; + sequence: number; +} + +function createBaseSequenceCounter(): SequenceCounter { + return { index: "", sequence: 0 }; +} + +export const SequenceCounter = { + encode(message: SequenceCounter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + if (message.sequence !== 0) { + writer.uint32(16).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SequenceCounter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSequenceCounter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + case 2: + message.sequence = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SequenceCounter { + return { + index: isSet(object.index) ? String(object.index) : "", + sequence: isSet(object.sequence) ? Number(object.sequence) : 0, + }; + }, + + toJSON(message: SequenceCounter): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + message.sequence !== undefined && (obj.sequence = Math.round(message.sequence)); + return obj; + }, + + fromPartial, I>>(object: I): SequenceCounter { + const message = createBaseSequenceCounter(); + message.index = object.index ?? ""; + message.sequence = object.sequence ?? 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"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/tx.ts b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/tx.ts new file mode 100644 index 0000000000..ea0f02334f --- /dev/null +++ b/wormchain/ts-sdk/src/modules/wormchain.wormhole/types/wormchain/wormhole/tx.ts @@ -0,0 +1,1586 @@ +//@ts-nocheck +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { GuardianSet } from "./guardian"; + +export const protobufPackage = "wormchain.wormhole"; + +export interface EmptyResponse { +} + +export interface MsgCreateAllowlistEntryRequest { + /** signer should be a guardian validator in a current set or future set. */ + signer: string; + /** the address to allowlist */ + address: string; + /** optional human readable name for the entry */ + name: string; +} + +export interface MsgDeleteAllowlistEntryRequest { + /** signer should be a guardian validator in a current set or future set. */ + signer: string; + /** the address allowlist to remove */ + address: string; +} + +export interface MsgAllowlistResponse { +} + +export interface MsgExecuteGovernanceVAA { + vaa: Uint8Array; + signer: string; +} + +export interface MsgExecuteGovernanceVAAResponse { +} + +export interface MsgRegisterAccountAsGuardian { + signer: string; + signature: Uint8Array; +} + +export interface MsgRegisterAccountAsGuardianResponse { +} + +/** Same as from x/wasmd but with vaa auth */ +export interface MsgStoreCode { + /** Signer is the that actor that signed the messages */ + signer: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * vaa must be governance msg with payload containing sha3 256 hash of + * `wasm_byte_code` + */ + vaa: Uint8Array; +} + +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: number; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} + +/** Same as from x/wasmd but with vaa auth */ +export interface MsgInstantiateContract { + /** Signer is the that actor that signed the messages */ + signer: string; + /** CodeID is the reference to the stored WASM code */ + codeId: number; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** + * vaa must be governance msg with payload containing keccak256 + * hash(hash(hash(BigEndian(CodeID)), Label), Msg) + */ + vaa: Uint8Array; +} + +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains base64-encoded bytes to returned from the contract */ + data: Uint8Array; +} + +export interface MsgAddWasmInstantiateAllowlist { + /** Signer is the actor that signed the messages */ + signer: string; + /** + * Address is the bech32 address of the contract that can call wasm + * instantiate without a VAA + */ + address: string; + /** CodeID is the reference to the stored WASM code that can be instantiated */ + codeId: number; + /** vaa is the WormchainAddWasmInstantiateAllowlist governance message */ + vaa: Uint8Array; +} + +export interface MsgDeleteWasmInstantiateAllowlist { + /** signer should be a guardian validator in a current set or future set. */ + signer: string; + /** the pair to remove */ + address: string; + codeId: number; + /** vaa is the WormchainDeleteWasmInstantiateAllowlist governance message */ + vaa: Uint8Array; +} + +export interface MsgWasmInstantiateAllowlistResponse { +} + +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the actor that signs the messages */ + signer: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: number; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; + /** + * vaa must be governance msg with payload containing keccak256 + * hash(hash(hash(BigEndian(CodeID)), Contract), Msg) + */ + vaa: Uint8Array; +} + +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} + +export interface MsgExecuteGatewayGovernanceVaa { + /** Sender is the actor that signs the messages */ + signer: string; + /** vaa must be governance msg with valid module, action, and payload */ + vaa: Uint8Array; +} + +/** GuardianSetUpdateProposal defines a guardian set update governance proposal */ +export interface MsgGuardianSetUpdateProposal { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + newGuardianSet: GuardianSet | undefined; +} + +/** + * GovernanceWormholeMessageProposal defines a governance proposal to emit a + * generic message in the governance message format. + */ +export interface MsgGovernanceWormholeMessageProposal { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + action: number; + module: Uint8Array; + targetChain: number; + payload: Uint8Array; +} + +function createBaseEmptyResponse(): EmptyResponse { + return {}; +} + +export const EmptyResponse = { + encode(_: EmptyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EmptyResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmptyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): EmptyResponse { + return {}; + }, + + toJSON(_: EmptyResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): EmptyResponse { + const message = createBaseEmptyResponse(); + return message; + }, +}; + +function createBaseMsgCreateAllowlistEntryRequest(): MsgCreateAllowlistEntryRequest { + return { signer: "", address: "", name: "" }; +} + +export const MsgCreateAllowlistEntryRequest = { + encode(message: MsgCreateAllowlistEntryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateAllowlistEntryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateAllowlistEntryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreateAllowlistEntryRequest { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + address: isSet(object.address) ? String(object.address) : "", + name: isSet(object.name) ? String(object.name) : "", + }; + }, + + toJSON(message: MsgCreateAllowlistEntryRequest): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.address !== undefined && (obj.address = message.address); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgCreateAllowlistEntryRequest { + const message = createBaseMsgCreateAllowlistEntryRequest(); + message.signer = object.signer ?? ""; + message.address = object.address ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseMsgDeleteAllowlistEntryRequest(): MsgDeleteAllowlistEntryRequest { + return { signer: "", address: "" }; +} + +export const MsgDeleteAllowlistEntryRequest = { + encode(message: MsgDeleteAllowlistEntryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteAllowlistEntryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteAllowlistEntryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDeleteAllowlistEntryRequest { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + address: isSet(object.address) ? String(object.address) : "", + }; + }, + + toJSON(message: MsgDeleteAllowlistEntryRequest): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgDeleteAllowlistEntryRequest { + const message = createBaseMsgDeleteAllowlistEntryRequest(); + message.signer = object.signer ?? ""; + message.address = object.address ?? ""; + return message; + }, +}; + +function createBaseMsgAllowlistResponse(): MsgAllowlistResponse { + return {}; +} + +export const MsgAllowlistResponse = { + encode(_: MsgAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAllowlistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAllowlistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgAllowlistResponse { + return {}; + }, + + toJSON(_: MsgAllowlistResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgAllowlistResponse { + const message = createBaseMsgAllowlistResponse(); + return message; + }, +}; + +function createBaseMsgExecuteGovernanceVAA(): MsgExecuteGovernanceVAA { + return { vaa: new Uint8Array(), signer: "" }; +} + +export const MsgExecuteGovernanceVAA = { + encode(message: MsgExecuteGovernanceVAA, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vaa.length !== 0) { + writer.uint32(10).bytes(message.vaa); + } + if (message.signer !== "") { + writer.uint32(18).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteGovernanceVAA { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteGovernanceVAA(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vaa = reader.bytes(); + break; + case 2: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteGovernanceVAA { + return { + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + signer: isSet(object.signer) ? String(object.signer) : "", + }; + }, + + toJSON(message: MsgExecuteGovernanceVAA): unknown { + const obj: any = {}; + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial, I>>(object: I): MsgExecuteGovernanceVAA { + const message = createBaseMsgExecuteGovernanceVAA(); + message.vaa = object.vaa ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, +}; + +function createBaseMsgExecuteGovernanceVAAResponse(): MsgExecuteGovernanceVAAResponse { + return {}; +} + +export const MsgExecuteGovernanceVAAResponse = { + encode(_: MsgExecuteGovernanceVAAResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteGovernanceVAAResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteGovernanceVAAResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgExecuteGovernanceVAAResponse { + return {}; + }, + + toJSON(_: MsgExecuteGovernanceVAAResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): MsgExecuteGovernanceVAAResponse { + const message = createBaseMsgExecuteGovernanceVAAResponse(); + return message; + }, +}; + +function createBaseMsgRegisterAccountAsGuardian(): MsgRegisterAccountAsGuardian { + return { signer: "", signature: new Uint8Array() }; +} + +export const MsgRegisterAccountAsGuardian = { + encode(message: MsgRegisterAccountAsGuardian, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccountAsGuardian { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAccountAsGuardian(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 3: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgRegisterAccountAsGuardian { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + }; + }, + + toJSON(message: MsgRegisterAccountAsGuardian): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgRegisterAccountAsGuardian { + const message = createBaseMsgRegisterAccountAsGuardian(); + message.signer = object.signer ?? ""; + message.signature = object.signature ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgRegisterAccountAsGuardianResponse(): MsgRegisterAccountAsGuardianResponse { + return {}; +} + +export const MsgRegisterAccountAsGuardianResponse = { + encode(_: MsgRegisterAccountAsGuardianResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterAccountAsGuardianResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAccountAsGuardianResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgRegisterAccountAsGuardianResponse { + return {}; + }, + + toJSON(_: MsgRegisterAccountAsGuardianResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgRegisterAccountAsGuardianResponse { + const message = createBaseMsgRegisterAccountAsGuardianResponse(); + return message; + }, +}; + +function createBaseMsgStoreCode(): MsgStoreCode { + return { signer: "", wasmByteCode: new Uint8Array(), vaa: new Uint8Array() }; +} + +export const MsgStoreCode = { + encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.vaa.length !== 0) { + writer.uint32(26).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 3: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgStoreCode { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgStoreCode): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.wasmByteCode !== undefined + && (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.signer = object.signer ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { codeId: 0, checksum: new Uint8Array() }; +} + +export const MsgStoreCodeResponse = { + encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeId !== 0) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgStoreCodeResponse { + return { + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + }; + }, + + toJSON(message: MsgStoreCodeResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.checksum !== undefined + && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId ?? 0; + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { signer: "", codeId: 0, label: "", msg: new Uint8Array(), vaa: new Uint8Array() }; +} + +export const MsgInstantiateContract = { + encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + if (message.vaa.length !== 0) { + writer.uint32(50).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 3: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgInstantiateContract { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgInstantiateContract): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.signer = object.signer ?? ""; + message.codeId = object.codeId ?? 0; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { address: "", data: new Uint8Array() }; +} + +export const MsgInstantiateContractResponse = { + encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgInstantiateContractResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + }; + }, + + toJSON(message: MsgInstantiateContractResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgAddWasmInstantiateAllowlist(): MsgAddWasmInstantiateAllowlist { + return { signer: "", address: "", codeId: 0, vaa: new Uint8Array() }; +} + +export const MsgAddWasmInstantiateAllowlist = { + encode(message: MsgAddWasmInstantiateAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); + } + if (message.vaa.length !== 0) { + writer.uint32(34).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAddWasmInstantiateAllowlist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddWasmInstantiateAllowlist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 4: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAddWasmInstantiateAllowlist { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + address: isSet(object.address) ? String(object.address) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgAddWasmInstantiateAllowlist): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.address !== undefined && (obj.address = message.address); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgAddWasmInstantiateAllowlist { + const message = createBaseMsgAddWasmInstantiateAllowlist(); + message.signer = object.signer ?? ""; + message.address = object.address ?? ""; + message.codeId = object.codeId ?? 0; + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgDeleteWasmInstantiateAllowlist(): MsgDeleteWasmInstantiateAllowlist { + return { signer: "", address: "", codeId: 0, vaa: new Uint8Array() }; +} + +export const MsgDeleteWasmInstantiateAllowlist = { + encode(message: MsgDeleteWasmInstantiateAllowlist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); + } + if (message.vaa.length !== 0) { + writer.uint32(34).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteWasmInstantiateAllowlist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteWasmInstantiateAllowlist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 4: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDeleteWasmInstantiateAllowlist { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + address: isSet(object.address) ? String(object.address) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgDeleteWasmInstantiateAllowlist): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.address !== undefined && (obj.address = message.address); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgDeleteWasmInstantiateAllowlist { + const message = createBaseMsgDeleteWasmInstantiateAllowlist(); + message.signer = object.signer ?? ""; + message.address = object.address ?? ""; + message.codeId = object.codeId ?? 0; + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgWasmInstantiateAllowlistResponse(): MsgWasmInstantiateAllowlistResponse { + return {}; +} + +export const MsgWasmInstantiateAllowlistResponse = { + encode(_: MsgWasmInstantiateAllowlistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWasmInstantiateAllowlistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWasmInstantiateAllowlistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgWasmInstantiateAllowlistResponse { + return {}; + }, + + toJSON(_: MsgWasmInstantiateAllowlistResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgWasmInstantiateAllowlistResponse { + const message = createBaseMsgWasmInstantiateAllowlistResponse(); + return message; + }, +}; + +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { signer: "", contract: "", codeId: 0, msg: new Uint8Array(), vaa: new Uint8Array() }; +} + +export const MsgMigrateContract = { + encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== 0) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + if (message.vaa.length !== 0) { + writer.uint32(50).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = longToNumber(reader.uint64() as Long); + break; + case 4: + message.msg = reader.bytes(); + break; + case 6: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContract { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + codeId: isSet(object.codeId) ? Number(object.codeId) : 0, + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgMigrateContract): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = Math.round(message.codeId)); + message.msg !== undefined + && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.signer = object.signer ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId ?? 0; + message.msg = object.msg ?? new Uint8Array(); + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { data: new Uint8Array() }; +} + +export const MsgMigrateContractResponse = { + encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContractResponse { + return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; + }, + + toJSON(message: MsgMigrateContractResponse): unknown { + const obj: any = {}; + message.data !== undefined + && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial, I>>(object: I): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgExecuteGatewayGovernanceVaa(): MsgExecuteGatewayGovernanceVaa { + return { signer: "", vaa: new Uint8Array() }; +} + +export const MsgExecuteGatewayGovernanceVaa = { + encode(message: MsgExecuteGatewayGovernanceVaa, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.vaa.length !== 0) { + writer.uint32(18).bytes(message.vaa); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteGatewayGovernanceVaa { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteGatewayGovernanceVaa(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.vaa = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteGatewayGovernanceVaa { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + vaa: isSet(object.vaa) ? bytesFromBase64(object.vaa) : new Uint8Array(), + }; + }, + + toJSON(message: MsgExecuteGatewayGovernanceVaa): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.vaa !== undefined + && (obj.vaa = base64FromBytes(message.vaa !== undefined ? message.vaa : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgExecuteGatewayGovernanceVaa { + const message = createBaseMsgExecuteGatewayGovernanceVaa(); + message.signer = object.signer ?? ""; + message.vaa = object.vaa ?? new Uint8Array(); + return message; + }, +}; + +function createBaseMsgGuardianSetUpdateProposal(): MsgGuardianSetUpdateProposal { + return { authority: "", newGuardianSet: undefined }; +} + +export const MsgGuardianSetUpdateProposal = { + encode(message: MsgGuardianSetUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.newGuardianSet !== undefined) { + GuardianSet.encode(message.newGuardianSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgGuardianSetUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGuardianSetUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.newGuardianSet = GuardianSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgGuardianSetUpdateProposal { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + newGuardianSet: isSet(object.newGuardianSet) ? GuardianSet.fromJSON(object.newGuardianSet) : undefined, + }; + }, + + toJSON(message: MsgGuardianSetUpdateProposal): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.newGuardianSet !== undefined + && (obj.newGuardianSet = message.newGuardianSet ? GuardianSet.toJSON(message.newGuardianSet) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): MsgGuardianSetUpdateProposal { + const message = createBaseMsgGuardianSetUpdateProposal(); + message.authority = object.authority ?? ""; + message.newGuardianSet = (object.newGuardianSet !== undefined && object.newGuardianSet !== null) + ? GuardianSet.fromPartial(object.newGuardianSet) + : undefined; + return message; + }, +}; + +function createBaseMsgGovernanceWormholeMessageProposal(): MsgGovernanceWormholeMessageProposal { + return { authority: "", action: 0, module: new Uint8Array(), targetChain: 0, payload: new Uint8Array() }; +} + +export const MsgGovernanceWormholeMessageProposal = { + encode(message: MsgGovernanceWormholeMessageProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.action !== 0) { + writer.uint32(16).uint32(message.action); + } + if (message.module.length !== 0) { + writer.uint32(26).bytes(message.module); + } + if (message.targetChain !== 0) { + writer.uint32(32).uint32(message.targetChain); + } + if (message.payload.length !== 0) { + writer.uint32(42).bytes(message.payload); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgGovernanceWormholeMessageProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGovernanceWormholeMessageProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.action = reader.uint32(); + break; + case 3: + message.module = reader.bytes(); + break; + case 4: + message.targetChain = reader.uint32(); + break; + case 5: + message.payload = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgGovernanceWormholeMessageProposal { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + action: isSet(object.action) ? Number(object.action) : 0, + module: isSet(object.module) ? bytesFromBase64(object.module) : new Uint8Array(), + targetChain: isSet(object.targetChain) ? Number(object.targetChain) : 0, + payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(), + }; + }, + + toJSON(message: MsgGovernanceWormholeMessageProposal): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.action !== undefined && (obj.action = Math.round(message.action)); + message.module !== undefined + && (obj.module = base64FromBytes(message.module !== undefined ? message.module : new Uint8Array())); + message.targetChain !== undefined && (obj.targetChain = Math.round(message.targetChain)); + message.payload !== undefined + && (obj.payload = base64FromBytes(message.payload !== undefined ? message.payload : new Uint8Array())); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgGovernanceWormholeMessageProposal { + const message = createBaseMsgGovernanceWormholeMessageProposal(); + message.authority = object.authority ?? ""; + message.action = object.action ?? 0; + message.module = object.module ?? new Uint8Array(); + message.targetChain = object.targetChain ?? 0; + message.payload = object.payload ?? new Uint8Array(); + return message; + }, +}; + +/** Msg defines the Msg service. */ +export interface Msg { + ExecuteGovernanceVAA(request: MsgExecuteGovernanceVAA): Promise; + RegisterAccountAsGuardian(request: MsgRegisterAccountAsGuardian): Promise; + CreateAllowlistEntry(request: MsgCreateAllowlistEntryRequest): Promise; + DeleteAllowlistEntry(request: MsgDeleteAllowlistEntryRequest): Promise; + /** StoreCode to submit Wasm code to the system */ + StoreCode(request: MsgStoreCode): Promise; + /** Instantiate creates a new smart contract instance for the given code id. */ + InstantiateContract(request: MsgInstantiateContract): Promise; + AddWasmInstantiateAllowlist(request: MsgAddWasmInstantiateAllowlist): Promise; + DeleteWasmInstantiateAllowlist( + request: MsgDeleteWasmInstantiateAllowlist, + ): Promise; + MigrateContract(request: MsgMigrateContract): Promise; + ExecuteGatewayGovernanceVaa(request: MsgExecuteGatewayGovernanceVaa): Promise; + /** GuardianSetUpdateProposal processes a proposal to update the guardian set */ + GuardianSetUpdateProposal(request: MsgGuardianSetUpdateProposal): Promise; + /** GovernanceWormholeMessageProposal processes a proposal to emit a generic message */ + GovernanceWormholeMessageProposal(request: MsgGovernanceWormholeMessageProposal): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ExecuteGovernanceVAA = this.ExecuteGovernanceVAA.bind(this); + this.RegisterAccountAsGuardian = this.RegisterAccountAsGuardian.bind(this); + this.CreateAllowlistEntry = this.CreateAllowlistEntry.bind(this); + this.DeleteAllowlistEntry = this.DeleteAllowlistEntry.bind(this); + this.StoreCode = this.StoreCode.bind(this); + this.InstantiateContract = this.InstantiateContract.bind(this); + this.AddWasmInstantiateAllowlist = this.AddWasmInstantiateAllowlist.bind(this); + this.DeleteWasmInstantiateAllowlist = this.DeleteWasmInstantiateAllowlist.bind(this); + this.MigrateContract = this.MigrateContract.bind(this); + this.ExecuteGatewayGovernanceVaa = this.ExecuteGatewayGovernanceVaa.bind(this); + this.GuardianSetUpdateProposal = this.GuardianSetUpdateProposal.bind(this); + this.GovernanceWormholeMessageProposal = this.GovernanceWormholeMessageProposal.bind(this); + } + ExecuteGovernanceVAA(request: MsgExecuteGovernanceVAA): Promise { + const data = MsgExecuteGovernanceVAA.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "ExecuteGovernanceVAA", data); + return promise.then((data) => MsgExecuteGovernanceVAAResponse.decode(new _m0.Reader(data))); + } + + RegisterAccountAsGuardian(request: MsgRegisterAccountAsGuardian): Promise { + const data = MsgRegisterAccountAsGuardian.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "RegisterAccountAsGuardian", data); + return promise.then((data) => MsgRegisterAccountAsGuardianResponse.decode(new _m0.Reader(data))); + } + + CreateAllowlistEntry(request: MsgCreateAllowlistEntryRequest): Promise { + const data = MsgCreateAllowlistEntryRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "CreateAllowlistEntry", data); + return promise.then((data) => MsgAllowlistResponse.decode(new _m0.Reader(data))); + } + + DeleteAllowlistEntry(request: MsgDeleteAllowlistEntryRequest): Promise { + const data = MsgDeleteAllowlistEntryRequest.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "DeleteAllowlistEntry", data); + return promise.then((data) => MsgAllowlistResponse.decode(new _m0.Reader(data))); + } + + StoreCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "StoreCode", data); + return promise.then((data) => MsgStoreCodeResponse.decode(new _m0.Reader(data))); + } + + InstantiateContract(request: MsgInstantiateContract): Promise { + const data = MsgInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "InstantiateContract", data); + return promise.then((data) => MsgInstantiateContractResponse.decode(new _m0.Reader(data))); + } + + AddWasmInstantiateAllowlist(request: MsgAddWasmInstantiateAllowlist): Promise { + const data = MsgAddWasmInstantiateAllowlist.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "AddWasmInstantiateAllowlist", data); + return promise.then((data) => MsgWasmInstantiateAllowlistResponse.decode(new _m0.Reader(data))); + } + + DeleteWasmInstantiateAllowlist( + request: MsgDeleteWasmInstantiateAllowlist, + ): Promise { + const data = MsgDeleteWasmInstantiateAllowlist.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "DeleteWasmInstantiateAllowlist", data); + return promise.then((data) => MsgWasmInstantiateAllowlistResponse.decode(new _m0.Reader(data))); + } + + MigrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "MigrateContract", data); + return promise.then((data) => MsgMigrateContractResponse.decode(new _m0.Reader(data))); + } + + ExecuteGatewayGovernanceVaa(request: MsgExecuteGatewayGovernanceVaa): Promise { + const data = MsgExecuteGatewayGovernanceVaa.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "ExecuteGatewayGovernanceVaa", data); + return promise.then((data) => EmptyResponse.decode(new _m0.Reader(data))); + } + + GuardianSetUpdateProposal(request: MsgGuardianSetUpdateProposal): Promise { + const data = MsgGuardianSetUpdateProposal.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "GuardianSetUpdateProposal", data); + return promise.then((data) => EmptyResponse.decode(new _m0.Reader(data))); + } + + GovernanceWormholeMessageProposal(request: MsgGovernanceWormholeMessageProposal): Promise { + const data = MsgGovernanceWormholeMessageProposal.encode(request).finish(); + const promise = this.rpc.request("wormchain.wormhole.Msg", "GovernanceWormholeMessageProposal", data); + return promise.then((data) => EmptyResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +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 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 }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +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/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/index.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/index.ts deleted file mode 100755 index 9719121cf8..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/index.ts +++ /dev/null @@ -1,88 +0,0 @@ -//@ts-nocheck -// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. - -import { StdFee } from "@cosmjs/launchpad"; -import { SigningStargateClient } from "@cosmjs/stargate"; -import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { Api } from "./rest"; -import { MsgExecuteGatewayGovernanceVaa } from "./types/wormhole/tx"; -import { MsgRegisterAccountAsGuardian } from "./types/wormhole/tx"; -import { MsgInstantiateContract } from "./types/wormhole/tx"; -import { MsgExecuteGovernanceVAA } from "./types/wormhole/tx"; -import { MsgStoreCode } from "./types/wormhole/tx"; -import { MsgAddWasmInstantiateAllowlist } from "./types/wormhole/tx"; -import { MsgDeleteWasmInstantiateAllowlist } from "./types/wormhole/tx"; -import { MsgMigrateContract } from "./types/wormhole/tx"; -import { MsgDeleteAllowlistEntryRequest } from "./types/wormhole/tx"; -import { MsgCreateAllowlistEntryRequest } from "./types/wormhole/tx"; - - -const types = [ - ["/wormhole_foundation.wormchain.wormhole.MsgExecuteGatewayGovernanceVaa", MsgExecuteGatewayGovernanceVaa], - ["/wormhole_foundation.wormchain.wormhole.MsgRegisterAccountAsGuardian", MsgRegisterAccountAsGuardian], - ["/wormhole_foundation.wormchain.wormhole.MsgInstantiateContract", MsgInstantiateContract], - ["/wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAA", MsgExecuteGovernanceVAA], - ["/wormhole_foundation.wormchain.wormhole.MsgStoreCode", MsgStoreCode], - ["/wormhole_foundation.wormchain.wormhole.MsgAddWasmInstantiateAllowlist", MsgAddWasmInstantiateAllowlist], - ["/wormhole_foundation.wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist", MsgDeleteWasmInstantiateAllowlist], - ["/wormhole_foundation.wormchain.wormhole.MsgMigrateContract", MsgMigrateContract], - ["/wormhole_foundation.wormchain.wormhole.MsgDeleteAllowlistEntryRequest", MsgDeleteAllowlistEntryRequest], - ["/wormhole_foundation.wormchain.wormhole.MsgCreateAllowlistEntryRequest", MsgCreateAllowlistEntryRequest], - -]; -export const MissingWalletError = new Error("wallet is required"); - -export const registry = new Registry(types); - -const defaultFee = { - amount: [], - gas: "200000", -}; - -interface TxClientOptions { - addr: string -} - -interface SignAndBroadcastOptions { - fee: StdFee, - memo?: string -} - -const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { - if (!wallet) throw MissingWalletError; - let client; - if (addr) { - client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); - }else{ - client = await SigningStargateClient.offline( wallet, { registry }); - } - const { address } = (await wallet.getAccounts())[0]; - - return { - signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgExecuteGatewayGovernanceVaa: (data: MsgExecuteGatewayGovernanceVaa): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgExecuteGatewayGovernanceVaa", value: MsgExecuteGatewayGovernanceVaa.fromPartial( data ) }), - msgRegisterAccountAsGuardian: (data: MsgRegisterAccountAsGuardian): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgRegisterAccountAsGuardian", value: MsgRegisterAccountAsGuardian.fromPartial( data ) }), - msgInstantiateContract: (data: MsgInstantiateContract): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgInstantiateContract", value: MsgInstantiateContract.fromPartial( data ) }), - msgExecuteGovernanceVAA: (data: MsgExecuteGovernanceVAA): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAA", value: MsgExecuteGovernanceVAA.fromPartial( data ) }), - msgStoreCode: (data: MsgStoreCode): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgStoreCode", value: MsgStoreCode.fromPartial( data ) }), - msgAddWasmInstantiateAllowlist: (data: MsgAddWasmInstantiateAllowlist): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgAddWasmInstantiateAllowlist", value: MsgAddWasmInstantiateAllowlist.fromPartial( data ) }), - msgDeleteWasmInstantiateAllowlist: (data: MsgDeleteWasmInstantiateAllowlist): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist", value: MsgDeleteWasmInstantiateAllowlist.fromPartial( data ) }), - msgMigrateContract: (data: MsgMigrateContract): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgMigrateContract", value: MsgMigrateContract.fromPartial( data ) }), - msgDeleteAllowlistEntryRequest: (data: MsgDeleteAllowlistEntryRequest): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgDeleteAllowlistEntryRequest", value: MsgDeleteAllowlistEntryRequest.fromPartial( data ) }), - msgCreateAllowlistEntryRequest: (data: MsgCreateAllowlistEntryRequest): EncodeObject => ({ typeUrl: "/wormhole_foundation.wormchain.wormhole.MsgCreateAllowlistEntryRequest", value: MsgCreateAllowlistEntryRequest.fromPartial( data ) }), - - }; -}; - -interface QueryClientOptions { - addr: string -} - -const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { - return new Api({ baseUrl: addr }); -}; - -export { - txClient, - queryClient, -}; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index 6c63be1cde..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -1,329 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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: number; - /** - * 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: number; - /** - * 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. - */ - count_total: 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 - */ - next_key: Uint8Array; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total: number; -} - -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; - -export const PageRequest = { - encode(message: PageRequest, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - if (message.offset !== 0) { - writer.uint32(16).uint64(message.offset); - } - if (message.limit !== 0) { - writer.uint32(24).uint64(message.limit); - } - if (message.count_total === true) { - writer.uint32(32).bool(message.count_total); - } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageRequest } as PageRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = longToNumber(reader.uint64() as Long); - break; - case 3: - message.limit = longToNumber(reader.uint64() as Long); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = Number(object.offset); - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = Number(object.limit); - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = Boolean(object.count_total); - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } - return message; - }, - - 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); - message.limit !== undefined && (obj.limit = message.limit); - message.count_total !== undefined && - (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); - return obj; - }, - - fromPartial(object: DeepPartial): PageRequest { - const message = { ...basePageRequest } as PageRequest; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = object.offset; - } else { - message.offset = 0; - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = object.limit; - } else { - message.limit = 0; - } - if (object.count_total !== undefined && object.count_total !== null) { - message.count_total = object.count_total; - } else { - message.count_total = false; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } - return message; - }, -}; - -const basePageResponse: object = { total: 0 }; - -export const PageResponse = { - encode(message: PageResponse, writer: Writer = Writer.create()): Writer { - if (message.next_key.length !== 0) { - writer.uint32(10).bytes(message.next_key); - } - if (message.total !== 0) { - writer.uint32(16).uint64(message.total); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...basePageResponse } as PageResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = Number(object.total); - } else { - message.total = 0; - } - return message; - }, - - toJSON(message: PageResponse): unknown { - const obj: any = {}; - message.next_key !== undefined && - (obj.next_key = base64FromBytes( - message.next_key !== undefined ? message.next_key : new Uint8Array() - )); - message.total !== undefined && (obj.total = message.total); - return obj; - }, - - fromPartial(object: DeepPartial): PageResponse { - const message = { ...basePageResponse } as PageResponse; - if (object.next_key !== undefined && object.next_key !== null) { - message.next_key = object.next_key; - } else { - message.next_key = new Uint8Array(); - } - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } else { - message.total = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/protobuf/descriptor.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/protobuf/descriptor.ts deleted file mode 100644 index 641b324ff5..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/google/protobuf/descriptor.ts +++ /dev/null @@ -1,5315 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } 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. */ - public_dependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency: number[]; - /** All top-level definitions in this file. */ - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options: FileOptions | undefined; - /** - * 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. - */ - source_code_info: SourceCodeInfo | undefined; - /** - * 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[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto_ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options: MessageOptions | undefined; - reserved_range: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name: string[]; -} - -export interface DescriptorProto_ExtensionRange { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; - options: ExtensionRangeOptions | undefined; -} - -/** - * 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. */ - uninterpreted_option: 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). - */ - type_name: 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. - * TODO(kenton): Base-64 encode? - */ - default_value: 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. - */ - oneof_index: 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. - */ - json_name: string; - options: FieldOptions | undefined; - /** - * 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`. - */ - proto3_optional: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface EnumDescriptorProto { - name: string; - value: EnumValueDescriptorProto[]; - options: EnumOptions | undefined; - /** - * 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. - */ - reserved_range: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name: 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 | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options: ServiceOptions | undefined; -} - -/** 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. - */ - input_type: string; - output_type: string; - options: MethodOptions | undefined; - /** Identifies if client streams multiple client messages */ - client_streaming: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming: 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. - */ - java_package: 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. - */ - java_outer_classname: 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. - */ - java_multiple_files: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - java_generate_equals_and_hash: 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. - */ - java_string_check_utf8: boolean; - optimize_for: 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. - */ - go_package: 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. - */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: 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++. - */ - cc_enable_arenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: 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. - */ - swift_prefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix: 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. - */ - php_namespace: 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. - */ - php_metadata_namespace: 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. - */ - ruby_package: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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. - */ - message_set_wire_format: 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". - */ - no_standard_descriptor_accessor: 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. - */ - map_entry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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. - */ - lazy: 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. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -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"; - default: - return "UNKNOWN"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias: 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. */ - uninterpreted_option: 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. */ - uninterpreted_option: 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. */ - uninterpreted_option: 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; - idempotency_level: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: 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"; - default: - return "UNKNOWN"; - } -} - -/** - * 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. - */ - identifier_value: string; - positive_int_value: number; - negative_int_value: number; - double_value: number; - string_value: Uint8Array; - aggregate_value: 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], ["qux", false] } represents - * "foo.(bar.baz).qux". - */ -export interface UninterpretedOption_NamePart { - name_part: string; - is_extension: 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. 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 qux. - * // - * // Another line attached to qux. - * optional double qux = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to qux 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. - */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: 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. */ - source_file: 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; -} - -const baseFileDescriptorSet: object = {}; - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - 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 { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): FileDescriptorSet { - const message = { ...baseFileDescriptorSet } as FileDescriptorSet; - message.file = []; - if (object.file !== undefined && object.file !== null) { - for (const e of object.file) { - message.file.push(FileDescriptorProto.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFileDescriptorProto: object = { - name: "", - package: "", - dependency: "", - public_dependency: 0, - weak_dependency: 0, - syntax: "", -}; - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: Writer = Writer.create() - ): 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.public_dependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weak_dependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.message_type) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enum_type) { - 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.source_code_info !== undefined) { - SourceCodeInfo.encode( - message.source_code_info, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - 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.public_dependency.push(reader.int32()); - } - } else { - message.public_dependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weak_dependency.push(reader.int32()); - } - } else { - message.weak_dependency.push(reader.int32()); - } - break; - case 4: - message.message_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enum_type.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.source_code_info = 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 { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = String(object.package); - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(String(e)); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(Number(e)); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(Number(e)); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromJSON( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = String(object.syntax); - } else { - message.syntax = ""; - } - return message; - }, - - 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.public_dependency) { - obj.public_dependency = message.public_dependency.map((e) => e); - } else { - obj.public_dependency = []; - } - if (message.weak_dependency) { - obj.weak_dependency = message.weak_dependency.map((e) => e); - } else { - obj.weak_dependency = []; - } - if (message.message_type) { - obj.message_type = message.message_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.message_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - 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.source_code_info !== undefined && - (obj.source_code_info = message.source_code_info - ? SourceCodeInfo.toJSON(message.source_code_info) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = { ...baseFileDescriptorProto } as FileDescriptorProto; - message.dependency = []; - message.public_dependency = []; - message.weak_dependency = []; - message.message_type = []; - message.enum_type = []; - message.service = []; - message.extension = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } else { - message.package = ""; - } - if (object.dependency !== undefined && object.dependency !== null) { - for (const e of object.dependency) { - message.dependency.push(e); - } - } - if ( - object.public_dependency !== undefined && - object.public_dependency !== null - ) { - for (const e of object.public_dependency) { - message.public_dependency.push(e); - } - } - if ( - object.weak_dependency !== undefined && - object.weak_dependency !== null - ) { - for (const e of object.weak_dependency) { - message.weak_dependency.push(e); - } - } - if (object.message_type !== undefined && object.message_type !== null) { - for (const e of object.message_type) { - message.message_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if (object.service !== undefined && object.service !== null) { - for (const e of object.service) { - message.service.push(ServiceDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.source_code_info = SourceCodeInfo.fromPartial( - object.source_code_info - ); - } else { - message.source_code_info = undefined; - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } else { - message.syntax = ""; - } - return message; - }, -}; - -const baseDescriptorProto: object = { name: "", reserved_name: "" }; - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: Writer = Writer.create()): 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.nested_type) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enum_type) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extension_range) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneof_decl) { - 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.reserved_range) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - 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.nested_type.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enum_type.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extension_range.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneof_decl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reserved_range.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromJSON(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromJSON(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromJSON(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromJSON(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.nested_type) { - obj.nested_type = message.nested_type.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nested_type = []; - } - if (message.enum_type) { - obj.enum_type = message.enum_type.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enum_type = []; - } - if (message.extension_range) { - obj.extension_range = message.extension_range.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extension_range = []; - } - if (message.oneof_decl) { - obj.oneof_decl = message.oneof_decl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneof_decl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = { ...baseDescriptorProto } as DescriptorProto; - message.field = []; - message.extension = []; - message.nested_type = []; - message.enum_type = []; - message.extension_range = []; - message.oneof_decl = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.field !== undefined && object.field !== null) { - for (const e of object.field) { - message.field.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.extension !== undefined && object.extension !== null) { - for (const e of object.extension) { - message.extension.push(FieldDescriptorProto.fromPartial(e)); - } - } - if (object.nested_type !== undefined && object.nested_type !== null) { - for (const e of object.nested_type) { - message.nested_type.push(DescriptorProto.fromPartial(e)); - } - } - if (object.enum_type !== undefined && object.enum_type !== null) { - for (const e of object.enum_type) { - message.enum_type.push(EnumDescriptorProto.fromPartial(e)); - } - } - if ( - object.extension_range !== undefined && - object.extension_range !== null - ) { - for (const e of object.extension_range) { - message.extension_range.push( - DescriptorProto_ExtensionRange.fromPartial(e) - ); - } - } - if (object.oneof_decl !== undefined && object.oneof_decl !== null) { - for (const e of object.oneof_decl) { - message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - DescriptorProto_ReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ExtensionRange { - const message = { - ...baseDescriptorProto_ExtensionRange, - } as DescriptorProto_ExtensionRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_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 { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): DescriptorProto_ReservedRange { - const message = { - ...baseDescriptorProto_ReservedRange, - } as DescriptorProto_ReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseExtensionRangeOptions: object = {}; - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): ExtensionRangeOptions { - const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldDescriptorProto: object = { - name: "", - number: 0, - label: 1, - type: 1, - type_name: "", - extendee: "", - default_value: "", - oneof_index: 0, - json_name: "", - proto3_optional: false, -}; - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: Writer = Writer.create() - ): 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.type_name !== "") { - writer.uint32(50).string(message.type_name); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.default_value !== "") { - writer.uint32(58).string(message.default_value); - } - if (message.oneof_index !== 0) { - writer.uint32(72).int32(message.oneof_index); - } - if (message.json_name !== "") { - writer.uint32(82).string(message.json_name); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3_optional === true) { - writer.uint32(136).bool(message.proto3_optional); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - 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.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3_optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = String(object.type_name); - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = String(object.extendee); - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = String(object.default_value); - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = Number(object.oneof_index); - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = String(object.json_name); - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = Boolean(object.proto3_optional); - } else { - message.proto3_optional = false; - } - return message; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.type_name !== undefined && (obj.type_name = message.type_name); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.default_value !== undefined && - (obj.default_value = message.default_value); - message.oneof_index !== undefined && - (obj.oneof_index = message.oneof_index); - message.json_name !== undefined && (obj.json_name = message.json_name); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3_optional !== undefined && - (obj.proto3_optional = message.proto3_optional); - return obj; - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = 1; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } else { - message.type = 1; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.type_name = object.type_name; - } else { - message.type_name = ""; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } else { - message.extendee = ""; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.default_value = object.default_value; - } else { - message.default_value = ""; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneof_index = object.oneof_index; - } else { - message.oneof_index = 0; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.json_name = object.json_name; - } else { - message.json_name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.proto3_optional !== undefined && - object.proto3_optional !== null - ) { - message.proto3_optional = object.proto3_optional; - } else { - message.proto3_optional = false; - } - return message; - }, -}; - -const baseOneofDescriptorProto: object = { name: "" }; - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - 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 { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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(object: DeepPartial): OneofDescriptorProto { - const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: Writer = Writer.create() - ): 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.reserved_range) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reserved_name) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - 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.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(String(e)); - } - } - return message; - }, - - 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.reserved_range) { - obj.reserved_range = message.reserved_range.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reserved_range = []; - } - if (message.reserved_name) { - obj.reserved_name = message.reserved_name.map((e) => e); - } else { - obj.reserved_name = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; - message.value = []; - message.reserved_range = []; - message.reserved_name = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.value !== undefined && object.value !== null) { - for (const e of object.value) { - message.value.push(EnumValueDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if (object.reserved_range !== undefined && object.reserved_range !== null) { - for (const e of object.reserved_range) { - message.reserved_range.push( - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ); - } - } - if (object.reserved_name !== undefined && object.reserved_name !== null) { - for (const e of object.reserved_name) { - message.reserved_name.push(e); - } - } - return message; - }, -}; - -const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_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 { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = Number(object.start); - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = message.start); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumDescriptorProto_EnumReservedRange { - const message = { - ...baseEnumDescriptorProto_EnumReservedRange, - } as EnumDescriptorProto_EnumReservedRange; - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } else { - message.start = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - 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 { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = Number(object.number); - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = message.number); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EnumValueDescriptorProto { - const message = { - ...baseEnumValueDescriptorProto, - } as EnumValueDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } else { - message.number = 0; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseServiceDescriptorProto: object = { name: "" }; - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: Writer = Writer.create() - ): 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: Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - 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 { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromJSON(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - return message; - }, - - 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( - object: DeepPartial - ): ServiceDescriptorProto { - const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; - message.method = []; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.method !== undefined && object.method !== null) { - for (const e of object.method) { - message.method.push(MethodDescriptorProto.fromPartial(e)); - } - } - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - return message; - }, -}; - -const baseMethodDescriptorProto: object = { - name: "", - input_type: "", - output_type: "", - client_streaming: false, - server_streaming: false, -}; - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: Writer = Writer.create() - ): Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.input_type !== "") { - writer.uint32(18).string(message.input_type); - } - if (message.output_type !== "") { - writer.uint32(26).string(message.output_type); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.client_streaming === true) { - writer.uint32(40).bool(message.client_streaming); - } - if (message.server_streaming === true) { - writer.uint32(48).bool(message.server_streaming); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = String(object.input_type); - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = String(object.output_type); - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromJSON(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = Boolean(object.client_streaming); - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = Boolean(object.server_streaming); - } else { - message.server_streaming = false; - } - return message; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.input_type !== undefined && (obj.input_type = message.input_type); - message.output_type !== undefined && - (obj.output_type = message.output_type); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.client_streaming !== undefined && - (obj.client_streaming = message.client_streaming); - message.server_streaming !== undefined && - (obj.server_streaming = message.server_streaming); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MethodDescriptorProto { - const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.input_type = object.input_type; - } else { - message.input_type = ""; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.output_type = object.output_type; - } else { - message.output_type = ""; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromPartial(object.options); - } else { - message.options = undefined; - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.client_streaming = object.client_streaming; - } else { - message.client_streaming = false; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.server_streaming = object.server_streaming; - } else { - message.server_streaming = false; - } - return message; - }, -}; - -const baseFileOptions: object = { - java_package: "", - java_outer_classname: "", - java_multiple_files: false, - java_generate_equals_and_hash: false, - java_string_check_utf8: false, - optimize_for: 1, - go_package: "", - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - php_generic_services: false, - deprecated: false, - cc_enable_arenas: false, - objc_class_prefix: "", - csharp_namespace: "", - swift_prefix: "", - php_class_prefix: "", - php_namespace: "", - php_metadata_namespace: "", - ruby_package: "", -}; - -export const FileOptions = { - encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.java_package !== "") { - writer.uint32(10).string(message.java_package); - } - if (message.java_outer_classname !== "") { - writer.uint32(66).string(message.java_outer_classname); - } - if (message.java_multiple_files === true) { - writer.uint32(80).bool(message.java_multiple_files); - } - if (message.java_generate_equals_and_hash === true) { - writer.uint32(160).bool(message.java_generate_equals_and_hash); - } - if (message.java_string_check_utf8 === true) { - writer.uint32(216).bool(message.java_string_check_utf8); - } - if (message.optimize_for !== 1) { - writer.uint32(72).int32(message.optimize_for); - } - if (message.go_package !== "") { - writer.uint32(90).string(message.go_package); - } - if (message.cc_generic_services === true) { - writer.uint32(128).bool(message.cc_generic_services); - } - if (message.java_generic_services === true) { - writer.uint32(136).bool(message.java_generic_services); - } - if (message.py_generic_services === true) { - writer.uint32(144).bool(message.py_generic_services); - } - if (message.php_generic_services === true) { - writer.uint32(336).bool(message.php_generic_services); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.cc_enable_arenas === true) { - writer.uint32(248).bool(message.cc_enable_arenas); - } - if (message.objc_class_prefix !== "") { - writer.uint32(290).string(message.objc_class_prefix); - } - if (message.csharp_namespace !== "") { - writer.uint32(298).string(message.csharp_namespace); - } - if (message.swift_prefix !== "") { - writer.uint32(314).string(message.swift_prefix); - } - if (message.php_class_prefix !== "") { - writer.uint32(322).string(message.php_class_prefix); - } - if (message.php_namespace !== "") { - writer.uint32(330).string(message.php_namespace); - } - if (message.php_metadata_namespace !== "") { - writer.uint32(354).string(message.php_metadata_namespace); - } - if (message.ruby_package !== "") { - writer.uint32(362).string(message.ruby_package); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32() as any; - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 42: - message.php_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 39: - message.swift_prefix = reader.string(); - break; - case 40: - message.php_class_prefix = reader.string(); - break; - case 41: - message.php_namespace = reader.string(); - break; - case 44: - message.php_metadata_namespace = reader.string(); - break; - case 45: - message.ruby_package = reader.string(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = String(object.java_package); - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = String(object.java_outer_classname); - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = Boolean(object.java_multiple_files); - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = Boolean( - object.java_generate_equals_and_hash - ); - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = fileOptions_OptimizeModeFromJSON( - object.optimize_for - ); - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = String(object.go_package); - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = Boolean(object.cc_generic_services); - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = Boolean(object.java_generic_services); - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = Boolean(object.py_generic_services); - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = Boolean(object.php_generic_services); - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = String(object.objc_class_prefix); - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = String(object.csharp_namespace); - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = String(object.swift_prefix); - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = String(object.php_class_prefix); - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = String(object.php_namespace); - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = String(object.php_metadata_namespace); - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = String(object.ruby_package); - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.java_package !== undefined && - (obj.java_package = message.java_package); - message.java_outer_classname !== undefined && - (obj.java_outer_classname = message.java_outer_classname); - message.java_multiple_files !== undefined && - (obj.java_multiple_files = message.java_multiple_files); - message.java_generate_equals_and_hash !== undefined && - (obj.java_generate_equals_and_hash = - message.java_generate_equals_and_hash); - message.java_string_check_utf8 !== undefined && - (obj.java_string_check_utf8 = message.java_string_check_utf8); - message.optimize_for !== undefined && - (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); - message.go_package !== undefined && (obj.go_package = message.go_package); - message.cc_generic_services !== undefined && - (obj.cc_generic_services = message.cc_generic_services); - message.java_generic_services !== undefined && - (obj.java_generic_services = message.java_generic_services); - message.py_generic_services !== undefined && - (obj.py_generic_services = message.py_generic_services); - message.php_generic_services !== undefined && - (obj.php_generic_services = message.php_generic_services); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.cc_enable_arenas !== undefined && - (obj.cc_enable_arenas = message.cc_enable_arenas); - message.objc_class_prefix !== undefined && - (obj.objc_class_prefix = message.objc_class_prefix); - message.csharp_namespace !== undefined && - (obj.csharp_namespace = message.csharp_namespace); - message.swift_prefix !== undefined && - (obj.swift_prefix = message.swift_prefix); - message.php_class_prefix !== undefined && - (obj.php_class_prefix = message.php_class_prefix); - message.php_namespace !== undefined && - (obj.php_namespace = message.php_namespace); - message.php_metadata_namespace !== undefined && - (obj.php_metadata_namespace = message.php_metadata_namespace); - message.ruby_package !== undefined && - (obj.ruby_package = message.ruby_package); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = { ...baseFileOptions } as FileOptions; - message.uninterpreted_option = []; - if (object.java_package !== undefined && object.java_package !== null) { - message.java_package = object.java_package; - } else { - message.java_package = ""; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.java_outer_classname = object.java_outer_classname; - } else { - message.java_outer_classname = ""; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.java_multiple_files = object.java_multiple_files; - } else { - message.java_multiple_files = false; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.java_generate_equals_and_hash = - object.java_generate_equals_and_hash; - } else { - message.java_generate_equals_and_hash = false; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.java_string_check_utf8 = object.java_string_check_utf8; - } else { - message.java_string_check_utf8 = false; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimize_for = object.optimize_for; - } else { - message.optimize_for = 1; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.go_package = object.go_package; - } else { - message.go_package = ""; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.cc_generic_services = object.cc_generic_services; - } else { - message.cc_generic_services = false; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.java_generic_services = object.java_generic_services; - } else { - message.java_generic_services = false; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.py_generic_services = object.py_generic_services; - } else { - message.py_generic_services = false; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.php_generic_services = object.php_generic_services; - } else { - message.php_generic_services = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.cc_enable_arenas = object.cc_enable_arenas; - } else { - message.cc_enable_arenas = false; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objc_class_prefix = object.objc_class_prefix; - } else { - message.objc_class_prefix = ""; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharp_namespace = object.csharp_namespace; - } else { - message.csharp_namespace = ""; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swift_prefix = object.swift_prefix; - } else { - message.swift_prefix = ""; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.php_class_prefix = object.php_class_prefix; - } else { - message.php_class_prefix = ""; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.php_namespace = object.php_namespace; - } else { - message.php_namespace = ""; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.php_metadata_namespace = object.php_metadata_namespace; - } else { - message.php_metadata_namespace = ""; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.ruby_package = object.ruby_package; - } else { - message.ruby_package = ""; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMessageOptions: object = { - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - deprecated: false, - map_entry: false, -}; - -export const MessageOptions = { - encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.message_set_wire_format === true) { - writer.uint32(8).bool(message.message_set_wire_format); - } - if (message.no_standard_descriptor_accessor === true) { - writer.uint32(16).bool(message.no_standard_descriptor_accessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.map_entry === true) { - writer.uint32(56).bool(message.map_entry); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = Boolean(object.message_set_wire_format); - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = Boolean( - object.no_standard_descriptor_accessor - ); - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = Boolean(object.map_entry); - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.message_set_wire_format !== undefined && - (obj.message_set_wire_format = message.message_set_wire_format); - message.no_standard_descriptor_accessor !== undefined && - (obj.no_standard_descriptor_accessor = - message.no_standard_descriptor_accessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.map_entry !== undefined && (obj.map_entry = message.map_entry); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpreted_option = []; - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.message_set_wire_format = object.message_set_wire_format; - } else { - message.message_set_wire_format = false; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.no_standard_descriptor_accessor = - object.no_standard_descriptor_accessor; - } else { - message.no_standard_descriptor_accessor = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.map_entry = object.map_entry; - } else { - message.map_entry = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseFieldOptions: object = { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - deprecated: false, - weak: false, -}; - -export const FieldOptions = { - encode(message: FieldOptions, writer: Writer = Writer.create()): 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.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.weak === true) { - writer.uint32(80).bool(message.weak); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - 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 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = Boolean(object.packed); - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = Boolean(object.lazy); - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = Boolean(object.weak); - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - 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.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpreted_option = []; - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } else { - message.ctype = 0; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } else { - message.packed = false; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } else { - message.jstype = 0; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } else { - message.lazy = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } else { - message.weak = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseOneofOptions: object = {}; - -export const OneofOptions = { - encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpreted_option = []; - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumOptions: object = { allow_alias: false, deprecated: false }; - -export const EnumOptions = { - encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allow_alias === true) { - writer.uint32(16).bool(message.allow_alias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = Boolean(object.allow_alias); - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allow_alias !== undefined && - (obj.allow_alias = message.allow_alias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpreted_option = []; - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allow_alias = object.allow_alias; - } else { - message.allow_alias = false; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseEnumValueOptions: object = { deprecated: false }; - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseServiceOptions: object = { deprecated: false }; - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; - -export const MethodOptions = { - encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotency_level !== 0) { - writer.uint32(272).int32(message.idempotency_level); - } - for (const v of message.uninterpreted_option) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotency_level = reader.int32() as any; - break; - case 999: - message.uninterpreted_option.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = Boolean(object.deprecated); - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( - object.idempotency_level - ); - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); - } - } - return message; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotency_level !== undefined && - (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( - message.idempotency_level - )); - if (message.uninterpreted_option) { - obj.uninterpreted_option = message.uninterpreted_option.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpreted_option = []; - } - return obj; - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpreted_option = []; - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } else { - message.deprecated = false; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotency_level = object.idempotency_level; - } else { - message.idempotency_level = 0; - } - if ( - object.uninterpreted_option !== undefined && - object.uninterpreted_option !== null - ) { - for (const e of object.uninterpreted_option) { - message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); - } - } - return message; - }, -}; - -const baseUninterpretedOption: object = { - identifier_value: "", - positive_int_value: 0, - negative_int_value: 0, - double_value: 0, - aggregate_value: "", -}; - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifier_value !== "") { - writer.uint32(26).string(message.identifier_value); - } - if (message.positive_int_value !== 0) { - writer.uint32(32).uint64(message.positive_int_value); - } - if (message.negative_int_value !== 0) { - writer.uint32(40).int64(message.negative_int_value); - } - if (message.double_value !== 0) { - writer.uint32(49).double(message.double_value); - } - if (message.string_value.length !== 0) { - writer.uint32(58).bytes(message.string_value); - } - if (message.aggregate_value !== "") { - writer.uint32(66).string(message.aggregate_value); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - 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.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = longToNumber(reader.uint64() as Long); - break; - case 5: - message.negative_int_value = longToNumber(reader.int64() as Long); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromJSON(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = String(object.identifier_value); - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = Number(object.positive_int_value); - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = Number(object.negative_int_value); - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = Number(object.double_value); - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = String(object.aggregate_value); - } else { - message.aggregate_value = ""; - } - return message; - }, - - 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.identifier_value !== undefined && - (obj.identifier_value = message.identifier_value); - message.positive_int_value !== undefined && - (obj.positive_int_value = message.positive_int_value); - message.negative_int_value !== undefined && - (obj.negative_int_value = message.negative_int_value); - message.double_value !== undefined && - (obj.double_value = message.double_value); - message.string_value !== undefined && - (obj.string_value = base64FromBytes( - message.string_value !== undefined - ? message.string_value - : new Uint8Array() - )); - message.aggregate_value !== undefined && - (obj.aggregate_value = message.aggregate_value); - return obj; - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = { ...baseUninterpretedOption } as UninterpretedOption; - message.name = []; - if (object.name !== undefined && object.name !== null) { - for (const e of object.name) { - message.name.push(UninterpretedOption_NamePart.fromPartial(e)); - } - } - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifier_value = object.identifier_value; - } else { - message.identifier_value = ""; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positive_int_value = object.positive_int_value; - } else { - message.positive_int_value = 0; - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negative_int_value = object.negative_int_value; - } else { - message.negative_int_value = 0; - } - if (object.double_value !== undefined && object.double_value !== null) { - message.double_value = object.double_value; - } else { - message.double_value = 0; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.string_value = object.string_value; - } else { - message.string_value = new Uint8Array(); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregate_value = object.aggregate_value; - } else { - message.aggregate_value = ""; - } - return message; - }, -}; - -const baseUninterpretedOption_NamePart: object = { - name_part: "", - is_extension: false, -}; - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: Writer = Writer.create() - ): Writer { - if (message.name_part !== "") { - writer.uint32(10).string(message.name_part); - } - if (message.is_extension === true) { - writer.uint32(16).bool(message.is_extension); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = String(object.name_part); - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = Boolean(object.is_extension); - } else { - message.is_extension = false; - } - return message; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.name_part !== undefined && (obj.name_part = message.name_part); - message.is_extension !== undefined && - (obj.is_extension = message.is_extension); - return obj; - }, - - fromPartial( - object: DeepPartial - ): UninterpretedOption_NamePart { - const message = { - ...baseUninterpretedOption_NamePart, - } as UninterpretedOption_NamePart; - if (object.name_part !== undefined && object.name_part !== null) { - message.name_part = object.name_part; - } else { - message.name_part = ""; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.is_extension = object.is_extension; - } else { - message.is_extension = false; - } - return message; - }, -}; - -const baseSourceCodeInfo: object = {}; - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - 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 { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): SourceCodeInfo { - const message = { ...baseSourceCodeInfo } as SourceCodeInfo; - message.location = []; - if (object.location !== undefined && object.location !== null) { - for (const e of object.location) { - message.location.push(SourceCodeInfo_Location.fromPartial(e)); - } - } - return message; - }, -}; - -const baseSourceCodeInfo_Location: object = { - path: 0, - span: 0, - leading_comments: "", - trailing_comments: "", - leading_detached_comments: "", -}; - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: Writer = Writer.create() - ): 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.leading_comments !== "") { - writer.uint32(26).string(message.leading_comments); - } - if (message.trailing_comments !== "") { - writer.uint32(34).string(message.trailing_comments); - } - for (const v of message.leading_detached_comments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - 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.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(Number(e)); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = String(object.leading_comments); - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = String(object.trailing_comments); - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(String(e)); - } - } - return message; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => e); - } else { - obj.span = []; - } - message.leading_comments !== undefined && - (obj.leading_comments = message.leading_comments); - message.trailing_comments !== undefined && - (obj.trailing_comments = message.trailing_comments); - if (message.leading_detached_comments) { - obj.leading_detached_comments = message.leading_detached_comments.map( - (e) => e - ); - } else { - obj.leading_detached_comments = []; - } - return obj; - }, - - fromPartial( - object: DeepPartial - ): SourceCodeInfo_Location { - const message = { - ...baseSourceCodeInfo_Location, - } as SourceCodeInfo_Location; - message.path = []; - message.span = []; - message.leading_detached_comments = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.span !== undefined && object.span !== null) { - for (const e of object.span) { - message.span.push(e); - } - } - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leading_comments = object.leading_comments; - } else { - message.leading_comments = ""; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailing_comments = object.trailing_comments; - } else { - message.trailing_comments = ""; - } - if ( - object.leading_detached_comments !== undefined && - object.leading_detached_comments !== null - ) { - for (const e of object.leading_detached_comments) { - message.leading_detached_comments.push(e); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo: object = {}; - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - 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 { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); - } - } - return message; - }, - - 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(object: DeepPartial): GeneratedCodeInfo { - const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; - message.annotation = []; - if (object.annotation !== undefined && object.annotation !== null) { - for (const e of object.annotation) { - message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); - } - } - return message; - }, -}; - -const baseGeneratedCodeInfo_Annotation: object = { - path: 0, - source_file: "", - begin: 0, - end: 0, -}; - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: Writer = Writer.create() - ): Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.source_file !== "") { - writer.uint32(18).string(message.source_file); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - 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.source_file = 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 { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(Number(e)); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = String(object.source_file); - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = Number(object.begin); - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = Number(object.end); - } else { - message.end = 0; - } - return message; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => e); - } else { - obj.path = []; - } - message.source_file !== undefined && - (obj.source_file = message.source_file); - message.begin !== undefined && (obj.begin = message.begin); - message.end !== undefined && (obj.end = message.end); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GeneratedCodeInfo_Annotation { - const message = { - ...baseGeneratedCodeInfo_Annotation, - } as GeneratedCodeInfo_Annotation; - message.path = []; - if (object.path !== undefined && object.path !== null) { - for (const e of object.path) { - message.path.push(e); - } - } - if (object.source_file !== undefined && object.source_file !== null) { - message.source_file = object.source_file; - } else { - message.source_file = ""; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } else { - message.begin = 0; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } else { - message.end = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/config.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/config.ts deleted file mode 100644 index 7c7b11562e..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/config.ts +++ /dev/null @@ -1,204 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface Config { - guardian_set_expiration: number; - governance_emitter: Uint8Array; - governance_chain: number; - chain_id: number; -} - -const baseConfig: object = { - guardian_set_expiration: 0, - governance_chain: 0, - chain_id: 0, -}; - -export const Config = { - encode(message: Config, writer: Writer = Writer.create()): Writer { - if (message.guardian_set_expiration !== 0) { - writer.uint32(8).uint64(message.guardian_set_expiration); - } - if (message.governance_emitter.length !== 0) { - writer.uint32(18).bytes(message.governance_emitter); - } - if (message.governance_chain !== 0) { - writer.uint32(24).uint32(message.governance_chain); - } - if (message.chain_id !== 0) { - writer.uint32(32).uint32(message.chain_id); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): Config { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseConfig } as Config; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardian_set_expiration = longToNumber( - reader.uint64() as Long - ); - break; - case 2: - message.governance_emitter = reader.bytes(); - break; - case 3: - message.governance_chain = reader.uint32(); - break; - case 4: - message.chain_id = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Config { - const message = { ...baseConfig } as Config; - if ( - object.guardian_set_expiration !== undefined && - object.guardian_set_expiration !== null - ) { - message.guardian_set_expiration = Number(object.guardian_set_expiration); - } else { - message.guardian_set_expiration = 0; - } - if ( - object.governance_emitter !== undefined && - object.governance_emitter !== null - ) { - message.governance_emitter = bytesFromBase64(object.governance_emitter); - } - if ( - object.governance_chain !== undefined && - object.governance_chain !== null - ) { - message.governance_chain = Number(object.governance_chain); - } else { - message.governance_chain = 0; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = Number(object.chain_id); - } else { - message.chain_id = 0; - } - return message; - }, - - toJSON(message: Config): unknown { - const obj: any = {}; - message.guardian_set_expiration !== undefined && - (obj.guardian_set_expiration = message.guardian_set_expiration); - message.governance_emitter !== undefined && - (obj.governance_emitter = base64FromBytes( - message.governance_emitter !== undefined - ? message.governance_emitter - : new Uint8Array() - )); - message.governance_chain !== undefined && - (obj.governance_chain = message.governance_chain); - message.chain_id !== undefined && (obj.chain_id = message.chain_id); - return obj; - }, - - fromPartial(object: DeepPartial): Config { - const message = { ...baseConfig } as Config; - if ( - object.guardian_set_expiration !== undefined && - object.guardian_set_expiration !== null - ) { - message.guardian_set_expiration = object.guardian_set_expiration; - } else { - message.guardian_set_expiration = 0; - } - if ( - object.governance_emitter !== undefined && - object.governance_emitter !== null - ) { - message.governance_emitter = object.governance_emitter; - } else { - message.governance_emitter = new Uint8Array(); - } - if ( - object.governance_chain !== undefined && - object.governance_chain !== null - ) { - message.governance_chain = object.governance_chain; - } else { - message.governance_chain = 0; - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chain_id = object.chain_id; - } else { - message.chain_id = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/consensus_guardian_set_index.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/consensus_guardian_set_index.ts deleted file mode 100644 index 5028179ba9..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/consensus_guardian_set_index.ts +++ /dev/null @@ -1,89 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface ConsensusGuardianSetIndex { - index: number; -} - -const baseConsensusGuardianSetIndex: object = { index: 0 }; - -export const ConsensusGuardianSetIndex = { - encode( - message: ConsensusGuardianSetIndex, - writer: Writer = Writer.create() - ): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): ConsensusGuardianSetIndex { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseConsensusGuardianSetIndex, - } as ConsensusGuardianSetIndex; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ConsensusGuardianSetIndex { - const message = { - ...baseConsensusGuardianSetIndex, - } as ConsensusGuardianSetIndex; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - return message; - }, - - toJSON(message: ConsensusGuardianSetIndex): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ConsensusGuardianSetIndex { - const message = { - ...baseConsensusGuardianSetIndex, - } as ConsensusGuardianSetIndex; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/events.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/events.ts deleted file mode 100644 index edc4e026b8..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/events.ts +++ /dev/null @@ -1,462 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface EventGuardianSetUpdate { - old_index: number; - new_index: number; -} - -export interface EventPostedMessage { - emitter: Uint8Array; - sequence: number; - nonce: number; - time: number; - payload: Uint8Array; -} - -export interface EventGuardianRegistered { - guardian_key: Uint8Array; - validator_key: Uint8Array; -} - -export interface EventConsensusSetUpdate { - old_index: number; - new_index: number; -} - -const baseEventGuardianSetUpdate: object = { old_index: 0, new_index: 0 }; - -export const EventGuardianSetUpdate = { - encode( - message: EventGuardianSetUpdate, - writer: Writer = Writer.create() - ): Writer { - if (message.old_index !== 0) { - writer.uint32(8).uint32(message.old_index); - } - if (message.new_index !== 0) { - writer.uint32(16).uint32(message.new_index); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EventGuardianSetUpdate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEventGuardianSetUpdate } as EventGuardianSetUpdate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.old_index = reader.uint32(); - break; - case 2: - message.new_index = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventGuardianSetUpdate { - const message = { ...baseEventGuardianSetUpdate } as EventGuardianSetUpdate; - if (object.old_index !== undefined && object.old_index !== null) { - message.old_index = Number(object.old_index); - } else { - message.old_index = 0; - } - if (object.new_index !== undefined && object.new_index !== null) { - message.new_index = Number(object.new_index); - } else { - message.new_index = 0; - } - return message; - }, - - toJSON(message: EventGuardianSetUpdate): unknown { - const obj: any = {}; - message.old_index !== undefined && (obj.old_index = message.old_index); - message.new_index !== undefined && (obj.new_index = message.new_index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EventGuardianSetUpdate { - const message = { ...baseEventGuardianSetUpdate } as EventGuardianSetUpdate; - if (object.old_index !== undefined && object.old_index !== null) { - message.old_index = object.old_index; - } else { - message.old_index = 0; - } - if (object.new_index !== undefined && object.new_index !== null) { - message.new_index = object.new_index; - } else { - message.new_index = 0; - } - return message; - }, -}; - -const baseEventPostedMessage: object = { sequence: 0, nonce: 0, time: 0 }; - -export const EventPostedMessage = { - encode( - message: EventPostedMessage, - writer: Writer = Writer.create() - ): Writer { - if (message.emitter.length !== 0) { - writer.uint32(10).bytes(message.emitter); - } - if (message.sequence !== 0) { - writer.uint32(16).uint64(message.sequence); - } - if (message.nonce !== 0) { - writer.uint32(24).uint32(message.nonce); - } - if (message.time !== 0) { - writer.uint32(32).uint64(message.time); - } - if (message.payload.length !== 0) { - writer.uint32(42).bytes(message.payload); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EventPostedMessage { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEventPostedMessage } as EventPostedMessage; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.emitter = reader.bytes(); - break; - case 2: - message.sequence = longToNumber(reader.uint64() as Long); - break; - case 3: - message.nonce = reader.uint32(); - break; - case 4: - message.time = longToNumber(reader.uint64() as Long); - break; - case 5: - message.payload = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventPostedMessage { - const message = { ...baseEventPostedMessage } as EventPostedMessage; - if (object.emitter !== undefined && object.emitter !== null) { - message.emitter = bytesFromBase64(object.emitter); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - if (object.nonce !== undefined && object.nonce !== null) { - message.nonce = Number(object.nonce); - } else { - message.nonce = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = Number(object.time); - } else { - message.time = 0; - } - if (object.payload !== undefined && object.payload !== null) { - message.payload = bytesFromBase64(object.payload); - } - return message; - }, - - toJSON(message: EventPostedMessage): unknown { - const obj: any = {}; - message.emitter !== undefined && - (obj.emitter = base64FromBytes( - message.emitter !== undefined ? message.emitter : new Uint8Array() - )); - message.sequence !== undefined && (obj.sequence = message.sequence); - message.nonce !== undefined && (obj.nonce = message.nonce); - message.time !== undefined && (obj.time = message.time); - message.payload !== undefined && - (obj.payload = base64FromBytes( - message.payload !== undefined ? message.payload : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): EventPostedMessage { - const message = { ...baseEventPostedMessage } as EventPostedMessage; - if (object.emitter !== undefined && object.emitter !== null) { - message.emitter = object.emitter; - } else { - message.emitter = new Uint8Array(); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - if (object.nonce !== undefined && object.nonce !== null) { - message.nonce = object.nonce; - } else { - message.nonce = 0; - } - if (object.time !== undefined && object.time !== null) { - message.time = object.time; - } else { - message.time = 0; - } - if (object.payload !== undefined && object.payload !== null) { - message.payload = object.payload; - } else { - message.payload = new Uint8Array(); - } - return message; - }, -}; - -const baseEventGuardianRegistered: object = {}; - -export const EventGuardianRegistered = { - encode( - message: EventGuardianRegistered, - writer: Writer = Writer.create() - ): Writer { - if (message.guardian_key.length !== 0) { - writer.uint32(10).bytes(message.guardian_key); - } - if (message.validator_key.length !== 0) { - writer.uint32(18).bytes(message.validator_key); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EventGuardianRegistered { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEventGuardianRegistered, - } as EventGuardianRegistered; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardian_key = reader.bytes(); - break; - case 2: - message.validator_key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventGuardianRegistered { - const message = { - ...baseEventGuardianRegistered, - } as EventGuardianRegistered; - if (object.guardian_key !== undefined && object.guardian_key !== null) { - message.guardian_key = bytesFromBase64(object.guardian_key); - } - if (object.validator_key !== undefined && object.validator_key !== null) { - message.validator_key = bytesFromBase64(object.validator_key); - } - return message; - }, - - toJSON(message: EventGuardianRegistered): unknown { - const obj: any = {}; - message.guardian_key !== undefined && - (obj.guardian_key = base64FromBytes( - message.guardian_key !== undefined - ? message.guardian_key - : new Uint8Array() - )); - message.validator_key !== undefined && - (obj.validator_key = base64FromBytes( - message.validator_key !== undefined - ? message.validator_key - : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EventGuardianRegistered { - const message = { - ...baseEventGuardianRegistered, - } as EventGuardianRegistered; - if (object.guardian_key !== undefined && object.guardian_key !== null) { - message.guardian_key = object.guardian_key; - } else { - message.guardian_key = new Uint8Array(); - } - if (object.validator_key !== undefined && object.validator_key !== null) { - message.validator_key = object.validator_key; - } else { - message.validator_key = new Uint8Array(); - } - return message; - }, -}; - -const baseEventConsensusSetUpdate: object = { old_index: 0, new_index: 0 }; - -export const EventConsensusSetUpdate = { - encode( - message: EventConsensusSetUpdate, - writer: Writer = Writer.create() - ): Writer { - if (message.old_index !== 0) { - writer.uint32(8).uint32(message.old_index); - } - if (message.new_index !== 0) { - writer.uint32(16).uint32(message.new_index); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EventConsensusSetUpdate { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEventConsensusSetUpdate, - } as EventConsensusSetUpdate; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.old_index = reader.uint32(); - break; - case 2: - message.new_index = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventConsensusSetUpdate { - const message = { - ...baseEventConsensusSetUpdate, - } as EventConsensusSetUpdate; - if (object.old_index !== undefined && object.old_index !== null) { - message.old_index = Number(object.old_index); - } else { - message.old_index = 0; - } - if (object.new_index !== undefined && object.new_index !== null) { - message.new_index = Number(object.new_index); - } else { - message.new_index = 0; - } - return message; - }, - - toJSON(message: EventConsensusSetUpdate): unknown { - const obj: any = {}; - message.old_index !== undefined && (obj.old_index = message.old_index); - message.new_index !== undefined && (obj.new_index = message.new_index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): EventConsensusSetUpdate { - const message = { - ...baseEventConsensusSetUpdate, - } as EventConsensusSetUpdate; - if (object.old_index !== undefined && object.old_index !== null) { - message.old_index = object.old_index; - } else { - message.old_index = 0; - } - if (object.new_index !== undefined && object.new_index !== null) { - message.new_index = object.new_index; - } else { - message.new_index = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/genesis.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/genesis.ts deleted file mode 100644 index 038053af8c..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/genesis.ts +++ /dev/null @@ -1,380 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { - GuardianSet, - GuardianValidator, - ValidatorAllowedAddress, - WasmInstantiateAllowedContractCodeId, - IbcComposabilityMwContract, -} from "../wormhole/guardian"; -import { Config } from "../wormhole/config"; -import { ReplayProtection } from "../wormhole/replay_protection"; -import { SequenceCounter } from "../wormhole/sequence_counter"; -import { ConsensusGuardianSetIndex } from "../wormhole/consensus_guardian_set_index"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -/** GenesisState defines the wormhole module's genesis state. */ -export interface GenesisState { - guardianSetList: GuardianSet[]; - config: Config | undefined; - replayProtectionList: ReplayProtection[]; - sequenceCounterList: SequenceCounter[]; - consensusGuardianSetIndex: ConsensusGuardianSetIndex | undefined; - guardianValidatorList: GuardianValidator[]; - allowedAddresses: ValidatorAllowedAddress[]; - wasmInstantiateAllowlist: WasmInstantiateAllowedContractCodeId[]; - /** this line is used by starport scaffolding # genesis/proto/state */ - ibcComposabilityMwContract: IbcComposabilityMwContract | undefined; -} - -const baseGenesisState: object = {}; - -export const GenesisState = { - encode(message: GenesisState, writer: Writer = Writer.create()): Writer { - for (const v of message.guardianSetList) { - GuardianSet.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.config !== undefined) { - Config.encode(message.config, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.replayProtectionList) { - ReplayProtection.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.sequenceCounterList) { - SequenceCounter.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.consensusGuardianSetIndex !== undefined) { - ConsensusGuardianSetIndex.encode( - message.consensusGuardianSetIndex, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.guardianValidatorList) { - GuardianValidator.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.allowedAddresses) { - ValidatorAllowedAddress.encode(v!, writer.uint32(58).fork()).ldelim(); - } - for (const v of message.wasmInstantiateAllowlist) { - WasmInstantiateAllowedContractCodeId.encode( - v!, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.ibcComposabilityMwContract !== undefined) { - IbcComposabilityMwContract.encode( - message.ibcComposabilityMwContract, - writer.uint32(74).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGenesisState } as GenesisState; - message.guardianSetList = []; - message.replayProtectionList = []; - message.sequenceCounterList = []; - message.guardianValidatorList = []; - message.allowedAddresses = []; - message.wasmInstantiateAllowlist = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianSetList.push( - GuardianSet.decode(reader, reader.uint32()) - ); - break; - case 2: - message.config = Config.decode(reader, reader.uint32()); - break; - case 3: - message.replayProtectionList.push( - ReplayProtection.decode(reader, reader.uint32()) - ); - break; - case 4: - message.sequenceCounterList.push( - SequenceCounter.decode(reader, reader.uint32()) - ); - break; - case 5: - message.consensusGuardianSetIndex = ConsensusGuardianSetIndex.decode( - reader, - reader.uint32() - ); - break; - case 6: - message.guardianValidatorList.push( - GuardianValidator.decode(reader, reader.uint32()) - ); - break; - case 7: - message.allowedAddresses.push( - ValidatorAllowedAddress.decode(reader, reader.uint32()) - ); - break; - case 8: - message.wasmInstantiateAllowlist.push( - WasmInstantiateAllowedContractCodeId.decode(reader, reader.uint32()) - ); - break; - case 9: - message.ibcComposabilityMwContract = IbcComposabilityMwContract.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.guardianSetList = []; - message.replayProtectionList = []; - message.sequenceCounterList = []; - message.guardianValidatorList = []; - message.allowedAddresses = []; - message.wasmInstantiateAllowlist = []; - if ( - object.guardianSetList !== undefined && - object.guardianSetList !== null - ) { - for (const e of object.guardianSetList) { - message.guardianSetList.push(GuardianSet.fromJSON(e)); - } - } - if (object.config !== undefined && object.config !== null) { - message.config = Config.fromJSON(object.config); - } else { - message.config = undefined; - } - if ( - object.replayProtectionList !== undefined && - object.replayProtectionList !== null - ) { - for (const e of object.replayProtectionList) { - message.replayProtectionList.push(ReplayProtection.fromJSON(e)); - } - } - if ( - object.sequenceCounterList !== undefined && - object.sequenceCounterList !== null - ) { - for (const e of object.sequenceCounterList) { - message.sequenceCounterList.push(SequenceCounter.fromJSON(e)); - } - } - if ( - object.consensusGuardianSetIndex !== undefined && - object.consensusGuardianSetIndex !== null - ) { - message.consensusGuardianSetIndex = ConsensusGuardianSetIndex.fromJSON( - object.consensusGuardianSetIndex - ); - } else { - message.consensusGuardianSetIndex = undefined; - } - if ( - object.guardianValidatorList !== undefined && - object.guardianValidatorList !== null - ) { - for (const e of object.guardianValidatorList) { - message.guardianValidatorList.push(GuardianValidator.fromJSON(e)); - } - } - if ( - object.allowedAddresses !== undefined && - object.allowedAddresses !== null - ) { - for (const e of object.allowedAddresses) { - message.allowedAddresses.push(ValidatorAllowedAddress.fromJSON(e)); - } - } - if ( - object.wasmInstantiateAllowlist !== undefined && - object.wasmInstantiateAllowlist !== null - ) { - for (const e of object.wasmInstantiateAllowlist) { - message.wasmInstantiateAllowlist.push( - WasmInstantiateAllowedContractCodeId.fromJSON(e) - ); - } - } - if ( - object.ibcComposabilityMwContract !== undefined && - object.ibcComposabilityMwContract !== null - ) { - message.ibcComposabilityMwContract = IbcComposabilityMwContract.fromJSON( - object.ibcComposabilityMwContract - ); - } else { - message.ibcComposabilityMwContract = undefined; - } - return message; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - if (message.guardianSetList) { - obj.guardianSetList = message.guardianSetList.map((e) => - e ? GuardianSet.toJSON(e) : undefined - ); - } else { - obj.guardianSetList = []; - } - message.config !== undefined && - (obj.config = message.config ? Config.toJSON(message.config) : undefined); - if (message.replayProtectionList) { - obj.replayProtectionList = message.replayProtectionList.map((e) => - e ? ReplayProtection.toJSON(e) : undefined - ); - } else { - obj.replayProtectionList = []; - } - if (message.sequenceCounterList) { - obj.sequenceCounterList = message.sequenceCounterList.map((e) => - e ? SequenceCounter.toJSON(e) : undefined - ); - } else { - obj.sequenceCounterList = []; - } - message.consensusGuardianSetIndex !== undefined && - (obj.consensusGuardianSetIndex = message.consensusGuardianSetIndex - ? ConsensusGuardianSetIndex.toJSON(message.consensusGuardianSetIndex) - : undefined); - if (message.guardianValidatorList) { - obj.guardianValidatorList = message.guardianValidatorList.map((e) => - e ? GuardianValidator.toJSON(e) : undefined - ); - } else { - obj.guardianValidatorList = []; - } - if (message.allowedAddresses) { - obj.allowedAddresses = message.allowedAddresses.map((e) => - e ? ValidatorAllowedAddress.toJSON(e) : undefined - ); - } else { - obj.allowedAddresses = []; - } - if (message.wasmInstantiateAllowlist) { - obj.wasmInstantiateAllowlist = message.wasmInstantiateAllowlist.map((e) => - e ? WasmInstantiateAllowedContractCodeId.toJSON(e) : undefined - ); - } else { - obj.wasmInstantiateAllowlist = []; - } - message.ibcComposabilityMwContract !== undefined && - (obj.ibcComposabilityMwContract = message.ibcComposabilityMwContract - ? IbcComposabilityMwContract.toJSON(message.ibcComposabilityMwContract) - : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = { ...baseGenesisState } as GenesisState; - message.guardianSetList = []; - message.replayProtectionList = []; - message.sequenceCounterList = []; - message.guardianValidatorList = []; - message.allowedAddresses = []; - message.wasmInstantiateAllowlist = []; - if ( - object.guardianSetList !== undefined && - object.guardianSetList !== null - ) { - for (const e of object.guardianSetList) { - message.guardianSetList.push(GuardianSet.fromPartial(e)); - } - } - if (object.config !== undefined && object.config !== null) { - message.config = Config.fromPartial(object.config); - } else { - message.config = undefined; - } - if ( - object.replayProtectionList !== undefined && - object.replayProtectionList !== null - ) { - for (const e of object.replayProtectionList) { - message.replayProtectionList.push(ReplayProtection.fromPartial(e)); - } - } - if ( - object.sequenceCounterList !== undefined && - object.sequenceCounterList !== null - ) { - for (const e of object.sequenceCounterList) { - message.sequenceCounterList.push(SequenceCounter.fromPartial(e)); - } - } - if ( - object.consensusGuardianSetIndex !== undefined && - object.consensusGuardianSetIndex !== null - ) { - message.consensusGuardianSetIndex = ConsensusGuardianSetIndex.fromPartial( - object.consensusGuardianSetIndex - ); - } else { - message.consensusGuardianSetIndex = undefined; - } - if ( - object.guardianValidatorList !== undefined && - object.guardianValidatorList !== null - ) { - for (const e of object.guardianValidatorList) { - message.guardianValidatorList.push(GuardianValidator.fromPartial(e)); - } - } - if ( - object.allowedAddresses !== undefined && - object.allowedAddresses !== null - ) { - for (const e of object.allowedAddresses) { - message.allowedAddresses.push(ValidatorAllowedAddress.fromPartial(e)); - } - } - if ( - object.wasmInstantiateAllowlist !== undefined && - object.wasmInstantiateAllowlist !== null - ) { - for (const e of object.wasmInstantiateAllowlist) { - message.wasmInstantiateAllowlist.push( - WasmInstantiateAllowedContractCodeId.fromPartial(e) - ); - } - } - if ( - object.ibcComposabilityMwContract !== undefined && - object.ibcComposabilityMwContract !== null - ) { - message.ibcComposabilityMwContract = IbcComposabilityMwContract.fromPartial( - object.ibcComposabilityMwContract - ); - } else { - message.ibcComposabilityMwContract = undefined; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/governance.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/governance.ts deleted file mode 100644 index a7e25f64b3..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/governance.ts +++ /dev/null @@ -1,343 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { GuardianSet } from "../wormhole/guardian"; -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -/** GuardianSetUpdateProposal defines a guardian set update governance proposal */ -export interface GuardianSetUpdateProposal { - title: string; - description: string; - newGuardianSet: GuardianSet | undefined; -} - -/** - * GovernanceWormholeMessageProposal defines a governance proposal to emit a generic message in the governance message - * format. - */ -export interface GovernanceWormholeMessageProposal { - title: string; - description: string; - action: number; - module: Uint8Array; - targetChain: number; - payload: Uint8Array; -} - -const baseGuardianSetUpdateProposal: object = { title: "", description: "" }; - -export const GuardianSetUpdateProposal = { - encode( - message: GuardianSetUpdateProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.newGuardianSet !== undefined) { - GuardianSet.encode( - message.newGuardianSet, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GuardianSetUpdateProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGuardianSetUpdateProposal, - } as GuardianSetUpdateProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.newGuardianSet = GuardianSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianSetUpdateProposal { - const message = { - ...baseGuardianSetUpdateProposal, - } as GuardianSetUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.newGuardianSet !== undefined && object.newGuardianSet !== null) { - message.newGuardianSet = GuardianSet.fromJSON(object.newGuardianSet); - } else { - message.newGuardianSet = undefined; - } - return message; - }, - - toJSON(message: GuardianSetUpdateProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.newGuardianSet !== undefined && - (obj.newGuardianSet = message.newGuardianSet - ? GuardianSet.toJSON(message.newGuardianSet) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GuardianSetUpdateProposal { - const message = { - ...baseGuardianSetUpdateProposal, - } as GuardianSetUpdateProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.newGuardianSet !== undefined && object.newGuardianSet !== null) { - message.newGuardianSet = GuardianSet.fromPartial(object.newGuardianSet); - } else { - message.newGuardianSet = undefined; - } - return message; - }, -}; - -const baseGovernanceWormholeMessageProposal: object = { - title: "", - description: "", - action: 0, - targetChain: 0, -}; - -export const GovernanceWormholeMessageProposal = { - encode( - message: GovernanceWormholeMessageProposal, - writer: Writer = Writer.create() - ): Writer { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.action !== 0) { - writer.uint32(24).uint32(message.action); - } - if (message.module.length !== 0) { - writer.uint32(34).bytes(message.module); - } - if (message.targetChain !== 0) { - writer.uint32(40).uint32(message.targetChain); - } - if (message.payload.length !== 0) { - writer.uint32(50).bytes(message.payload); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): GovernanceWormholeMessageProposal { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseGovernanceWormholeMessageProposal, - } as GovernanceWormholeMessageProposal; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.action = reader.uint32(); - break; - case 4: - message.module = reader.bytes(); - break; - case 5: - message.targetChain = reader.uint32(); - break; - case 6: - message.payload = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GovernanceWormholeMessageProposal { - const message = { - ...baseGovernanceWormholeMessageProposal, - } as GovernanceWormholeMessageProposal; - if (object.title !== undefined && object.title !== null) { - message.title = String(object.title); - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = String(object.description); - } else { - message.description = ""; - } - if (object.action !== undefined && object.action !== null) { - message.action = Number(object.action); - } else { - message.action = 0; - } - if (object.module !== undefined && object.module !== null) { - message.module = bytesFromBase64(object.module); - } - if (object.targetChain !== undefined && object.targetChain !== null) { - message.targetChain = Number(object.targetChain); - } else { - message.targetChain = 0; - } - if (object.payload !== undefined && object.payload !== null) { - message.payload = bytesFromBase64(object.payload); - } - return message; - }, - - toJSON(message: GovernanceWormholeMessageProposal): unknown { - const obj: any = {}; - message.title !== undefined && (obj.title = message.title); - message.description !== undefined && - (obj.description = message.description); - message.action !== undefined && (obj.action = message.action); - message.module !== undefined && - (obj.module = base64FromBytes( - message.module !== undefined ? message.module : new Uint8Array() - )); - message.targetChain !== undefined && - (obj.targetChain = message.targetChain); - message.payload !== undefined && - (obj.payload = base64FromBytes( - message.payload !== undefined ? message.payload : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): GovernanceWormholeMessageProposal { - const message = { - ...baseGovernanceWormholeMessageProposal, - } as GovernanceWormholeMessageProposal; - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } else { - message.title = ""; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } else { - message.description = ""; - } - if (object.action !== undefined && object.action !== null) { - message.action = object.action; - } else { - message.action = 0; - } - if (object.module !== undefined && object.module !== null) { - message.module = object.module; - } else { - message.module = new Uint8Array(); - } - if (object.targetChain !== undefined && object.targetChain !== null) { - message.targetChain = object.targetChain; - } else { - message.targetChain = 0; - } - if (object.payload !== undefined && object.payload !== null) { - message.payload = object.payload; - } else { - message.payload = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian.ts deleted file mode 100644 index 684578512c..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian.ts +++ /dev/null @@ -1,621 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface GuardianKey { - key: Uint8Array; -} - -export interface GuardianValidator { - guardianKey: Uint8Array; - validatorAddr: Uint8Array; -} - -export interface GuardianSet { - index: number; - keys: Uint8Array[]; - expirationTime: number; -} - -export interface ValidatorAllowedAddress { - /** the validator/guardian that controls this entry */ - validator_address: string; - /** the allowlisted account */ - allowed_address: string; - /** human readable name */ - name: string; -} - -export interface WasmInstantiateAllowedContractCodeId { - /** bech32 address of the contract that can call wasm instantiate without a VAA */ - contract_address: string; - /** reference to the stored WASM code that can be instantiated */ - code_id: number; -} - -export interface IbcComposabilityMwContract { - /** bech32 address of the contract that is used by the ibc composability middleware */ - contract_address: string; -} - -const baseGuardianKey: object = {}; - -export const GuardianKey = { - encode(message: GuardianKey, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianKey } as GuardianKey; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianKey { - const message = { ...baseGuardianKey } as GuardianKey; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - - toJSON(message: GuardianKey): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianKey { - const message = { ...baseGuardianKey } as GuardianKey; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - return message; - }, -}; - -const baseGuardianValidator: object = {}; - -export const GuardianValidator = { - encode(message: GuardianValidator, writer: Writer = Writer.create()): Writer { - if (message.guardianKey.length !== 0) { - writer.uint32(10).bytes(message.guardianKey); - } - if (message.validatorAddr.length !== 0) { - writer.uint32(18).bytes(message.validatorAddr); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianValidator } as GuardianValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianKey = reader.bytes(); - break; - case 2: - message.validatorAddr = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianValidator { - const message = { ...baseGuardianValidator } as GuardianValidator; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = bytesFromBase64(object.guardianKey); - } - if (object.validatorAddr !== undefined && object.validatorAddr !== null) { - message.validatorAddr = bytesFromBase64(object.validatorAddr); - } - return message; - }, - - toJSON(message: GuardianValidator): unknown { - const obj: any = {}; - message.guardianKey !== undefined && - (obj.guardianKey = base64FromBytes( - message.guardianKey !== undefined - ? message.guardianKey - : new Uint8Array() - )); - message.validatorAddr !== undefined && - (obj.validatorAddr = base64FromBytes( - message.validatorAddr !== undefined - ? message.validatorAddr - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianValidator { - const message = { ...baseGuardianValidator } as GuardianValidator; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = object.guardianKey; - } else { - message.guardianKey = new Uint8Array(); - } - if (object.validatorAddr !== undefined && object.validatorAddr !== null) { - message.validatorAddr = object.validatorAddr; - } else { - message.validatorAddr = new Uint8Array(); - } - return message; - }, -}; - -const baseGuardianSet: object = { index: 0, expirationTime: 0 }; - -export const GuardianSet = { - encode(message: GuardianSet, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - for (const v of message.keys) { - writer.uint32(18).bytes(v!); - } - if (message.expirationTime !== 0) { - writer.uint32(24).uint64(message.expirationTime); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.keys.push(reader.bytes()); - break; - case 3: - message.expirationTime = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianSet { - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(bytesFromBase64(e)); - } - } - if (object.expirationTime !== undefined && object.expirationTime !== null) { - message.expirationTime = Number(object.expirationTime); - } else { - message.expirationTime = 0; - } - return message; - }, - - toJSON(message: GuardianSet): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - if (message.keys) { - obj.keys = message.keys.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.keys = []; - } - message.expirationTime !== undefined && - (obj.expirationTime = message.expirationTime); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianSet { - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(e); - } - } - if (object.expirationTime !== undefined && object.expirationTime !== null) { - message.expirationTime = object.expirationTime; - } else { - message.expirationTime = 0; - } - return message; - }, -}; - -const baseValidatorAllowedAddress: object = { - validator_address: "", - allowed_address: "", - name: "", -}; - -export const ValidatorAllowedAddress = { - encode( - message: ValidatorAllowedAddress, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.allowed_address !== "") { - writer.uint32(18).string(message.allowed_address); - } - if (message.name !== "") { - writer.uint32(26).string(message.name); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ValidatorAllowedAddress { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseValidatorAllowedAddress, - } as ValidatorAllowedAddress; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.allowed_address = reader.string(); - break; - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ValidatorAllowedAddress { - const message = { - ...baseValidatorAllowedAddress, - } as ValidatorAllowedAddress; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if ( - object.allowed_address !== undefined && - object.allowed_address !== null - ) { - message.allowed_address = String(object.allowed_address); - } else { - message.allowed_address = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - return message; - }, - - toJSON(message: ValidatorAllowedAddress): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.allowed_address !== undefined && - (obj.allowed_address = message.allowed_address); - message.name !== undefined && (obj.name = message.name); - return obj; - }, - - fromPartial( - object: DeepPartial - ): ValidatorAllowedAddress { - const message = { - ...baseValidatorAllowedAddress, - } as ValidatorAllowedAddress; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if ( - object.allowed_address !== undefined && - object.allowed_address !== null - ) { - message.allowed_address = object.allowed_address; - } else { - message.allowed_address = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - return message; - }, -}; - -const baseWasmInstantiateAllowedContractCodeId: object = { - contract_address: "", - code_id: 0, -}; - -export const WasmInstantiateAllowedContractCodeId = { - encode( - message: WasmInstantiateAllowedContractCodeId, - writer: Writer = Writer.create() - ): Writer { - if (message.contract_address !== "") { - writer.uint32(10).string(message.contract_address); - } - if (message.code_id !== 0) { - writer.uint32(16).uint64(message.code_id); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): WasmInstantiateAllowedContractCodeId { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseWasmInstantiateAllowedContractCodeId, - } as WasmInstantiateAllowedContractCodeId; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contract_address = reader.string(); - break; - case 2: - message.code_id = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): WasmInstantiateAllowedContractCodeId { - const message = { - ...baseWasmInstantiateAllowedContractCodeId, - } as WasmInstantiateAllowedContractCodeId; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = String(object.contract_address); - } else { - message.contract_address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - return message; - }, - - toJSON(message: WasmInstantiateAllowedContractCodeId): unknown { - const obj: any = {}; - message.contract_address !== undefined && - (obj.contract_address = message.contract_address); - message.code_id !== undefined && (obj.code_id = message.code_id); - return obj; - }, - - fromPartial( - object: DeepPartial - ): WasmInstantiateAllowedContractCodeId { - const message = { - ...baseWasmInstantiateAllowedContractCodeId, - } as WasmInstantiateAllowedContractCodeId; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = object.contract_address; - } else { - message.contract_address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - return message; - }, -}; - -const baseIbcComposabilityMwContract: object = { contract_address: "" }; - -export const IbcComposabilityMwContract = { - encode( - message: IbcComposabilityMwContract, - writer: Writer = Writer.create() - ): Writer { - if (message.contract_address !== "") { - writer.uint32(10).string(message.contract_address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): IbcComposabilityMwContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseIbcComposabilityMwContract, - } as IbcComposabilityMwContract; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contract_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): IbcComposabilityMwContract { - const message = { - ...baseIbcComposabilityMwContract, - } as IbcComposabilityMwContract; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = String(object.contract_address); - } else { - message.contract_address = ""; - } - return message; - }, - - toJSON(message: IbcComposabilityMwContract): unknown { - const obj: any = {}; - message.contract_address !== undefined && - (obj.contract_address = message.contract_address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): IbcComposabilityMwContract { - const message = { - ...baseIbcComposabilityMwContract, - } as IbcComposabilityMwContract; - if ( - object.contract_address !== undefined && - object.contract_address !== null - ) { - message.contract_address = object.contract_address; - } else { - message.contract_address = ""; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_key.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_key.ts deleted file mode 100644 index 3273ed0878..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_key.ts +++ /dev/null @@ -1,110 +0,0 @@ -//@ts-nocheck -//@ts-nocheck -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface GuardianKey { - key: Uint8Array; -} - -const baseGuardianKey: object = {}; - -export const GuardianKey = { - encode(message: GuardianKey, writer: Writer = Writer.create()): Writer { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianKey { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianKey } as GuardianKey; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianKey { - const message = { ...baseGuardianKey } as GuardianKey; - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - - toJSON(message: GuardianKey): unknown { - const obj: any = {}; - message.key !== undefined && - (obj.key = base64FromBytes( - message.key !== undefined ? message.key : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianKey { - const message = { ...baseGuardianKey } as GuardianKey; - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } else { - message.key = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_set.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_set.ts deleted file mode 100644 index 5d6b49bbe1..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_set.ts +++ /dev/null @@ -1,168 +0,0 @@ -//@ts-nocheck -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface GuardianSet { - index: number; - keys: Uint8Array[]; - expirationTime: number; -} - -const baseGuardianSet: object = { index: 0, expirationTime: 0 }; - -export const GuardianSet = { - encode(message: GuardianSet, writer: Writer = Writer.create()): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - for (const v of message.keys) { - writer.uint32(18).bytes(v!); - } - if (message.expirationTime !== 0) { - writer.uint32(24).uint64(message.expirationTime); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianSet { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.keys.push(reader.bytes()); - break; - case 3: - message.expirationTime = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianSet { - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(bytesFromBase64(e)); - } - } - if (object.expirationTime !== undefined && object.expirationTime !== null) { - message.expirationTime = Number(object.expirationTime); - } else { - message.expirationTime = 0; - } - return message; - }, - - toJSON(message: GuardianSet): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - if (message.keys) { - obj.keys = message.keys.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array()) - ); - } else { - obj.keys = []; - } - message.expirationTime !== undefined && - (obj.expirationTime = message.expirationTime); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianSet { - const message = { ...baseGuardianSet } as GuardianSet; - message.keys = []; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - if (object.keys !== undefined && object.keys !== null) { - for (const e of object.keys) { - message.keys.push(e); - } - } - if (object.expirationTime !== undefined && object.expirationTime !== null) { - message.expirationTime = object.expirationTime; - } else { - message.expirationTime = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_validator.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_validator.ts deleted file mode 100644 index b216a67ed8..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/guardian_validator.ts +++ /dev/null @@ -1,133 +0,0 @@ -//@ts-nocheck -//@ts-nocheck -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface GuardianValidator { - guardianKey: Uint8Array; - validatorAddr: Uint8Array; -} - -const baseGuardianValidator: object = {}; - -export const GuardianValidator = { - encode(message: GuardianValidator, writer: Writer = Writer.create()): Writer { - if (message.guardianKey.length !== 0) { - writer.uint32(10).bytes(message.guardianKey); - } - if (message.validatorAddr.length !== 0) { - writer.uint32(18).bytes(message.validatorAddr); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): GuardianValidator { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGuardianValidator } as GuardianValidator; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianKey = reader.bytes(); - break; - case 2: - message.validatorAddr = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GuardianValidator { - const message = { ...baseGuardianValidator } as GuardianValidator; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = bytesFromBase64(object.guardianKey); - } - if (object.validatorAddr !== undefined && object.validatorAddr !== null) { - message.validatorAddr = bytesFromBase64(object.validatorAddr); - } - return message; - }, - - toJSON(message: GuardianValidator): unknown { - const obj: any = {}; - message.guardianKey !== undefined && - (obj.guardianKey = base64FromBytes( - message.guardianKey !== undefined - ? message.guardianKey - : new Uint8Array() - )); - message.validatorAddr !== undefined && - (obj.validatorAddr = base64FromBytes( - message.validatorAddr !== undefined - ? message.validatorAddr - : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): GuardianValidator { - const message = { ...baseGuardianValidator } as GuardianValidator; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = object.guardianKey; - } else { - message.guardianKey = new Uint8Array(); - } - if (object.validatorAddr !== undefined && object.validatorAddr !== null) { - message.validatorAddr = object.validatorAddr; - } else { - message.validatorAddr = new Uint8Array(); - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/query.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/query.ts deleted file mode 100644 index 3e88e4abc7..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/query.ts +++ /dev/null @@ -1,2881 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; -import { - PageRequest, - PageResponse, -} from "../cosmos/base/query/v1beta1/pagination"; -import { - ValidatorAllowedAddress, - GuardianSet, - GuardianValidator, - WasmInstantiateAllowedContractCodeId, -} from "../wormhole/guardian"; -import { Config } from "../wormhole/config"; -import { ReplayProtection } from "../wormhole/replay_protection"; -import { SequenceCounter } from "../wormhole/sequence_counter"; -import { ConsensusGuardianSetIndex } from "../wormhole/consensus_guardian_set_index"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface QueryAllValidatorAllowlist { - pagination: PageRequest | undefined; -} - -/** all allowlisted entries by all validators */ -export interface QueryAllValidatorAllowlistResponse { - allowlist: ValidatorAllowedAddress[]; - pagination: PageResponse | undefined; -} - -export interface QueryValidatorAllowlist { - validator_address: string; - pagination: PageRequest | undefined; -} - -/** all allowlisted entries by a specific validator */ -export interface QueryValidatorAllowlistResponse { - validator_address: string; - allowlist: ValidatorAllowedAddress[]; - pagination: PageResponse | undefined; -} - -export interface QueryGetGuardianSetRequest { - index: number; -} - -export interface QueryGetGuardianSetResponse { - GuardianSet: GuardianSet | undefined; -} - -export interface QueryAllGuardianSetRequest { - pagination: PageRequest | undefined; -} - -export interface QueryAllGuardianSetResponse { - GuardianSet: GuardianSet[]; - pagination: PageResponse | undefined; -} - -export interface QueryGetConfigRequest {} - -export interface QueryGetConfigResponse { - Config: Config | undefined; -} - -export interface QueryGetReplayProtectionRequest { - index: string; -} - -export interface QueryGetReplayProtectionResponse { - replayProtection: ReplayProtection | undefined; -} - -export interface QueryAllReplayProtectionRequest { - pagination: PageRequest | undefined; -} - -export interface QueryAllReplayProtectionResponse { - replayProtection: ReplayProtection[]; - pagination: PageResponse | undefined; -} - -export interface QueryGetSequenceCounterRequest { - index: string; -} - -export interface QueryGetSequenceCounterResponse { - sequenceCounter: SequenceCounter | undefined; -} - -export interface QueryAllSequenceCounterRequest { - pagination: PageRequest | undefined; -} - -export interface QueryAllSequenceCounterResponse { - sequenceCounter: SequenceCounter[]; - pagination: PageResponse | undefined; -} - -export interface QueryGetConsensusGuardianSetIndexRequest {} - -export interface QueryGetConsensusGuardianSetIndexResponse { - ConsensusGuardianSetIndex: ConsensusGuardianSetIndex | undefined; -} - -export interface QueryGetGuardianValidatorRequest { - guardianKey: Uint8Array; -} - -export interface QueryGetGuardianValidatorResponse { - guardianValidator: GuardianValidator | undefined; -} - -export interface QueryAllGuardianValidatorRequest { - pagination: PageRequest | undefined; -} - -export interface QueryAllGuardianValidatorResponse { - guardianValidator: GuardianValidator[]; - pagination: PageResponse | undefined; -} - -export interface QueryLatestGuardianSetIndexRequest {} - -export interface QueryLatestGuardianSetIndexResponse { - latestGuardianSetIndex: number; -} - -export interface QueryIbcComposabilityMwContractRequest {} - -export interface QueryIbcComposabilityMwContractResponse { - contractAddress: string; -} - -export interface QueryAllWasmInstantiateAllowlist { - pagination: PageRequest | undefined; -} - -/** all allowlisted entries by all validators */ -export interface QueryAllWasmInstantiateAllowlistResponse { - allowlist: WasmInstantiateAllowedContractCodeId[]; - pagination: PageResponse | undefined; -} - -const baseQueryAllValidatorAllowlist: object = {}; - -export const QueryAllValidatorAllowlist = { - encode( - message: QueryAllValidatorAllowlist, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllValidatorAllowlist { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllValidatorAllowlist, - } as QueryAllValidatorAllowlist; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllValidatorAllowlist { - const message = { - ...baseQueryAllValidatorAllowlist, - } as QueryAllValidatorAllowlist; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllValidatorAllowlist): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllValidatorAllowlist { - const message = { - ...baseQueryAllValidatorAllowlist, - } as QueryAllValidatorAllowlist; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllValidatorAllowlistResponse: object = {}; - -export const QueryAllValidatorAllowlistResponse = { - encode( - message: QueryAllValidatorAllowlistResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.allowlist) { - ValidatorAllowedAddress.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllValidatorAllowlistResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllValidatorAllowlistResponse, - } as QueryAllValidatorAllowlistResponse; - message.allowlist = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowlist.push( - ValidatorAllowedAddress.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllValidatorAllowlistResponse { - const message = { - ...baseQueryAllValidatorAllowlistResponse, - } as QueryAllValidatorAllowlistResponse; - message.allowlist = []; - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push(ValidatorAllowedAddress.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllValidatorAllowlistResponse): unknown { - const obj: any = {}; - if (message.allowlist) { - obj.allowlist = message.allowlist.map((e) => - e ? ValidatorAllowedAddress.toJSON(e) : undefined - ); - } else { - obj.allowlist = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllValidatorAllowlistResponse { - const message = { - ...baseQueryAllValidatorAllowlistResponse, - } as QueryAllValidatorAllowlistResponse; - message.allowlist = []; - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push(ValidatorAllowedAddress.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorAllowlist: object = { validator_address: "" }; - -export const QueryValidatorAllowlist = { - encode( - message: QueryValidatorAllowlist, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryValidatorAllowlist { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorAllowlist, - } as QueryValidatorAllowlist; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorAllowlist { - const message = { - ...baseQueryValidatorAllowlist, - } as QueryValidatorAllowlist; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorAllowlist): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorAllowlist { - const message = { - ...baseQueryValidatorAllowlist, - } as QueryValidatorAllowlist; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryValidatorAllowlistResponse: object = { validator_address: "" }; - -export const QueryValidatorAllowlistResponse = { - encode( - message: QueryValidatorAllowlistResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.validator_address !== "") { - writer.uint32(10).string(message.validator_address); - } - for (const v of message.allowlist) { - ValidatorAllowedAddress.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryValidatorAllowlistResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryValidatorAllowlistResponse, - } as QueryValidatorAllowlistResponse; - message.allowlist = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator_address = reader.string(); - break; - case 2: - message.allowlist.push( - ValidatorAllowedAddress.decode(reader, reader.uint32()) - ); - break; - case 3: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryValidatorAllowlistResponse { - const message = { - ...baseQueryValidatorAllowlistResponse, - } as QueryValidatorAllowlistResponse; - message.allowlist = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = String(object.validator_address); - } else { - message.validator_address = ""; - } - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push(ValidatorAllowedAddress.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryValidatorAllowlistResponse): unknown { - const obj: any = {}; - message.validator_address !== undefined && - (obj.validator_address = message.validator_address); - if (message.allowlist) { - obj.allowlist = message.allowlist.map((e) => - e ? ValidatorAllowedAddress.toJSON(e) : undefined - ); - } else { - obj.allowlist = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryValidatorAllowlistResponse { - const message = { - ...baseQueryValidatorAllowlistResponse, - } as QueryValidatorAllowlistResponse; - message.allowlist = []; - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validator_address = object.validator_address; - } else { - message.validator_address = ""; - } - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push(ValidatorAllowedAddress.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryGetGuardianSetRequest: object = { index: 0 }; - -export const QueryGetGuardianSetRequest = { - encode( - message: QueryGetGuardianSetRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.index !== 0) { - writer.uint32(8).uint32(message.index); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetGuardianSetRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetGuardianSetRequest, - } as QueryGetGuardianSetRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetGuardianSetRequest { - const message = { - ...baseQueryGetGuardianSetRequest, - } as QueryGetGuardianSetRequest; - if (object.index !== undefined && object.index !== null) { - message.index = Number(object.index); - } else { - message.index = 0; - } - return message; - }, - - toJSON(message: QueryGetGuardianSetRequest): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetGuardianSetRequest { - const message = { - ...baseQueryGetGuardianSetRequest, - } as QueryGetGuardianSetRequest; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = 0; - } - return message; - }, -}; - -const baseQueryGetGuardianSetResponse: object = {}; - -export const QueryGetGuardianSetResponse = { - encode( - message: QueryGetGuardianSetResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.GuardianSet !== undefined) { - GuardianSet.encode( - message.GuardianSet, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetGuardianSetResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetGuardianSetResponse, - } as QueryGetGuardianSetResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.GuardianSet = GuardianSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetGuardianSetResponse { - const message = { - ...baseQueryGetGuardianSetResponse, - } as QueryGetGuardianSetResponse; - if (object.GuardianSet !== undefined && object.GuardianSet !== null) { - message.GuardianSet = GuardianSet.fromJSON(object.GuardianSet); - } else { - message.GuardianSet = undefined; - } - return message; - }, - - toJSON(message: QueryGetGuardianSetResponse): unknown { - const obj: any = {}; - message.GuardianSet !== undefined && - (obj.GuardianSet = message.GuardianSet - ? GuardianSet.toJSON(message.GuardianSet) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetGuardianSetResponse { - const message = { - ...baseQueryGetGuardianSetResponse, - } as QueryGetGuardianSetResponse; - if (object.GuardianSet !== undefined && object.GuardianSet !== null) { - message.GuardianSet = GuardianSet.fromPartial(object.GuardianSet); - } else { - message.GuardianSet = undefined; - } - return message; - }, -}; - -const baseQueryAllGuardianSetRequest: object = {}; - -export const QueryAllGuardianSetRequest = { - encode( - message: QueryAllGuardianSetRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllGuardianSetRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllGuardianSetRequest, - } as QueryAllGuardianSetRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllGuardianSetRequest { - const message = { - ...baseQueryAllGuardianSetRequest, - } as QueryAllGuardianSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllGuardianSetRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllGuardianSetRequest { - const message = { - ...baseQueryAllGuardianSetRequest, - } as QueryAllGuardianSetRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllGuardianSetResponse: object = {}; - -export const QueryAllGuardianSetResponse = { - encode( - message: QueryAllGuardianSetResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.GuardianSet) { - GuardianSet.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllGuardianSetResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllGuardianSetResponse, - } as QueryAllGuardianSetResponse; - message.GuardianSet = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.GuardianSet.push(GuardianSet.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllGuardianSetResponse { - const message = { - ...baseQueryAllGuardianSetResponse, - } as QueryAllGuardianSetResponse; - message.GuardianSet = []; - if (object.GuardianSet !== undefined && object.GuardianSet !== null) { - for (const e of object.GuardianSet) { - message.GuardianSet.push(GuardianSet.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllGuardianSetResponse): unknown { - const obj: any = {}; - if (message.GuardianSet) { - obj.GuardianSet = message.GuardianSet.map((e) => - e ? GuardianSet.toJSON(e) : undefined - ); - } else { - obj.GuardianSet = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllGuardianSetResponse { - const message = { - ...baseQueryAllGuardianSetResponse, - } as QueryAllGuardianSetResponse; - message.GuardianSet = []; - if (object.GuardianSet !== undefined && object.GuardianSet !== null) { - for (const e of object.GuardianSet) { - message.GuardianSet.push(GuardianSet.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryGetConfigRequest: object = {}; - -export const QueryGetConfigRequest = { - encode(_: QueryGetConfigRequest, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryGetConfigRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryGetConfigRequest } as QueryGetConfigRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryGetConfigRequest { - const message = { ...baseQueryGetConfigRequest } as QueryGetConfigRequest; - return message; - }, - - toJSON(_: QueryGetConfigRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): QueryGetConfigRequest { - const message = { ...baseQueryGetConfigRequest } as QueryGetConfigRequest; - return message; - }, -}; - -const baseQueryGetConfigResponse: object = {}; - -export const QueryGetConfigResponse = { - encode( - message: QueryGetConfigResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.Config !== undefined) { - Config.encode(message.Config, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): QueryGetConfigResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseQueryGetConfigResponse } as QueryGetConfigResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.Config = Config.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetConfigResponse { - const message = { ...baseQueryGetConfigResponse } as QueryGetConfigResponse; - if (object.Config !== undefined && object.Config !== null) { - message.Config = Config.fromJSON(object.Config); - } else { - message.Config = undefined; - } - return message; - }, - - toJSON(message: QueryGetConfigResponse): unknown { - const obj: any = {}; - message.Config !== undefined && - (obj.Config = message.Config ? Config.toJSON(message.Config) : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetConfigResponse { - const message = { ...baseQueryGetConfigResponse } as QueryGetConfigResponse; - if (object.Config !== undefined && object.Config !== null) { - message.Config = Config.fromPartial(object.Config); - } else { - message.Config = undefined; - } - return message; - }, -}; - -const baseQueryGetReplayProtectionRequest: object = { index: "" }; - -export const QueryGetReplayProtectionRequest = { - encode( - message: QueryGetReplayProtectionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.index !== "") { - writer.uint32(10).string(message.index); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetReplayProtectionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetReplayProtectionRequest, - } as QueryGetReplayProtectionRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetReplayProtectionRequest { - const message = { - ...baseQueryGetReplayProtectionRequest, - } as QueryGetReplayProtectionRequest; - if (object.index !== undefined && object.index !== null) { - message.index = String(object.index); - } else { - message.index = ""; - } - return message; - }, - - toJSON(message: QueryGetReplayProtectionRequest): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetReplayProtectionRequest { - const message = { - ...baseQueryGetReplayProtectionRequest, - } as QueryGetReplayProtectionRequest; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = ""; - } - return message; - }, -}; - -const baseQueryGetReplayProtectionResponse: object = {}; - -export const QueryGetReplayProtectionResponse = { - encode( - message: QueryGetReplayProtectionResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.replayProtection !== undefined) { - ReplayProtection.encode( - message.replayProtection, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetReplayProtectionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetReplayProtectionResponse, - } as QueryGetReplayProtectionResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.replayProtection = ReplayProtection.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetReplayProtectionResponse { - const message = { - ...baseQueryGetReplayProtectionResponse, - } as QueryGetReplayProtectionResponse; - if ( - object.replayProtection !== undefined && - object.replayProtection !== null - ) { - message.replayProtection = ReplayProtection.fromJSON( - object.replayProtection - ); - } else { - message.replayProtection = undefined; - } - return message; - }, - - toJSON(message: QueryGetReplayProtectionResponse): unknown { - const obj: any = {}; - message.replayProtection !== undefined && - (obj.replayProtection = message.replayProtection - ? ReplayProtection.toJSON(message.replayProtection) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetReplayProtectionResponse { - const message = { - ...baseQueryGetReplayProtectionResponse, - } as QueryGetReplayProtectionResponse; - if ( - object.replayProtection !== undefined && - object.replayProtection !== null - ) { - message.replayProtection = ReplayProtection.fromPartial( - object.replayProtection - ); - } else { - message.replayProtection = undefined; - } - return message; - }, -}; - -const baseQueryAllReplayProtectionRequest: object = {}; - -export const QueryAllReplayProtectionRequest = { - encode( - message: QueryAllReplayProtectionRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllReplayProtectionRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllReplayProtectionRequest, - } as QueryAllReplayProtectionRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllReplayProtectionRequest { - const message = { - ...baseQueryAllReplayProtectionRequest, - } as QueryAllReplayProtectionRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllReplayProtectionRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllReplayProtectionRequest { - const message = { - ...baseQueryAllReplayProtectionRequest, - } as QueryAllReplayProtectionRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllReplayProtectionResponse: object = {}; - -export const QueryAllReplayProtectionResponse = { - encode( - message: QueryAllReplayProtectionResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.replayProtection) { - ReplayProtection.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllReplayProtectionResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllReplayProtectionResponse, - } as QueryAllReplayProtectionResponse; - message.replayProtection = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.replayProtection.push( - ReplayProtection.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllReplayProtectionResponse { - const message = { - ...baseQueryAllReplayProtectionResponse, - } as QueryAllReplayProtectionResponse; - message.replayProtection = []; - if ( - object.replayProtection !== undefined && - object.replayProtection !== null - ) { - for (const e of object.replayProtection) { - message.replayProtection.push(ReplayProtection.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllReplayProtectionResponse): unknown { - const obj: any = {}; - if (message.replayProtection) { - obj.replayProtection = message.replayProtection.map((e) => - e ? ReplayProtection.toJSON(e) : undefined - ); - } else { - obj.replayProtection = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllReplayProtectionResponse { - const message = { - ...baseQueryAllReplayProtectionResponse, - } as QueryAllReplayProtectionResponse; - message.replayProtection = []; - if ( - object.replayProtection !== undefined && - object.replayProtection !== null - ) { - for (const e of object.replayProtection) { - message.replayProtection.push(ReplayProtection.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryGetSequenceCounterRequest: object = { index: "" }; - -export const QueryGetSequenceCounterRequest = { - encode( - message: QueryGetSequenceCounterRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.index !== "") { - writer.uint32(10).string(message.index); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetSequenceCounterRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetSequenceCounterRequest, - } as QueryGetSequenceCounterRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetSequenceCounterRequest { - const message = { - ...baseQueryGetSequenceCounterRequest, - } as QueryGetSequenceCounterRequest; - if (object.index !== undefined && object.index !== null) { - message.index = String(object.index); - } else { - message.index = ""; - } - return message; - }, - - toJSON(message: QueryGetSequenceCounterRequest): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetSequenceCounterRequest { - const message = { - ...baseQueryGetSequenceCounterRequest, - } as QueryGetSequenceCounterRequest; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = ""; - } - return message; - }, -}; - -const baseQueryGetSequenceCounterResponse: object = {}; - -export const QueryGetSequenceCounterResponse = { - encode( - message: QueryGetSequenceCounterResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.sequenceCounter !== undefined) { - SequenceCounter.encode( - message.sequenceCounter, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetSequenceCounterResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetSequenceCounterResponse, - } as QueryGetSequenceCounterResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequenceCounter = SequenceCounter.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetSequenceCounterResponse { - const message = { - ...baseQueryGetSequenceCounterResponse, - } as QueryGetSequenceCounterResponse; - if ( - object.sequenceCounter !== undefined && - object.sequenceCounter !== null - ) { - message.sequenceCounter = SequenceCounter.fromJSON( - object.sequenceCounter - ); - } else { - message.sequenceCounter = undefined; - } - return message; - }, - - toJSON(message: QueryGetSequenceCounterResponse): unknown { - const obj: any = {}; - message.sequenceCounter !== undefined && - (obj.sequenceCounter = message.sequenceCounter - ? SequenceCounter.toJSON(message.sequenceCounter) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetSequenceCounterResponse { - const message = { - ...baseQueryGetSequenceCounterResponse, - } as QueryGetSequenceCounterResponse; - if ( - object.sequenceCounter !== undefined && - object.sequenceCounter !== null - ) { - message.sequenceCounter = SequenceCounter.fromPartial( - object.sequenceCounter - ); - } else { - message.sequenceCounter = undefined; - } - return message; - }, -}; - -const baseQueryAllSequenceCounterRequest: object = {}; - -export const QueryAllSequenceCounterRequest = { - encode( - message: QueryAllSequenceCounterRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllSequenceCounterRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllSequenceCounterRequest, - } as QueryAllSequenceCounterRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllSequenceCounterRequest { - const message = { - ...baseQueryAllSequenceCounterRequest, - } as QueryAllSequenceCounterRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllSequenceCounterRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllSequenceCounterRequest { - const message = { - ...baseQueryAllSequenceCounterRequest, - } as QueryAllSequenceCounterRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllSequenceCounterResponse: object = {}; - -export const QueryAllSequenceCounterResponse = { - encode( - message: QueryAllSequenceCounterResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.sequenceCounter) { - SequenceCounter.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllSequenceCounterResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllSequenceCounterResponse, - } as QueryAllSequenceCounterResponse; - message.sequenceCounter = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequenceCounter.push( - SequenceCounter.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllSequenceCounterResponse { - const message = { - ...baseQueryAllSequenceCounterResponse, - } as QueryAllSequenceCounterResponse; - message.sequenceCounter = []; - if ( - object.sequenceCounter !== undefined && - object.sequenceCounter !== null - ) { - for (const e of object.sequenceCounter) { - message.sequenceCounter.push(SequenceCounter.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllSequenceCounterResponse): unknown { - const obj: any = {}; - if (message.sequenceCounter) { - obj.sequenceCounter = message.sequenceCounter.map((e) => - e ? SequenceCounter.toJSON(e) : undefined - ); - } else { - obj.sequenceCounter = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllSequenceCounterResponse { - const message = { - ...baseQueryAllSequenceCounterResponse, - } as QueryAllSequenceCounterResponse; - message.sequenceCounter = []; - if ( - object.sequenceCounter !== undefined && - object.sequenceCounter !== null - ) { - for (const e of object.sequenceCounter) { - message.sequenceCounter.push(SequenceCounter.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryGetConsensusGuardianSetIndexRequest: object = {}; - -export const QueryGetConsensusGuardianSetIndexRequest = { - encode( - _: QueryGetConsensusGuardianSetIndexRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetConsensusGuardianSetIndexRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetConsensusGuardianSetIndexRequest, - } as QueryGetConsensusGuardianSetIndexRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryGetConsensusGuardianSetIndexRequest { - const message = { - ...baseQueryGetConsensusGuardianSetIndexRequest, - } as QueryGetConsensusGuardianSetIndexRequest; - return message; - }, - - toJSON(_: QueryGetConsensusGuardianSetIndexRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryGetConsensusGuardianSetIndexRequest { - const message = { - ...baseQueryGetConsensusGuardianSetIndexRequest, - } as QueryGetConsensusGuardianSetIndexRequest; - return message; - }, -}; - -const baseQueryGetConsensusGuardianSetIndexResponse: object = {}; - -export const QueryGetConsensusGuardianSetIndexResponse = { - encode( - message: QueryGetConsensusGuardianSetIndexResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.ConsensusGuardianSetIndex !== undefined) { - ConsensusGuardianSetIndex.encode( - message.ConsensusGuardianSetIndex, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetConsensusGuardianSetIndexResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetConsensusGuardianSetIndexResponse, - } as QueryGetConsensusGuardianSetIndexResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ConsensusGuardianSetIndex = ConsensusGuardianSetIndex.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetConsensusGuardianSetIndexResponse { - const message = { - ...baseQueryGetConsensusGuardianSetIndexResponse, - } as QueryGetConsensusGuardianSetIndexResponse; - if ( - object.ConsensusGuardianSetIndex !== undefined && - object.ConsensusGuardianSetIndex !== null - ) { - message.ConsensusGuardianSetIndex = ConsensusGuardianSetIndex.fromJSON( - object.ConsensusGuardianSetIndex - ); - } else { - message.ConsensusGuardianSetIndex = undefined; - } - return message; - }, - - toJSON(message: QueryGetConsensusGuardianSetIndexResponse): unknown { - const obj: any = {}; - message.ConsensusGuardianSetIndex !== undefined && - (obj.ConsensusGuardianSetIndex = message.ConsensusGuardianSetIndex - ? ConsensusGuardianSetIndex.toJSON(message.ConsensusGuardianSetIndex) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetConsensusGuardianSetIndexResponse { - const message = { - ...baseQueryGetConsensusGuardianSetIndexResponse, - } as QueryGetConsensusGuardianSetIndexResponse; - if ( - object.ConsensusGuardianSetIndex !== undefined && - object.ConsensusGuardianSetIndex !== null - ) { - message.ConsensusGuardianSetIndex = ConsensusGuardianSetIndex.fromPartial( - object.ConsensusGuardianSetIndex - ); - } else { - message.ConsensusGuardianSetIndex = undefined; - } - return message; - }, -}; - -const baseQueryGetGuardianValidatorRequest: object = {}; - -export const QueryGetGuardianValidatorRequest = { - encode( - message: QueryGetGuardianValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.guardianKey.length !== 0) { - writer.uint32(10).bytes(message.guardianKey); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetGuardianValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetGuardianValidatorRequest, - } as QueryGetGuardianValidatorRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetGuardianValidatorRequest { - const message = { - ...baseQueryGetGuardianValidatorRequest, - } as QueryGetGuardianValidatorRequest; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = bytesFromBase64(object.guardianKey); - } - return message; - }, - - toJSON(message: QueryGetGuardianValidatorRequest): unknown { - const obj: any = {}; - message.guardianKey !== undefined && - (obj.guardianKey = base64FromBytes( - message.guardianKey !== undefined - ? message.guardianKey - : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetGuardianValidatorRequest { - const message = { - ...baseQueryGetGuardianValidatorRequest, - } as QueryGetGuardianValidatorRequest; - if (object.guardianKey !== undefined && object.guardianKey !== null) { - message.guardianKey = object.guardianKey; - } else { - message.guardianKey = new Uint8Array(); - } - return message; - }, -}; - -const baseQueryGetGuardianValidatorResponse: object = {}; - -export const QueryGetGuardianValidatorResponse = { - encode( - message: QueryGetGuardianValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.guardianValidator !== undefined) { - GuardianValidator.encode( - message.guardianValidator, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryGetGuardianValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryGetGuardianValidatorResponse, - } as QueryGetGuardianValidatorResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianValidator = GuardianValidator.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGetGuardianValidatorResponse { - const message = { - ...baseQueryGetGuardianValidatorResponse, - } as QueryGetGuardianValidatorResponse; - if ( - object.guardianValidator !== undefined && - object.guardianValidator !== null - ) { - message.guardianValidator = GuardianValidator.fromJSON( - object.guardianValidator - ); - } else { - message.guardianValidator = undefined; - } - return message; - }, - - toJSON(message: QueryGetGuardianValidatorResponse): unknown { - const obj: any = {}; - message.guardianValidator !== undefined && - (obj.guardianValidator = message.guardianValidator - ? GuardianValidator.toJSON(message.guardianValidator) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryGetGuardianValidatorResponse { - const message = { - ...baseQueryGetGuardianValidatorResponse, - } as QueryGetGuardianValidatorResponse; - if ( - object.guardianValidator !== undefined && - object.guardianValidator !== null - ) { - message.guardianValidator = GuardianValidator.fromPartial( - object.guardianValidator - ); - } else { - message.guardianValidator = undefined; - } - return message; - }, -}; - -const baseQueryAllGuardianValidatorRequest: object = {}; - -export const QueryAllGuardianValidatorRequest = { - encode( - message: QueryAllGuardianValidatorRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllGuardianValidatorRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllGuardianValidatorRequest, - } as QueryAllGuardianValidatorRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllGuardianValidatorRequest { - const message = { - ...baseQueryAllGuardianValidatorRequest, - } as QueryAllGuardianValidatorRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllGuardianValidatorRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllGuardianValidatorRequest { - const message = { - ...baseQueryAllGuardianValidatorRequest, - } as QueryAllGuardianValidatorRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllGuardianValidatorResponse: object = {}; - -export const QueryAllGuardianValidatorResponse = { - encode( - message: QueryAllGuardianValidatorResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.guardianValidator) { - GuardianValidator.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllGuardianValidatorResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllGuardianValidatorResponse, - } as QueryAllGuardianValidatorResponse; - message.guardianValidator = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.guardianValidator.push( - GuardianValidator.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllGuardianValidatorResponse { - const message = { - ...baseQueryAllGuardianValidatorResponse, - } as QueryAllGuardianValidatorResponse; - message.guardianValidator = []; - if ( - object.guardianValidator !== undefined && - object.guardianValidator !== null - ) { - for (const e of object.guardianValidator) { - message.guardianValidator.push(GuardianValidator.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllGuardianValidatorResponse): unknown { - const obj: any = {}; - if (message.guardianValidator) { - obj.guardianValidator = message.guardianValidator.map((e) => - e ? GuardianValidator.toJSON(e) : undefined - ); - } else { - obj.guardianValidator = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllGuardianValidatorResponse { - const message = { - ...baseQueryAllGuardianValidatorResponse, - } as QueryAllGuardianValidatorResponse; - message.guardianValidator = []; - if ( - object.guardianValidator !== undefined && - object.guardianValidator !== null - ) { - for (const e of object.guardianValidator) { - message.guardianValidator.push(GuardianValidator.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryLatestGuardianSetIndexRequest: object = {}; - -export const QueryLatestGuardianSetIndexRequest = { - encode( - _: QueryLatestGuardianSetIndexRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryLatestGuardianSetIndexRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryLatestGuardianSetIndexRequest, - } as QueryLatestGuardianSetIndexRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryLatestGuardianSetIndexRequest { - const message = { - ...baseQueryLatestGuardianSetIndexRequest, - } as QueryLatestGuardianSetIndexRequest; - return message; - }, - - toJSON(_: QueryLatestGuardianSetIndexRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryLatestGuardianSetIndexRequest { - const message = { - ...baseQueryLatestGuardianSetIndexRequest, - } as QueryLatestGuardianSetIndexRequest; - return message; - }, -}; - -const baseQueryLatestGuardianSetIndexResponse: object = { - latestGuardianSetIndex: 0, -}; - -export const QueryLatestGuardianSetIndexResponse = { - encode( - message: QueryLatestGuardianSetIndexResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.latestGuardianSetIndex !== 0) { - writer.uint32(8).uint32(message.latestGuardianSetIndex); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryLatestGuardianSetIndexResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryLatestGuardianSetIndexResponse, - } as QueryLatestGuardianSetIndexResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.latestGuardianSetIndex = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryLatestGuardianSetIndexResponse { - const message = { - ...baseQueryLatestGuardianSetIndexResponse, - } as QueryLatestGuardianSetIndexResponse; - if ( - object.latestGuardianSetIndex !== undefined && - object.latestGuardianSetIndex !== null - ) { - message.latestGuardianSetIndex = Number(object.latestGuardianSetIndex); - } else { - message.latestGuardianSetIndex = 0; - } - return message; - }, - - toJSON(message: QueryLatestGuardianSetIndexResponse): unknown { - const obj: any = {}; - message.latestGuardianSetIndex !== undefined && - (obj.latestGuardianSetIndex = message.latestGuardianSetIndex); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryLatestGuardianSetIndexResponse { - const message = { - ...baseQueryLatestGuardianSetIndexResponse, - } as QueryLatestGuardianSetIndexResponse; - if ( - object.latestGuardianSetIndex !== undefined && - object.latestGuardianSetIndex !== null - ) { - message.latestGuardianSetIndex = object.latestGuardianSetIndex; - } else { - message.latestGuardianSetIndex = 0; - } - return message; - }, -}; - -const baseQueryIbcComposabilityMwContractRequest: object = {}; - -export const QueryIbcComposabilityMwContractRequest = { - encode( - _: QueryIbcComposabilityMwContractRequest, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryIbcComposabilityMwContractRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryIbcComposabilityMwContractRequest, - } as QueryIbcComposabilityMwContractRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): QueryIbcComposabilityMwContractRequest { - const message = { - ...baseQueryIbcComposabilityMwContractRequest, - } as QueryIbcComposabilityMwContractRequest; - return message; - }, - - toJSON(_: QueryIbcComposabilityMwContractRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): QueryIbcComposabilityMwContractRequest { - const message = { - ...baseQueryIbcComposabilityMwContractRequest, - } as QueryIbcComposabilityMwContractRequest; - return message; - }, -}; - -const baseQueryIbcComposabilityMwContractResponse: object = { - contractAddress: "", -}; - -export const QueryIbcComposabilityMwContractResponse = { - encode( - message: QueryIbcComposabilityMwContractResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.contractAddress !== "") { - writer.uint32(10).string(message.contractAddress); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryIbcComposabilityMwContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryIbcComposabilityMwContractResponse, - } as QueryIbcComposabilityMwContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractAddress = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryIbcComposabilityMwContractResponse { - const message = { - ...baseQueryIbcComposabilityMwContractResponse, - } as QueryIbcComposabilityMwContractResponse; - if ( - object.contractAddress !== undefined && - object.contractAddress !== null - ) { - message.contractAddress = String(object.contractAddress); - } else { - message.contractAddress = ""; - } - return message; - }, - - toJSON(message: QueryIbcComposabilityMwContractResponse): unknown { - const obj: any = {}; - message.contractAddress !== undefined && - (obj.contractAddress = message.contractAddress); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryIbcComposabilityMwContractResponse { - const message = { - ...baseQueryIbcComposabilityMwContractResponse, - } as QueryIbcComposabilityMwContractResponse; - if ( - object.contractAddress !== undefined && - object.contractAddress !== null - ) { - message.contractAddress = object.contractAddress; - } else { - message.contractAddress = ""; - } - return message; - }, -}; - -const baseQueryAllWasmInstantiateAllowlist: object = {}; - -export const QueryAllWasmInstantiateAllowlist = { - encode( - message: QueryAllWasmInstantiateAllowlist, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllWasmInstantiateAllowlist { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllWasmInstantiateAllowlist, - } as QueryAllWasmInstantiateAllowlist; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllWasmInstantiateAllowlist { - const message = { - ...baseQueryAllWasmInstantiateAllowlist, - } as QueryAllWasmInstantiateAllowlist; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllWasmInstantiateAllowlist): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllWasmInstantiateAllowlist { - const message = { - ...baseQueryAllWasmInstantiateAllowlist, - } as QueryAllWasmInstantiateAllowlist; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllWasmInstantiateAllowlistResponse: object = {}; - -export const QueryAllWasmInstantiateAllowlistResponse = { - encode( - message: QueryAllWasmInstantiateAllowlistResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.allowlist) { - WasmInstantiateAllowedContractCodeId.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllWasmInstantiateAllowlistResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllWasmInstantiateAllowlistResponse, - } as QueryAllWasmInstantiateAllowlistResponse; - message.allowlist = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowlist.push( - WasmInstantiateAllowedContractCodeId.decode(reader, reader.uint32()) - ); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllWasmInstantiateAllowlistResponse { - const message = { - ...baseQueryAllWasmInstantiateAllowlistResponse, - } as QueryAllWasmInstantiateAllowlistResponse; - message.allowlist = []; - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push( - WasmInstantiateAllowedContractCodeId.fromJSON(e) - ); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllWasmInstantiateAllowlistResponse): unknown { - const obj: any = {}; - if (message.allowlist) { - obj.allowlist = message.allowlist.map((e) => - e ? WasmInstantiateAllowedContractCodeId.toJSON(e) : undefined - ); - } else { - obj.allowlist = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllWasmInstantiateAllowlistResponse { - const message = { - ...baseQueryAllWasmInstantiateAllowlistResponse, - } as QueryAllWasmInstantiateAllowlistResponse; - message.allowlist = []; - if (object.allowlist !== undefined && object.allowlist !== null) { - for (const e of object.allowlist) { - message.allowlist.push( - WasmInstantiateAllowedContractCodeId.fromPartial(e) - ); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Queries a guardianSet by index. */ - GuardianSet( - request: QueryGetGuardianSetRequest - ): Promise; - /** Queries a list of guardianSet items. */ - GuardianSetAll( - request: QueryAllGuardianSetRequest - ): Promise; - /** Queries a config by index. */ - Config(request: QueryGetConfigRequest): Promise; - /** Queries a replayProtection by index. */ - ReplayProtection( - request: QueryGetReplayProtectionRequest - ): Promise; - /** Queries a list of replayProtection items. */ - ReplayProtectionAll( - request: QueryAllReplayProtectionRequest - ): Promise; - /** Queries a sequenceCounter by index. */ - SequenceCounter( - request: QueryGetSequenceCounterRequest - ): Promise; - /** Queries a list of sequenceCounter items. */ - SequenceCounterAll( - request: QueryAllSequenceCounterRequest - ): Promise; - /** Queries a ConsensusGuardianSetIndex by index. */ - ConsensusGuardianSetIndex( - request: QueryGetConsensusGuardianSetIndexRequest - ): Promise; - /** Queries a GuardianValidator by index. */ - GuardianValidator( - request: QueryGetGuardianValidatorRequest - ): Promise; - /** Queries a list of GuardianValidator items. */ - GuardianValidatorAll( - request: QueryAllGuardianValidatorRequest - ): Promise; - /** Queries a list of LatestGuardianSetIndex items. */ - LatestGuardianSetIndex( - request: QueryLatestGuardianSetIndexRequest - ): Promise; - AllowlistAll( - request: QueryAllValidatorAllowlist - ): Promise; - Allowlist( - request: QueryValidatorAllowlist - ): Promise; - IbcComposabilityMwContract( - request: QueryIbcComposabilityMwContractRequest - ): Promise; - WasmInstantiateAllowlistAll( - request: QueryAllWasmInstantiateAllowlist - ): Promise; -} - -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - GuardianSet( - request: QueryGetGuardianSetRequest - ): Promise { - const data = QueryGetGuardianSetRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "GuardianSet", - data - ); - return promise.then((data) => - QueryGetGuardianSetResponse.decode(new Reader(data)) - ); - } - - GuardianSetAll( - request: QueryAllGuardianSetRequest - ): Promise { - const data = QueryAllGuardianSetRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "GuardianSetAll", - data - ); - return promise.then((data) => - QueryAllGuardianSetResponse.decode(new Reader(data)) - ); - } - - Config(request: QueryGetConfigRequest): Promise { - const data = QueryGetConfigRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "Config", - data - ); - return promise.then((data) => - QueryGetConfigResponse.decode(new Reader(data)) - ); - } - - ReplayProtection( - request: QueryGetReplayProtectionRequest - ): Promise { - const data = QueryGetReplayProtectionRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "ReplayProtection", - data - ); - return promise.then((data) => - QueryGetReplayProtectionResponse.decode(new Reader(data)) - ); - } - - ReplayProtectionAll( - request: QueryAllReplayProtectionRequest - ): Promise { - const data = QueryAllReplayProtectionRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "ReplayProtectionAll", - data - ); - return promise.then((data) => - QueryAllReplayProtectionResponse.decode(new Reader(data)) - ); - } - - SequenceCounter( - request: QueryGetSequenceCounterRequest - ): Promise { - const data = QueryGetSequenceCounterRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "SequenceCounter", - data - ); - return promise.then((data) => - QueryGetSequenceCounterResponse.decode(new Reader(data)) - ); - } - - SequenceCounterAll( - request: QueryAllSequenceCounterRequest - ): Promise { - const data = QueryAllSequenceCounterRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "SequenceCounterAll", - data - ); - return promise.then((data) => - QueryAllSequenceCounterResponse.decode(new Reader(data)) - ); - } - - ConsensusGuardianSetIndex( - request: QueryGetConsensusGuardianSetIndexRequest - ): Promise { - const data = QueryGetConsensusGuardianSetIndexRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "ConsensusGuardianSetIndex", - data - ); - return promise.then((data) => - QueryGetConsensusGuardianSetIndexResponse.decode(new Reader(data)) - ); - } - - GuardianValidator( - request: QueryGetGuardianValidatorRequest - ): Promise { - const data = QueryGetGuardianValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "GuardianValidator", - data - ); - return promise.then((data) => - QueryGetGuardianValidatorResponse.decode(new Reader(data)) - ); - } - - GuardianValidatorAll( - request: QueryAllGuardianValidatorRequest - ): Promise { - const data = QueryAllGuardianValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "GuardianValidatorAll", - data - ); - return promise.then((data) => - QueryAllGuardianValidatorResponse.decode(new Reader(data)) - ); - } - - LatestGuardianSetIndex( - request: QueryLatestGuardianSetIndexRequest - ): Promise { - const data = QueryLatestGuardianSetIndexRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "LatestGuardianSetIndex", - data - ); - return promise.then((data) => - QueryLatestGuardianSetIndexResponse.decode(new Reader(data)) - ); - } - - AllowlistAll( - request: QueryAllValidatorAllowlist - ): Promise { - const data = QueryAllValidatorAllowlist.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "AllowlistAll", - data - ); - return promise.then((data) => - QueryAllValidatorAllowlistResponse.decode(new Reader(data)) - ); - } - - Allowlist( - request: QueryValidatorAllowlist - ): Promise { - const data = QueryValidatorAllowlist.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "Allowlist", - data - ); - return promise.then((data) => - QueryValidatorAllowlistResponse.decode(new Reader(data)) - ); - } - - IbcComposabilityMwContract( - request: QueryIbcComposabilityMwContractRequest - ): Promise { - const data = QueryIbcComposabilityMwContractRequest.encode( - request - ).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "IbcComposabilityMwContract", - data - ); - return promise.then((data) => - QueryIbcComposabilityMwContractResponse.decode(new Reader(data)) - ); - } - - WasmInstantiateAllowlistAll( - request: QueryAllWasmInstantiateAllowlist - ): Promise { - const data = QueryAllWasmInstantiateAllowlist.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Query", - "WasmInstantiateAllowlistAll", - data - ); - return promise.then((data) => - QueryAllWasmInstantiateAllowlistResponse.decode(new Reader(data)) - ); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/replay_protection.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/replay_protection.ts deleted file mode 100644 index 263c7986a3..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/replay_protection.ts +++ /dev/null @@ -1,75 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface ReplayProtection { - index: string; -} - -const baseReplayProtection: object = { index: "" }; - -export const ReplayProtection = { - encode(message: ReplayProtection, writer: Writer = Writer.create()): Writer { - if (message.index !== "") { - writer.uint32(10).string(message.index); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): ReplayProtection { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseReplayProtection } as ReplayProtection; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ReplayProtection { - const message = { ...baseReplayProtection } as ReplayProtection; - if (object.index !== undefined && object.index !== null) { - message.index = String(object.index); - } else { - message.index = ""; - } - return message; - }, - - toJSON(message: ReplayProtection): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - return obj; - }, - - fromPartial(object: DeepPartial): ReplayProtection { - const message = { ...baseReplayProtection } as ReplayProtection; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = ""; - } - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/sequence_counter.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/sequence_counter.ts deleted file mode 100644 index ff93c74c25..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/sequence_counter.ts +++ /dev/null @@ -1,116 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import * as Long from "long"; -import { util, configure, Writer, Reader } from "protobufjs/minimal"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface SequenceCounter { - index: string; - sequence: number; -} - -const baseSequenceCounter: object = { index: "", sequence: 0 }; - -export const SequenceCounter = { - encode(message: SequenceCounter, writer: Writer = Writer.create()): Writer { - if (message.index !== "") { - writer.uint32(10).string(message.index); - } - if (message.sequence !== 0) { - writer.uint32(16).uint64(message.sequence); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): SequenceCounter { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSequenceCounter } as SequenceCounter; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.string(); - break; - case 2: - message.sequence = longToNumber(reader.uint64() as Long); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SequenceCounter { - const message = { ...baseSequenceCounter } as SequenceCounter; - if (object.index !== undefined && object.index !== null) { - message.index = String(object.index); - } else { - message.index = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Number(object.sequence); - } else { - message.sequence = 0; - } - return message; - }, - - toJSON(message: SequenceCounter): unknown { - const obj: any = {}; - message.index !== undefined && (obj.index = message.index); - message.sequence !== undefined && (obj.sequence = message.sequence); - return obj; - }, - - fromPartial(object: DeepPartial): SequenceCounter { - const message = { ...baseSequenceCounter } as SequenceCounter; - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } else { - message.index = ""; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = object.sequence; - } else { - message.sequence = 0; - } - return message; - }, -}; - -declare var self: any | undefined; -declare var window: 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"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/tx.ts b/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/tx.ts deleted file mode 100644 index 3b0d8573be..0000000000 --- a/wormchain/ts-sdk/src/modules/wormhole_foundation.wormchain.wormhole/types/wormhole/tx.ts +++ /dev/null @@ -1,1893 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Reader, util, configure, Writer } from "protobufjs/minimal"; -import * as Long from "long"; - -export const protobufPackage = "wormhole_foundation.wormchain.wormhole"; - -export interface EmptyResponse {} - -export interface MsgCreateAllowlistEntryRequest { - /** signer should be a guardian validator in a current set or future set. */ - signer: string; - /** the address to allowlist */ - address: string; - /** optional human readable name for the entry */ - name: string; -} - -export interface MsgDeleteAllowlistEntryRequest { - /** signer should be a guardian validator in a current set or future set. */ - signer: string; - /** the address allowlist to remove */ - address: string; -} - -export interface MsgAllowlistResponse {} - -export interface MsgExecuteGovernanceVAA { - vaa: Uint8Array; - signer: string; -} - -export interface MsgExecuteGovernanceVAAResponse {} - -export interface MsgRegisterAccountAsGuardian { - signer: string; - signature: Uint8Array; -} - -export interface MsgRegisterAccountAsGuardianResponse {} - -/** Same as from x/wasmd but with vaa auth */ -export interface MsgStoreCode { - /** Signer is the that actor that signed the messages */ - signer: string; - /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: Uint8Array; - /** vaa must be governance msg with payload containing sha3 256 hash of `wasm_byte_code` */ - vaa: Uint8Array; -} - -export interface MsgStoreCodeResponse { - /** CodeID is the reference to the stored WASM code */ - code_id: number; - /** Checksum is the sha256 hash of the stored code */ - checksum: Uint8Array; -} - -/** Same as from x/wasmd but with vaa auth */ -export interface MsgInstantiateContract { - /** Signer is the that actor that signed the messages */ - signer: string; - /** CodeID is the reference to the stored WASM code */ - code_id: number; - /** Label is optional metadata to be stored with a contract instance. */ - label: string; - /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; - /** vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Label), Msg) */ - vaa: Uint8Array; -} - -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains base64-encoded bytes to returned from the contract */ - data: Uint8Array; -} - -export interface MsgAddWasmInstantiateAllowlist { - /** Signer is the actor that signed the messages */ - signer: string; - /** Address is the bech32 address of the contract that can call wasm instantiate without a VAA */ - address: string; - /** CodeID is the reference to the stored WASM code that can be instantiated */ - code_id: number; - /** vaa is the WormchainAddWasmInstantiateAllowlist governance message */ - vaa: Uint8Array; -} - -export interface MsgDeleteWasmInstantiateAllowlist { - /** signer should be a guardian validator in a current set or future set. */ - signer: string; - /** the pair to remove */ - address: string; - code_id: number; - /** vaa is the WormchainDeleteWasmInstantiateAllowlist governance message */ - vaa: Uint8Array; -} - -export interface MsgWasmInstantiateAllowlistResponse {} - -/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ -export interface MsgMigrateContract { - /** Sender is the actor that signs the messages */ - signer: string; - /** Contract is the address of the smart contract */ - contract: string; - /** CodeID references the new WASM code */ - code_id: number; - /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; - /** vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Contract), Msg) */ - vaa: Uint8Array; -} - -/** MsgMigrateContractResponse returns contract migration result data. */ -export interface MsgMigrateContractResponse { - /** - * Data contains same raw bytes returned as data from the wasm contract. - * (May be empty) - */ - data: Uint8Array; -} - -export interface MsgExecuteGatewayGovernanceVaa { - /** Sender is the actor that signs the messages */ - signer: string; - /** vaa must be governance msg with valid module, action, and payload */ - vaa: Uint8Array; -} - -const baseEmptyResponse: object = {}; - -export const EmptyResponse = { - encode(_: EmptyResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): EmptyResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseEmptyResponse } as EmptyResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): EmptyResponse { - const message = { ...baseEmptyResponse } as EmptyResponse; - return message; - }, - - toJSON(_: EmptyResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): EmptyResponse { - const message = { ...baseEmptyResponse } as EmptyResponse; - return message; - }, -}; - -const baseMsgCreateAllowlistEntryRequest: object = { - signer: "", - address: "", - name: "", -}; - -export const MsgCreateAllowlistEntryRequest = { - encode( - message: MsgCreateAllowlistEntryRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } - if (message.name !== "") { - writer.uint32(26).string(message.name); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgCreateAllowlistEntryRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgCreateAllowlistEntryRequest, - } as MsgCreateAllowlistEntryRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.address = reader.string(); - break; - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgCreateAllowlistEntryRequest { - const message = { - ...baseMsgCreateAllowlistEntryRequest, - } as MsgCreateAllowlistEntryRequest; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = String(object.name); - } else { - message.name = ""; - } - return message; - }, - - toJSON(message: MsgCreateAllowlistEntryRequest): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.address !== undefined && (obj.address = message.address); - message.name !== undefined && (obj.name = message.name); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgCreateAllowlistEntryRequest { - const message = { - ...baseMsgCreateAllowlistEntryRequest, - } as MsgCreateAllowlistEntryRequest; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } else { - message.name = ""; - } - return message; - }, -}; - -const baseMsgDeleteAllowlistEntryRequest: object = { signer: "", address: "" }; - -export const MsgDeleteAllowlistEntryRequest = { - encode( - message: MsgDeleteAllowlistEntryRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgDeleteAllowlistEntryRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgDeleteAllowlistEntryRequest, - } as MsgDeleteAllowlistEntryRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteAllowlistEntryRequest { - const message = { - ...baseMsgDeleteAllowlistEntryRequest, - } as MsgDeleteAllowlistEntryRequest; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - return message; - }, - - toJSON(message: MsgDeleteAllowlistEntryRequest): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.address !== undefined && (obj.address = message.address); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgDeleteAllowlistEntryRequest { - const message = { - ...baseMsgDeleteAllowlistEntryRequest, - } as MsgDeleteAllowlistEntryRequest; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - return message; - }, -}; - -const baseMsgAllowlistResponse: object = {}; - -export const MsgAllowlistResponse = { - encode(_: MsgAllowlistResponse, writer: Writer = Writer.create()): Writer { - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgAllowlistResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgAllowlistResponse } as MsgAllowlistResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgAllowlistResponse { - const message = { ...baseMsgAllowlistResponse } as MsgAllowlistResponse; - return message; - }, - - toJSON(_: MsgAllowlistResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): MsgAllowlistResponse { - const message = { ...baseMsgAllowlistResponse } as MsgAllowlistResponse; - return message; - }, -}; - -const baseMsgExecuteGovernanceVAA: object = { signer: "" }; - -export const MsgExecuteGovernanceVAA = { - encode( - message: MsgExecuteGovernanceVAA, - writer: Writer = Writer.create() - ): Writer { - if (message.vaa.length !== 0) { - writer.uint32(10).bytes(message.vaa); - } - if (message.signer !== "") { - writer.uint32(18).string(message.signer); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgExecuteGovernanceVAA { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgExecuteGovernanceVAA, - } as MsgExecuteGovernanceVAA; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.vaa = reader.bytes(); - break; - case 2: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgExecuteGovernanceVAA { - const message = { - ...baseMsgExecuteGovernanceVAA, - } as MsgExecuteGovernanceVAA; - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - return message; - }, - - toJSON(message: MsgExecuteGovernanceVAA): unknown { - const obj: any = {}; - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - message.signer !== undefined && (obj.signer = message.signer); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgExecuteGovernanceVAA { - const message = { - ...baseMsgExecuteGovernanceVAA, - } as MsgExecuteGovernanceVAA; - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - return message; - }, -}; - -const baseMsgExecuteGovernanceVAAResponse: object = {}; - -export const MsgExecuteGovernanceVAAResponse = { - encode( - _: MsgExecuteGovernanceVAAResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgExecuteGovernanceVAAResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgExecuteGovernanceVAAResponse, - } as MsgExecuteGovernanceVAAResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgExecuteGovernanceVAAResponse { - const message = { - ...baseMsgExecuteGovernanceVAAResponse, - } as MsgExecuteGovernanceVAAResponse; - return message; - }, - - toJSON(_: MsgExecuteGovernanceVAAResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgExecuteGovernanceVAAResponse { - const message = { - ...baseMsgExecuteGovernanceVAAResponse, - } as MsgExecuteGovernanceVAAResponse; - return message; - }, -}; - -const baseMsgRegisterAccountAsGuardian: object = { signer: "" }; - -export const MsgRegisterAccountAsGuardian = { - encode( - message: MsgRegisterAccountAsGuardian, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.signature.length !== 0) { - writer.uint32(26).bytes(message.signature); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgRegisterAccountAsGuardian { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgRegisterAccountAsGuardian, - } as MsgRegisterAccountAsGuardian; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 3: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgRegisterAccountAsGuardian { - const message = { - ...baseMsgRegisterAccountAsGuardian, - } as MsgRegisterAccountAsGuardian; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - - toJSON(message: MsgRegisterAccountAsGuardian): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgRegisterAccountAsGuardian { - const message = { - ...baseMsgRegisterAccountAsGuardian, - } as MsgRegisterAccountAsGuardian; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = object.signature; - } else { - message.signature = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgRegisterAccountAsGuardianResponse: object = {}; - -export const MsgRegisterAccountAsGuardianResponse = { - encode( - _: MsgRegisterAccountAsGuardianResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgRegisterAccountAsGuardianResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgRegisterAccountAsGuardianResponse, - } as MsgRegisterAccountAsGuardianResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgRegisterAccountAsGuardianResponse { - const message = { - ...baseMsgRegisterAccountAsGuardianResponse, - } as MsgRegisterAccountAsGuardianResponse; - return message; - }, - - toJSON(_: MsgRegisterAccountAsGuardianResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgRegisterAccountAsGuardianResponse { - const message = { - ...baseMsgRegisterAccountAsGuardianResponse, - } as MsgRegisterAccountAsGuardianResponse; - return message; - }, -}; - -const baseMsgStoreCode: object = { signer: "" }; - -export const MsgStoreCode = { - encode(message: MsgStoreCode, writer: Writer = Writer.create()): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.wasm_byte_code.length !== 0) { - writer.uint32(18).bytes(message.wasm_byte_code); - } - if (message.vaa.length !== 0) { - writer.uint32(26).bytes(message.vaa); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCode } as MsgStoreCode; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.wasm_byte_code = reader.bytes(); - break; - case 3: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = bytesFromBase64(object.wasm_byte_code); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgStoreCode): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.wasm_byte_code !== undefined && - (obj.wasm_byte_code = base64FromBytes( - message.wasm_byte_code !== undefined - ? message.wasm_byte_code - : new Uint8Array() - )); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MsgStoreCode { - const message = { ...baseMsgStoreCode } as MsgStoreCode; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasm_byte_code = object.wasm_byte_code; - } else { - message.wasm_byte_code = new Uint8Array(); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgStoreCodeResponse: object = { code_id: 0 }; - -export const MsgStoreCodeResponse = { - encode( - message: MsgStoreCodeResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.code_id !== 0) { - writer.uint32(8).uint64(message.code_id); - } - if (message.checksum.length !== 0) { - writer.uint32(18).bytes(message.checksum); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 2: - message.checksum = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.checksum !== undefined && object.checksum !== null) { - message.checksum = bytesFromBase64(object.checksum); - } - return message; - }, - - toJSON(message: MsgStoreCodeResponse): unknown { - const obj: any = {}; - message.code_id !== undefined && (obj.code_id = message.code_id); - message.checksum !== undefined && - (obj.checksum = base64FromBytes( - message.checksum !== undefined ? message.checksum : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MsgStoreCodeResponse { - const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.checksum !== undefined && object.checksum !== null) { - message.checksum = object.checksum; - } else { - message.checksum = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgInstantiateContract: object = { - signer: "", - code_id: 0, - label: "", -}; - -export const MsgInstantiateContract = { - encode( - message: MsgInstantiateContract, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); - } - if (message.label !== "") { - writer.uint32(34).string(message.label); - } - if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); - } - if (message.vaa.length !== 0) { - writer.uint32(50).bytes(message.vaa); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgInstantiateContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 3: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = String(object.label); - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgInstantiateContract): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.label !== undefined && (obj.label = message.label); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgInstantiateContract { - const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } else { - message.label = ""; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgInstantiateContractResponse: object = { address: "" }; - -export const MsgInstantiateContractResponse = { - encode( - message: MsgInstantiateContractResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgInstantiateContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgInstantiateContractResponse { - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: MsgInstantiateContractResponse): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgInstantiateContractResponse { - const message = { - ...baseMsgInstantiateContractResponse, - } as MsgInstantiateContractResponse; - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgAddWasmInstantiateAllowlist: object = { - signer: "", - address: "", - code_id: 0, -}; - -export const MsgAddWasmInstantiateAllowlist = { - encode( - message: MsgAddWasmInstantiateAllowlist, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); - } - if (message.vaa.length !== 0) { - writer.uint32(34).bytes(message.vaa); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgAddWasmInstantiateAllowlist { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgAddWasmInstantiateAllowlist, - } as MsgAddWasmInstantiateAllowlist; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.address = reader.string(); - break; - case 3: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 4: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgAddWasmInstantiateAllowlist { - const message = { - ...baseMsgAddWasmInstantiateAllowlist, - } as MsgAddWasmInstantiateAllowlist; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgAddWasmInstantiateAllowlist): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.address !== undefined && (obj.address = message.address); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgAddWasmInstantiateAllowlist { - const message = { - ...baseMsgAddWasmInstantiateAllowlist, - } as MsgAddWasmInstantiateAllowlist; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgDeleteWasmInstantiateAllowlist: object = { - signer: "", - address: "", - code_id: 0, -}; - -export const MsgDeleteWasmInstantiateAllowlist = { - encode( - message: MsgDeleteWasmInstantiateAllowlist, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); - } - if (message.vaa.length !== 0) { - writer.uint32(34).bytes(message.vaa); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgDeleteWasmInstantiateAllowlist { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgDeleteWasmInstantiateAllowlist, - } as MsgDeleteWasmInstantiateAllowlist; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.address = reader.string(); - break; - case 3: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 4: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgDeleteWasmInstantiateAllowlist { - const message = { - ...baseMsgDeleteWasmInstantiateAllowlist, - } as MsgDeleteWasmInstantiateAllowlist; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = String(object.address); - } else { - message.address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgDeleteWasmInstantiateAllowlist): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.address !== undefined && (obj.address = message.address); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgDeleteWasmInstantiateAllowlist { - const message = { - ...baseMsgDeleteWasmInstantiateAllowlist, - } as MsgDeleteWasmInstantiateAllowlist; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } else { - message.address = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgWasmInstantiateAllowlistResponse: object = {}; - -export const MsgWasmInstantiateAllowlistResponse = { - encode( - _: MsgWasmInstantiateAllowlistResponse, - writer: Writer = Writer.create() - ): Writer { - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgWasmInstantiateAllowlistResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgWasmInstantiateAllowlistResponse, - } as MsgWasmInstantiateAllowlistResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): MsgWasmInstantiateAllowlistResponse { - const message = { - ...baseMsgWasmInstantiateAllowlistResponse, - } as MsgWasmInstantiateAllowlistResponse; - return message; - }, - - toJSON(_: MsgWasmInstantiateAllowlistResponse): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial( - _: DeepPartial - ): MsgWasmInstantiateAllowlistResponse { - const message = { - ...baseMsgWasmInstantiateAllowlistResponse, - } as MsgWasmInstantiateAllowlistResponse; - return message; - }, -}; - -const baseMsgMigrateContract: object = { signer: "", contract: "", code_id: 0 }; - -export const MsgMigrateContract = { - encode( - message: MsgMigrateContract, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); - } - if (message.code_id !== 0) { - writer.uint32(24).uint64(message.code_id); - } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); - } - if (message.vaa.length !== 0) { - writer.uint32(50).bytes(message.vaa); - } - return writer; - }, - - decode(input: Reader | Uint8Array, length?: number): MsgMigrateContract { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.contract = reader.string(); - break; - case 3: - message.code_id = longToNumber(reader.uint64() as Long); - break; - case 4: - message.msg = reader.bytes(); - break; - case 6: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = String(object.contract); - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = Number(object.code_id); - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = bytesFromBase64(object.msg); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgMigrateContract): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.contract !== undefined && (obj.contract = message.contract); - message.code_id !== undefined && (obj.code_id = message.code_id); - message.msg !== undefined && - (obj.msg = base64FromBytes( - message.msg !== undefined ? message.msg : new Uint8Array() - )); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial(object: DeepPartial): MsgMigrateContract { - const message = { ...baseMsgMigrateContract } as MsgMigrateContract; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } else { - message.contract = ""; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.code_id = object.code_id; - } else { - message.code_id = 0; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } else { - message.msg = new Uint8Array(); - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgMigrateContractResponse: object = {}; - -export const MsgMigrateContractResponse = { - encode( - message: MsgMigrateContractResponse, - writer: Writer = Writer.create() - ): Writer { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgMigrateContractResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgMigrateContractResponse { - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - - toJSON(message: MsgMigrateContractResponse): unknown { - const obj: any = {}; - message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgMigrateContractResponse { - const message = { - ...baseMsgMigrateContractResponse, - } as MsgMigrateContractResponse; - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } else { - message.data = new Uint8Array(); - } - return message; - }, -}; - -const baseMsgExecuteGatewayGovernanceVaa: object = { signer: "" }; - -export const MsgExecuteGatewayGovernanceVaa = { - encode( - message: MsgExecuteGatewayGovernanceVaa, - writer: Writer = Writer.create() - ): Writer { - if (message.signer !== "") { - writer.uint32(10).string(message.signer); - } - if (message.vaa.length !== 0) { - writer.uint32(18).bytes(message.vaa); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): MsgExecuteGatewayGovernanceVaa { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMsgExecuteGatewayGovernanceVaa, - } as MsgExecuteGatewayGovernanceVaa; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signer = reader.string(); - break; - case 2: - message.vaa = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MsgExecuteGatewayGovernanceVaa { - const message = { - ...baseMsgExecuteGatewayGovernanceVaa, - } as MsgExecuteGatewayGovernanceVaa; - if (object.signer !== undefined && object.signer !== null) { - message.signer = String(object.signer); - } else { - message.signer = ""; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = bytesFromBase64(object.vaa); - } - return message; - }, - - toJSON(message: MsgExecuteGatewayGovernanceVaa): unknown { - const obj: any = {}; - message.signer !== undefined && (obj.signer = message.signer); - message.vaa !== undefined && - (obj.vaa = base64FromBytes( - message.vaa !== undefined ? message.vaa : new Uint8Array() - )); - return obj; - }, - - fromPartial( - object: DeepPartial - ): MsgExecuteGatewayGovernanceVaa { - const message = { - ...baseMsgExecuteGatewayGovernanceVaa, - } as MsgExecuteGatewayGovernanceVaa; - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } else { - message.signer = ""; - } - if (object.vaa !== undefined && object.vaa !== null) { - message.vaa = object.vaa; - } else { - message.vaa = new Uint8Array(); - } - return message; - }, -}; - -/** Msg defines the Msg service. */ -export interface Msg { - ExecuteGovernanceVAA( - request: MsgExecuteGovernanceVAA - ): Promise; - RegisterAccountAsGuardian( - request: MsgRegisterAccountAsGuardian - ): Promise; - CreateAllowlistEntry( - request: MsgCreateAllowlistEntryRequest - ): Promise; - DeleteAllowlistEntry( - request: MsgDeleteAllowlistEntryRequest - ): Promise; - /** StoreCode to submit Wasm code to the system */ - StoreCode(request: MsgStoreCode): Promise; - /** Instantiate creates a new smart contract instance for the given code id. */ - InstantiateContract( - request: MsgInstantiateContract - ): Promise; - AddWasmInstantiateAllowlist( - request: MsgAddWasmInstantiateAllowlist - ): Promise; - DeleteWasmInstantiateAllowlist( - request: MsgDeleteWasmInstantiateAllowlist - ): Promise; - MigrateContract( - request: MsgMigrateContract - ): Promise; - /** this line is used by starport scaffolding # proto/tx/rpc */ - ExecuteGatewayGovernanceVaa( - request: MsgExecuteGatewayGovernanceVaa - ): Promise; -} - -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - ExecuteGovernanceVAA( - request: MsgExecuteGovernanceVAA - ): Promise { - const data = MsgExecuteGovernanceVAA.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "ExecuteGovernanceVAA", - data - ); - return promise.then((data) => - MsgExecuteGovernanceVAAResponse.decode(new Reader(data)) - ); - } - - RegisterAccountAsGuardian( - request: MsgRegisterAccountAsGuardian - ): Promise { - const data = MsgRegisterAccountAsGuardian.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "RegisterAccountAsGuardian", - data - ); - return promise.then((data) => - MsgRegisterAccountAsGuardianResponse.decode(new Reader(data)) - ); - } - - CreateAllowlistEntry( - request: MsgCreateAllowlistEntryRequest - ): Promise { - const data = MsgCreateAllowlistEntryRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "CreateAllowlistEntry", - data - ); - return promise.then((data) => - MsgAllowlistResponse.decode(new Reader(data)) - ); - } - - DeleteAllowlistEntry( - request: MsgDeleteAllowlistEntryRequest - ): Promise { - const data = MsgDeleteAllowlistEntryRequest.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "DeleteAllowlistEntry", - data - ); - return promise.then((data) => - MsgAllowlistResponse.decode(new Reader(data)) - ); - } - - StoreCode(request: MsgStoreCode): Promise { - const data = MsgStoreCode.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "StoreCode", - data - ); - return promise.then((data) => - MsgStoreCodeResponse.decode(new Reader(data)) - ); - } - - InstantiateContract( - request: MsgInstantiateContract - ): Promise { - const data = MsgInstantiateContract.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "InstantiateContract", - data - ); - return promise.then((data) => - MsgInstantiateContractResponse.decode(new Reader(data)) - ); - } - - AddWasmInstantiateAllowlist( - request: MsgAddWasmInstantiateAllowlist - ): Promise { - const data = MsgAddWasmInstantiateAllowlist.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "AddWasmInstantiateAllowlist", - data - ); - return promise.then((data) => - MsgWasmInstantiateAllowlistResponse.decode(new Reader(data)) - ); - } - - DeleteWasmInstantiateAllowlist( - request: MsgDeleteWasmInstantiateAllowlist - ): Promise { - const data = MsgDeleteWasmInstantiateAllowlist.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "DeleteWasmInstantiateAllowlist", - data - ); - return promise.then((data) => - MsgWasmInstantiateAllowlistResponse.decode(new Reader(data)) - ); - } - - MigrateContract( - request: MsgMigrateContract - ): Promise { - const data = MsgMigrateContract.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "MigrateContract", - data - ); - return promise.then((data) => - MsgMigrateContractResponse.decode(new Reader(data)) - ); - } - - ExecuteGatewayGovernanceVaa( - request: MsgExecuteGatewayGovernanceVaa - ): Promise { - const data = MsgExecuteGatewayGovernanceVaa.encode(request).finish(); - const promise = this.rpc.request( - "wormhole_foundation.wormchain.wormhole.Msg", - "ExecuteGatewayGovernanceVaa", - data - ); - return promise.then((data) => EmptyResponse.decode(new Reader(data))); - } -} - -interface Rpc { - request( - service: string, - method: string, - data: Uint8Array - ): Promise; -} - -declare var self: any | undefined; -declare var window: 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"; -})(); - -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); -function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - for (let i = 0; i < arr.byteLength; ++i) { - bin.push(String.fromCharCode(arr[i])); - } - return btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | undefined; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (util.Long !== Long) { - util.Long = Long as any; - configure(); -} diff --git a/wormchain/x/ibc-composability-mw/ibc_middleware.go b/wormchain/x/ibc-composability-mw/ibc_middleware.go index a73249ea09..f20d967338 100644 --- a/wormchain/x/ibc-composability-mw/ibc_middleware.go +++ b/wormchain/x/ibc-composability-mw/ibc_middleware.go @@ -6,9 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) var _ porttypes.Middleware = &IBCMiddleware{} @@ -120,9 +121,13 @@ func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Pac func (im IBCMiddleware) SendPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, -) error { - return im.ics4.SendPacket(ctx, chanCap, packet) + sourcePort string, + sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (sequence uint64, err error) { + return im.ics4.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) } // WriteAcknowledgement implements the ICS4 Wrapper interface. diff --git a/wormchain/x/ibc-composability-mw/ics4_middleware.go b/wormchain/x/ibc-composability-mw/ics4_middleware.go index 6bc6a90131..40e0bae848 100644 --- a/wormchain/x/ibc-composability-mw/ics4_middleware.go +++ b/wormchain/x/ibc-composability-mw/ics4_middleware.go @@ -6,8 +6,9 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" // ibc-go - porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/keeper" ) @@ -26,9 +27,15 @@ func NewICS4Middleware(channel porttypes.ICS4Wrapper, keeper *keeper.Keeper) ICS } } -func (i ICS4Middleware) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { - err := i.channel.SendPacket(ctx, channelCap, packet) - return err +func (i ICS4Middleware) SendPacket(ctx sdk.Context, + chanCap *capabilitytypes.Capability, + sourcePort string, + sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (sequence uint64, err error) { + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) } func (i ICS4Middleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) error { diff --git a/wormchain/x/ibc-composability-mw/keeper/genesis_test.go b/wormchain/x/ibc-composability-mw/keeper/genesis_test.go new file mode 100644 index 0000000000..32115a0e33 --- /dev/null +++ b/wormchain/x/ibc-composability-mw/keeper/genesis_test.go @@ -0,0 +1,45 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" +) + +// TestGenesis ensures genesis state can be initialiazed and exported correctly. +func TestGenesis(t *testing.T) { + for _, tc := range []struct { + dataInFlight map[string][]byte + }{ + { + dataInFlight: map[string][]byte{}, + }, + { + dataInFlight: map[string][]byte{ + "key1": []byte("value1"), + }, + }, + { + dataInFlight: map[string][]byte{ + "key1": []byte("value1"), + "key2": []byte("value2"), + "key3": []byte("value3"), + }, + }, + } { + genesisState := types.GenesisState{ + TransposedDataInFlight: tc.dataInFlight, + } + + app, ctx := keepertest.SetupWormchainAndContext(t) + keeper := app.IbcComposabilityMwKeeper + + keeper.InitGenesis(ctx, genesisState) + + outputState := keeper.ExportGenesis(ctx) + + require.Equal(t, genesisState, *outputState) + } +} diff --git a/wormchain/x/ibc-composability-mw/keeper/keeper.go b/wormchain/x/ibc-composability-mw/keeper/keeper.go index 6c721eef2c..e785f243ff 100644 --- a/wormchain/x/ibc-composability-mw/keeper/keeper.go +++ b/wormchain/x/ibc-composability-mw/keeper/keeper.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" - transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wormholekeeper "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" diff --git a/wormchain/x/ibc-composability-mw/keeper/keeper_test.go b/wormchain/x/ibc-composability-mw/keeper/keeper_test.go new file mode 100644 index 0000000000..da2d9572aa --- /dev/null +++ b/wormchain/x/ibc-composability-mw/keeper/keeper_test.go @@ -0,0 +1,114 @@ +package keeper_test + +import ( + _ "embed" + "encoding/json" + "testing" + + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" + wormholetypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestPackets ensure that packets are handled correctly by the ibc composability middleware. +// This test will only be able to process IBC hooks messages and not PFM because the test +// requires a full chain setup with interchaintest. +func TestPackets(t *testing.T) { + // setup app & get keepers & ctx + app, ctx := keepertest.SetupWormchainAndContext(t) + whKeeper := app.WormholeKeeper + keeper := app.IbcComposabilityMwKeeper + + // set ibc composability contract + whKeeper.StoreIbcComposabilityMwContract(ctx, wormholetypes.IbcComposabilityMwContract{ + ContractAddress: "wormhole1du4amsmvx8yqr8whw7qc5m3c0zpwknmzelwqy6", + }) + + // define a packet with no ibc token bridge payload + packetDataNoPayload, err := json.Marshal(transfertypes.FungibleTokenPacketData{ + Denom: "uworm", + Amount: "100", + Sender: "sender", + Receiver: "receiver", + Memo: "", + }) + require.NoError(t, err) + + // define gateway payload for packet + gatewayTBPayload, err := json.Marshal(types.GatewayIbcTokenBridgePayload{ + GatewayIbcTokenBridgePayloadObj: types.GatewayIbcTokenBridgePayloadObj{ + Transfer: types.GatewayTransfer{ + Chain: 1, + Recipient: []byte("recipient"), + Fee: "0uworm", + Nonce: 1, + }, + }, + }) + require.NoError(t, err) + + // define a packet with a valid ibc token bridge payload + packetDataWithPayload, err := json.Marshal(transfertypes.FungibleTokenPacketData{ + Denom: "uworm", + Amount: "100", + Sender: "sender", + Receiver: "receiver", + Memo: string(gatewayTBPayload), + }) + require.NoError(t, err) + + for _, tc := range []struct { + testName string + packet channeltypes.Packet + shouldErr bool + }{ + { + testName: "empty packet - expect error", + shouldErr: true, + }, + { + testName: "packet with no data - expect error", + packet: channeltypes.Packet{ + Data: []byte("wrong data format"), + }, + shouldErr: true, + }, + { + testName: "packet with no memo in data - expect error", + packet: channeltypes.Packet{ + Data: packetDataNoPayload, + }, + shouldErr: true, + }, + { + testName: "packet with payload - expect success", + packet: channeltypes.Packet{ + Sequence: 1, + SourcePort: "transfer", + SourceChannel: "channel-0", + DestinationPort: "transfer", + DestinationChannel: "channel-0", + Data: packetDataWithPayload, + }, + shouldErr: false, + }, + } { + packet, ack := keeper.OnRecvPacket(ctx, tc.packet) + + t.Run(tc.testName, func(t *testing.T) { + if tc.shouldErr { + require.NotNil(t, ack) + } else { + require.NotNil(t, packet) + require.Nil(t, ack) + + // Should return nil because the packet is not transposed (it is an ibc hooks packet) + res := keeper.GetAndClearTransposedData(ctx, tc.packet.DestinationChannel, tc.packet.DestinationPort, tc.packet.Sequence) + require.Nil(t, res) + } + }) + } +} diff --git a/wormchain/x/ibc-composability-mw/module.go b/wormchain/x/ibc-composability-mw/module.go index 0adbfbf8f8..ece7a45ac1 100644 --- a/wormchain/x/ibc-composability-mw/module.go +++ b/wormchain/x/ibc-composability-mw/module.go @@ -7,10 +7,10 @@ import ( "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/keeper" "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -84,21 +84,6 @@ func NewAppModule(keeper *keeper.Keeper) AppModule { // RegisterInvariants implements the AppModule interface func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route implements the AppModule interface -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - -// QuerierRoute implements the AppModule interface -func (AppModule) QuerierRoute() string { - return "" -} - -// LegacyQuerierHandler implements the AppModule interface -func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { - return nil -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) {} @@ -135,12 +120,12 @@ func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Valid func (AppModule) GenerateGenesisState(_ *module.SimulationState) {} // ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { return nil } // RandomizedParams creates randomized ibc-router param changes for the simulator. -func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { +func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.LegacyParamChange { return nil } diff --git a/wormchain/x/ibc-composability-mw/types/gateway_payload_test.go b/wormchain/x/ibc-composability-mw/types/gateway_payload_test.go new file mode 100644 index 0000000000..698ebd31b7 --- /dev/null +++ b/wormchain/x/ibc-composability-mw/types/gateway_payload_test.go @@ -0,0 +1,89 @@ +package types_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" +) + +// TestGatewayPayloads tests the VerifyAndParseGatewayPayload function. +func TestGatewayPayloads(t *testing.T) { + for _, tc := range []struct { + testName string + memo string // use memo if present, otherwise marshal tbPayload with json + tbPayload types.GatewayIbcTokenBridgePayload + shouldErr bool + }{ + { + testName: "memo present, payload abscent - should error", + memo: "abc123", + shouldErr: true, + }, + { + testName: "memo abscent, invalid payload - should error", + tbPayload: types.GatewayIbcTokenBridgePayload{}, + shouldErr: true, + }, + { + testName: "valid transfer no payload - should pass", + tbPayload: types.GatewayIbcTokenBridgePayload{ + GatewayIbcTokenBridgePayloadObj: types.GatewayIbcTokenBridgePayloadObj{ + Transfer: types.GatewayTransfer{ + Chain: 1, + Recipient: []byte("recipient"), + Fee: "0uworm", + Nonce: 1, + }, + }, + }, + shouldErr: false, + }, + { + testName: "valid transfer with payload - should pass", + tbPayload: types.GatewayIbcTokenBridgePayload{ + GatewayIbcTokenBridgePayloadObj: types.GatewayIbcTokenBridgePayloadObj{ + TransferWithPayload: types.GatewayTransferWithPayload{ + Chain: 1, + Contract: []byte("contract"), + Payload: []byte("{\"payload\":\"data\"}"), + Nonce: 1, + }, + }, + }, + shouldErr: false, + }, + } { + t.Run(tc.testName, func(t *testing.T) { + memo := tc.memo + + if memo == "" { + bz, err := json.Marshal(tc.tbPayload) + require.NoError(t, err) + memo = string(bz) + } + + payload, err := types.VerifyAndParseGatewayPayload(memo) + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + + // validate payload was parsed correctly + if payload.NoPayload { + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.Transfer.Chain, payload.ChainId) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.Transfer.Recipient, payload.Recipient) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.Transfer.Fee, payload.Fee) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.Transfer.Nonce, payload.Nonce) + } else { + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.TransferWithPayload.Chain, payload.ChainId) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.TransferWithPayload.Contract, payload.Recipient) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.TransferWithPayload.Payload, payload.Payload) + require.Equal(t, tc.tbPayload.GatewayIbcTokenBridgePayloadObj.TransferWithPayload.Nonce, payload.Nonce) + } + } + }) + } +} diff --git a/wormchain/x/ibc-composability-mw/types/genesis.pb.go b/wormchain/x/ibc-composability-mw/types/genesis.pb.go index 9788343702..3697e44cf5 100644 --- a/wormchain/x/ibc-composability-mw/types/genesis.pb.go +++ b/wormchain/x/ibc-composability-mw/types/genesis.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc-composability-mw/genesis.proto +// source: wormchain/ibc_composability_mw/v1/genesis.proto package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -35,7 +35,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_17a5790dbeee9b79, []int{0} + return fileDescriptor_e9f8ef7cefdfacd3, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,37 +72,37 @@ func (m *GenesisState) GetTransposedDataInFlight() map[string][]byte { } func init() { - proto.RegisterType((*GenesisState)(nil), "wormhole_foundation.wormchain.ibc_composability_mw.v1.GenesisState") - proto.RegisterMapType((map[string][]byte)(nil), "wormhole_foundation.wormchain.ibc_composability_mw.v1.GenesisState.TransposedDataInFlightEntry") + proto.RegisterType((*GenesisState)(nil), "wormchain.ibc_composability_mw.v1.GenesisState") + proto.RegisterMapType((map[string][]byte)(nil), "wormchain.ibc_composability_mw.v1.GenesisState.TransposedDataInFlightEntry") } func init() { - proto.RegisterFile("ibc-composability-mw/genesis.proto", fileDescriptor_17a5790dbeee9b79) + proto.RegisterFile("wormchain/ibc_composability_mw/v1/genesis.proto", fileDescriptor_e9f8ef7cefdfacd3) } -var fileDescriptor_17a5790dbeee9b79 = []byte{ - // 326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x4e, 0xf2, 0x40, - 0x14, 0x85, 0x3b, 0x90, 0xff, 0x4f, 0xac, 0x2c, 0x4c, 0x43, 0x0c, 0x62, 0x52, 0x9a, 0xae, 0xba, - 0x61, 0x1a, 0x35, 0x26, 0x86, 0x25, 0x11, 0x0d, 0x5b, 0x74, 0xe5, 0x66, 0x32, 0x2d, 0x43, 0x3b, - 0xb1, 0x9d, 0xdb, 0x74, 0x2e, 0x60, 0xdf, 0xc2, 0x47, 0xf0, 0x61, 0x5c, 0xb0, 0x64, 0xe9, 0x8a, - 0x18, 0x78, 0x03, 0x9f, 0xc0, 0x40, 0x23, 0x6a, 0x82, 0x2e, 0xdc, 0xdd, 0x99, 0xc5, 0xf7, 0x9d, - 0x9c, 0x63, 0xba, 0x32, 0x08, 0xdb, 0x21, 0xa4, 0x19, 0x68, 0x1e, 0xc8, 0x44, 0x62, 0xd1, 0x4e, - 0xa7, 0x7e, 0x24, 0x94, 0xd0, 0x52, 0xd3, 0x2c, 0x07, 0x04, 0xeb, 0x7c, 0x0a, 0x79, 0x1a, 0x43, - 0x22, 0xd8, 0x08, 0xc6, 0x6a, 0xc8, 0x51, 0x82, 0xa2, 0xeb, 0xbf, 0x30, 0xe6, 0x52, 0x51, 0x19, - 0x84, 0xec, 0x1b, 0x81, 0xa5, 0x53, 0x3a, 0x39, 0x69, 0xd6, 0x23, 0x88, 0x60, 0x43, 0xf0, 0xd7, - 0x57, 0x09, 0x73, 0x9f, 0x2a, 0x66, 0xed, 0xba, 0xc4, 0xdf, 0x20, 0x47, 0x61, 0x3d, 0x13, 0xf3, - 0x08, 0x73, 0xae, 0x74, 0x06, 0x5a, 0x0c, 0xd9, 0x90, 0x23, 0x67, 0x52, 0xb1, 0x51, 0x22, 0xa3, - 0x18, 0x1b, 0xc4, 0xa9, 0x7a, 0xfb, 0xa7, 0x8c, 0xfe, 0x29, 0x02, 0xfd, 0x2a, 0xa2, 0xb7, 0x5b, - 0xc9, 0x25, 0x47, 0xde, 0x57, 0x57, 0x1b, 0x43, 0x4f, 0x61, 0x5e, 0x74, 0xbd, 0xd9, 0xa2, 0x65, - 0xbc, 0x2d, 0x5a, 0x4e, 0xc1, 0xd3, 0xa4, 0xe3, 0xfe, 0x98, 0xc7, 0x1d, 0x1c, 0xe2, 0x4e, 0x4c, - 0xb3, 0x6f, 0x1e, 0xff, 0x22, 0xb0, 0x0e, 0xcc, 0xea, 0xbd, 0x28, 0x1a, 0xc4, 0x21, 0xde, 0xde, - 0x60, 0x7d, 0x5a, 0x75, 0xf3, 0xdf, 0x84, 0x27, 0x63, 0xd1, 0xa8, 0x38, 0xc4, 0xab, 0x0d, 0xca, - 0x47, 0xa7, 0x72, 0x41, 0xba, 0x6c, 0xb6, 0xb4, 0xc9, 0x7c, 0x69, 0x93, 0xd7, 0xa5, 0x4d, 0x1e, - 0x57, 0xb6, 0x31, 0x5f, 0xd9, 0xc6, 0xcb, 0xca, 0x36, 0xee, 0x7a, 0x91, 0xc4, 0x78, 0x1c, 0xd0, - 0x10, 0x52, 0xff, 0xa3, 0x91, 0xf6, 0x67, 0x23, 0xfe, 0xb6, 0x11, 0xff, 0xc1, 0xdf, 0x39, 0x2c, - 0x16, 0x99, 0xd0, 0xc1, 0xff, 0xcd, 0x14, 0x67, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x99, 0x45, - 0x35, 0x0c, 0xfd, 0x01, 0x00, 0x00, +var fileDescriptor_e9f8ef7cefdfacd3 = []byte{ + // 321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xb1, 0x4e, 0xc2, 0x50, + 0x18, 0x85, 0x7b, 0x21, 0x9a, 0x58, 0x19, 0x4c, 0x43, 0x0c, 0x62, 0x52, 0x2a, 0x53, 0x17, 0x6e, + 0x83, 0x2e, 0x86, 0x91, 0x88, 0x86, 0xb8, 0xa1, 0x93, 0x4b, 0x73, 0x5b, 0x2e, 0xed, 0x8d, 0xbd, + 0xf7, 0x6f, 0x7a, 0x7f, 0xc0, 0xbe, 0x83, 0x83, 0x8f, 0xe2, 0x63, 0x30, 0x32, 0x3a, 0x11, 0x03, + 0x6f, 0xe0, 0x13, 0x18, 0x4a, 0x42, 0x30, 0x41, 0xdd, 0xce, 0x9f, 0xfc, 0xe7, 0x3b, 0xc9, 0x39, + 0xa6, 0x37, 0x85, 0x4c, 0x86, 0x31, 0x13, 0xca, 0x13, 0x41, 0xe8, 0x87, 0x20, 0x53, 0xd0, 0x2c, + 0x10, 0x89, 0xc0, 0xdc, 0x97, 0x53, 0x6f, 0xd2, 0xf6, 0x22, 0xae, 0xb8, 0x16, 0x9a, 0xa6, 0x19, + 0x20, 0x58, 0x17, 0x5b, 0x03, 0xdd, 0x67, 0xa0, 0x93, 0x76, 0xbd, 0x1a, 0x41, 0x04, 0xc5, 0xb7, + 0xb7, 0x56, 0x1b, 0x63, 0xf3, 0xb5, 0x64, 0x56, 0xee, 0x36, 0xa8, 0x07, 0x64, 0xc8, 0xad, 0x77, + 0x62, 0x9e, 0x61, 0xc6, 0x94, 0x4e, 0x41, 0xf3, 0xa1, 0x3f, 0x64, 0xc8, 0x7c, 0xa1, 0xfc, 0x51, + 0x22, 0xa2, 0x18, 0x6b, 0xc4, 0x29, 0xbb, 0xc7, 0x97, 0xf7, 0xf4, 0xdf, 0x38, 0xba, 0x0b, 0xa5, + 0x8f, 0x5b, 0xe0, 0x0d, 0x43, 0xd6, 0x57, 0xb7, 0x05, 0xad, 0xa7, 0x30, 0xcb, 0xbb, 0xee, 0x6c, + 0xd1, 0x30, 0xbe, 0x16, 0x0d, 0x27, 0x67, 0x32, 0xe9, 0x34, 0x7f, 0xcd, 0x6e, 0x0e, 0x4e, 0x71, + 0x2f, 0xa6, 0xde, 0x37, 0xcf, 0xff, 0x08, 0xb0, 0x4e, 0xcc, 0xf2, 0x33, 0xcf, 0x6b, 0xc4, 0x21, + 0xee, 0xd1, 0x60, 0x2d, 0xad, 0xaa, 0x79, 0x30, 0x61, 0xc9, 0x98, 0xd7, 0x4a, 0x0e, 0x71, 0x2b, + 0x83, 0xcd, 0xd1, 0x29, 0x5d, 0x93, 0xae, 0x3f, 0x5b, 0xda, 0x64, 0xbe, 0xb4, 0xc9, 0xe7, 0xd2, + 0x26, 0x6f, 0x2b, 0xdb, 0x98, 0xaf, 0x6c, 0xe3, 0x63, 0x65, 0x1b, 0x4f, 0xbd, 0x48, 0x60, 0x3c, + 0x0e, 0x68, 0x08, 0xb2, 0x58, 0x27, 0x86, 0x84, 0xb7, 0x46, 0x30, 0x56, 0x43, 0x86, 0x02, 0xd4, + 0xce, 0x62, 0x2f, 0xeb, 0xcd, 0x5a, 0x3f, 0x3a, 0x69, 0xc9, 0xa9, 0x87, 0x79, 0xca, 0x75, 0x70, + 0x58, 0xd4, 0x7e, 0xf5, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x80, 0x81, 0x43, 0xe2, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/ibc-composability-mw/types/ibc_hooks_test.go b/wormchain/x/ibc-composability-mw/types/ibc_hooks_test.go new file mode 100644 index 0000000000..52a2a95470 --- /dev/null +++ b/wormchain/x/ibc-composability-mw/types/ibc_hooks_test.go @@ -0,0 +1,89 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" +) + +// TestFormatIbcHooksMemo tests the FormatIbcHooksMemo function. +func TestFormatIbcHooksMemo(t *testing.T) { + ibcTranslatorContract := "wormhole123abc" + + for _, tc := range []struct { + testName string + payload types.ParsedPayload + shouldErr bool + }{ + { + testName: "Normal w/o payload - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: nil, + }, + shouldErr: false, + }, + { + testName: "Provide payload when unnecessary - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: []byte("{\"payload\":\"data\"}"), + }, + shouldErr: false, + }, + { + testName: "Normal w/ payload - should pass", + payload: types.ParsedPayload{ + NoPayload: false, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: []byte("{\"payload\":\"data\"}"), + }, + shouldErr: false, + }, + { + testName: "Nil payload - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: nil, + }, + shouldErr: false, + }, + } { + t.Run(tc.testName, func(t *testing.T) { + res, err := types.FormatIbcHooksMemo(tc.payload, ibcTranslatorContract) + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.NotNil(t, res) + + // validate payload was formatted correctly + if tc.payload.NoPayload { + require.NotContains(t, res, "gateway_convert_and_transfer_with_payload") + require.Contains(t, res, "recipient") + } else { + require.Contains(t, res, "gateway_convert_and_transfer_with_payload") + require.NotContains(t, res, "recipient") + require.Contains(t, res, "payload") + } + } + }) + } +} diff --git a/wormchain/x/ibc-composability-mw/types/pfm_test.go b/wormchain/x/ibc-composability-mw/types/pfm_test.go new file mode 100644 index 0000000000..8c9c72a5eb --- /dev/null +++ b/wormchain/x/ibc-composability-mw/types/pfm_test.go @@ -0,0 +1,118 @@ +package types_test + +import ( + "encoding/json" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/x/ibc-composability-mw/types" +) + +// TestFormatPfmMemo tests the FormatPfmMemo function. +func TestFormatPfmMemo(t *testing.T) { + for _, tc := range []struct { + testName string + payload types.ParsedPayload + queryResp types.IbcTranslatorQueryRsp + timeout time.Duration + retries uint8 + shouldErr bool + }{ + { + testName: "Normal w/o payload - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: nil, + }, + queryResp: types.IbcTranslatorQueryRsp{ + Channel: "channel", + }, + timeout: time.Hour, + retries: 3, + shouldErr: false, + }, + { + testName: "Provide payload when unnecessary - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: []byte("{\"payload\":\"data\"}"), + }, + queryResp: types.IbcTranslatorQueryRsp{ + Channel: "channel", + }, + timeout: time.Hour, + retries: 3, + shouldErr: false, + }, + { + testName: "Normal w/ payload - should pass", + payload: types.ParsedPayload{ + NoPayload: false, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: []byte("{\"payload\":\"data\"}"), + }, + queryResp: types.IbcTranslatorQueryRsp{ + Channel: "channel-34", + }, + timeout: time.Minute, + retries: 21, + shouldErr: false, + }, + { + testName: "Nil payload - should pass", + payload: types.ParsedPayload{ + NoPayload: true, + ChainId: 1, + Recipient: []byte{'a', 'b', 'c'}, + Fee: "0uworm", + Nonce: 1, + Payload: nil, + }, + queryResp: types.IbcTranslatorQueryRsp{ + Channel: "channel", + }, + timeout: time.Microsecond, + retries: 255, + shouldErr: false, + }, + } { + t.Run(tc.testName, func(t *testing.T) { + // turn the query response into bytes + queryRespBz, err := json.Marshal(tc.queryResp) + require.NoError(t, err) + + res, err := types.FormatPfmMemo(tc.payload, queryRespBz, tc.timeout, tc.retries) + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.NotNil(t, res) + + // convert response back to packet metadata + var packetMetadata types.PacketMetadata + err = json.Unmarshal([]byte(res), &packetMetadata) + require.NoError(t, err) + + // validation checks + require.Equal(t, string(tc.payload.Recipient), packetMetadata.Forward.Receiver) + require.Equal(t, "transfer", packetMetadata.Forward.Port) + require.Equal(t, tc.queryResp.Channel, packetMetadata.Forward.Channel) + require.Equal(t, tc.timeout, packetMetadata.Forward.Timeout) + require.Equal(t, &tc.retries, packetMetadata.Forward.Retries) + } + }) + } +} diff --git a/wormchain/x/ibc-hooks/client/cli/query.go b/wormchain/x/ibc-hooks/client/cli/query.go index d7b665d79f..2f3b89f6a5 100644 --- a/wormchain/x/ibc-hooks/client/cli/query.go +++ b/wormchain/x/ibc-hooks/client/cli/query.go @@ -4,13 +4,13 @@ import ( "fmt" "strings" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" "github.com/spf13/cobra" "github.com/wormhole-foundation/wormchain/x/ibc-hooks/keeper" - "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" + + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" ) func indexRunCmd(cmd *cobra.Command, args []string) error { diff --git a/wormchain/x/ibc-hooks/hooks.go b/wormchain/x/ibc-hooks/hooks.go index 49081b2cac..b139459483 100644 --- a/wormchain/x/ibc-hooks/hooks.go +++ b/wormchain/x/ibc-hooks/hooks.go @@ -5,9 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" // ibc-go - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) type Hooks interface{} @@ -112,13 +113,13 @@ type OnTimeoutPacketAfterHooks interface { // SendPacket Hooks type SendPacketOverrideHooks interface { - SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) error + SendPacketOverride(i ICS4Middleware, ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight ibcclienttypes.Height, timeoutTimestamp uint64, data []byte) (sequence uint64, err error) } type SendPacketBeforeHooks interface { - SendPacketBeforeHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) + SendPacketBeforeHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight ibcclienttypes.Height, timeoutTimestamp uint64, data []byte) } type SendPacketAfterHooks interface { - SendPacketAfterHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, err error) + SendPacketAfterHook(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight ibcclienttypes.Height, timeoutTimestamp uint64, data []byte, err error) } // WriteAcknowledgement Hooks diff --git a/wormchain/x/ibc-hooks/ibc_module.go b/wormchain/x/ibc-hooks/ibc_module.go index 50430eb08d..49e5b88cb5 100644 --- a/wormchain/x/ibc-hooks/ibc_module.go +++ b/wormchain/x/ibc-hooks/ibc_module.go @@ -5,10 +5,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" // ibc-go - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) var _ porttypes.Middleware = &IBCMiddleware{} @@ -237,9 +238,13 @@ func (im IBCMiddleware) OnTimeoutPacket( func (im IBCMiddleware) SendPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, -) error { - return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) + sourcePort string, + sourceChannel string, + timeoutHeight ibcclienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (sequence uint64, err error) { + return im.ICS4Middleware.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) } // WriteAcknowledgement implements the ICS4 Wrapper interface diff --git a/wormchain/x/ibc-hooks/ics4_middleware.go b/wormchain/x/ibc-hooks/ics4_middleware.go index 5aeeeca323..25a2ed983c 100644 --- a/wormchain/x/ibc-hooks/ics4_middleware.go +++ b/wormchain/x/ibc-hooks/ics4_middleware.go @@ -5,9 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" // ibc-go - porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) var _ porttypes.ICS4Wrapper = &ICS4Middleware{} @@ -26,22 +27,22 @@ func NewICS4Middleware(channel porttypes.ICS4Wrapper, hooks Hooks) ICS4Middlewar } } -func (i ICS4Middleware) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { +func (i ICS4Middleware) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight ibcclienttypes.Height, timeoutTimestamp uint64, data []byte) (sequence uint64, err error) { if hook, ok := i.Hooks.(SendPacketOverrideHooks); ok { - return hook.SendPacketOverride(i, ctx, channelCap, packet) + return hook.SendPacketOverride(i, ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) } if hook, ok := i.Hooks.(SendPacketBeforeHooks); ok { - hook.SendPacketBeforeHook(ctx, channelCap, packet) + hook.SendPacketBeforeHook(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) } - err := i.channel.SendPacket(ctx, channelCap, packet) + seq, err := i.channel.SendPacket(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) if hook, ok := i.Hooks.(SendPacketAfterHooks); ok { - hook.SendPacketAfterHook(ctx, channelCap, packet, err) + hook.SendPacketAfterHook(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data, err) } - return err + return seq, err } func (i ICS4Middleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) error { diff --git a/wormchain/x/ibc-hooks/keeper/keeper.go b/wormchain/x/ibc-hooks/keeper/keeper.go index bc7291a476..e9c7380534 100644 --- a/wormchain/x/ibc-hooks/keeper/keeper.go +++ b/wormchain/x/ibc-hooks/keeper/keeper.go @@ -3,24 +3,24 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/types/address" - - "github.com/tendermint/tendermint/libs/log" - "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + + "github.com/cometbft/cometbft/libs/log" ) type ( Keeper struct { - storeKey sdk.StoreKey + storeKey storetypes.StoreKey } ) // NewKeeper returns a new instance of the x/ibchooks keeper func NewKeeper( - storeKey sdk.StoreKey, + storeKey storetypes.StoreKey, ) Keeper { return Keeper{ storeKey: storeKey, @@ -57,6 +57,6 @@ func (k Keeper) DeletePacketCallback(ctx sdk.Context, channel string, packetSequ func DeriveIntermediateSender(channel, originalSender, bech32Prefix string) (string, error) { senderStr := fmt.Sprintf("%s/%s", channel, originalSender) senderHash32 := address.Hash(types.SenderPrefix, []byte(senderStr)) - sender := sdk.AccAddress(senderHash32[:]) + sender := sdk.AccAddress(senderHash32) return sdk.Bech32ifyAddressBytes(bech32Prefix, sender) } diff --git a/wormchain/x/ibc-hooks/sdkmodule.go b/wormchain/x/ibc-hooks/sdkmodule.go index 11a5d714fe..74620ca5ca 100644 --- a/wormchain/x/ibc-hooks/sdkmodule.go +++ b/wormchain/x/ibc-hooks/sdkmodule.go @@ -2,24 +2,21 @@ package ibc_hooks import ( "encoding/json" - "fmt" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/wormhole-foundation/wormchain/x/ibc-hooks/client/cli" "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/types/module" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + + abci "github.com/cometbft/cometbft/abci/types" ) var ( @@ -94,21 +91,6 @@ func (AppModule) Name() string { // RegisterInvariants registers the ibc-hooks module invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// Route returns the message routing key for the ibc-hooks module. -func (AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns the module's querier route name. -func (AppModule) QuerierRoute() string { - return "" -} - -// LegacyQuerierHandler returns the x/ibc-hooks module's sdk.Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(sdk.Context, []string, abci.RequestQuery) ([]byte, error) { - return nil, fmt.Errorf("legacy querier not supported for the x/%s module", types.ModuleName) - } -} - // RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { diff --git a/wormchain/x/ibc-hooks/types/errors.go b/wormchain/x/ibc-hooks/types/errors.go index 9683d397f9..7a03787932 100644 --- a/wormchain/x/ibc-hooks/types/errors.go +++ b/wormchain/x/ibc-hooks/types/errors.go @@ -1,15 +1,15 @@ package types -import sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +import errors "cosmossdk.io/errors" var ( ErrBadMetadataFormatMsg = "wasm metadata not properly formatted for: '%v'. %s" ErrBadExecutionMsg = "cannot execute contract: %v" - ErrMsgValidation = sdkerrors.Register("wasm-hooks", 2, "error in wasmhook message validation") - ErrMarshaling = sdkerrors.Register("wasm-hooks", 3, "cannot marshal the ICS20 packet") - ErrInvalidPacket = sdkerrors.Register("wasm-hooks", 4, "invalid packet data") - ErrBadResponse = sdkerrors.Register("wasm-hooks", 5, "cannot create response") - ErrWasmError = sdkerrors.Register("wasm-hooks", 6, "wasm error") - ErrBadSender = sdkerrors.Register("wasm-hooks", 7, "bad sender") + ErrMsgValidation = errors.Register("wasm-hooks", 2, "error in wasmhook message validation") + ErrMarshaling = errors.Register("wasm-hooks", 3, "cannot marshal the ICS20 packet") + ErrInvalidPacket = errors.Register("wasm-hooks", 4, "invalid packet data") + ErrBadResponse = errors.Register("wasm-hooks", 5, "cannot create response") + ErrWasmError = errors.Register("wasm-hooks", 6, "wasm error") + ErrBadSender = errors.Register("wasm-hooks", 7, "bad sender") ) diff --git a/wormchain/x/ibc-hooks/wasm_hook.go b/wormchain/x/ibc-hooks/wasm_hook.go index 6088fad5d6..b41e90881f 100644 --- a/wormchain/x/ibc-hooks/wasm_hook.go +++ b/wormchain/x/ibc-hooks/wasm_hook.go @@ -4,19 +4,20 @@ import ( "encoding/json" "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/wormhole-foundation/wormchain/x/ibc-hooks/keeper" + "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" + + errors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/wormhole-foundation/wormchain/x/ibc-hooks/keeper" - "github.com/wormhole-foundation/wormchain/x/ibc-hooks/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) type ContractAck struct { @@ -25,12 +26,12 @@ type ContractAck struct { } type WasmHooks struct { - ContractKeeper *wasmkeeper.PermissionedKeeper + ContractKeeper *wasmkeeper.Keeper ibcHooksKeeper *keeper.Keeper bech32PrefixAccAddr string } -func NewWasmHooks(ibcHooksKeeper *keeper.Keeper, contractKeeper *wasmkeeper.PermissionedKeeper, bech32PrefixAccAddr string) WasmHooks { +func NewWasmHooks(ibcHooksKeeper *keeper.Keeper, contractKeeper *wasmkeeper.Keeper, bech32PrefixAccAddr string) WasmHooks { return WasmHooks{ ContractKeeper: contractKeeper, ibcHooksKeeper: ibcHooksKeeper, @@ -47,7 +48,7 @@ func (h WasmHooks) OnRecvPacketOverride(im IBCMiddleware, ctx sdk.Context, packe // Not configured return im.App.OnRecvPacket(ctx, packet, relayer) } - isIcs20, data := isIcs20Packet(packet) + isIcs20, data := isIcs20Packet(packet.GetData()) if !isIcs20 { return im.App.OnRecvPacket(ctx, packet, relayer) } @@ -131,12 +132,12 @@ func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteCon return wasmMsgServer.ExecuteContract(sdk.WrapSDKContext(ctx), execMsg) } -func isIcs20Packet(packet channeltypes.Packet) (isIcs20 bool, ics20data transfertypes.FungibleTokenPacketData) { - var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { - return false, data +func isIcs20Packet(data []byte) (isIcs20 bool, ics20data transfertypes.FungibleTokenPacketData) { + var packetdata transfertypes.FungibleTokenPacketData + if err := json.Unmarshal(data, &packetdata); err != nil { + return false, packetdata } - return true, data + return true, packetdata } // jsonStringHasKey parses the memo as a json object and checks if it contains the key. @@ -224,20 +225,15 @@ func ValidateAndParseMemo(memo string, receiver string) (isWasmRouted bool, cont return isWasmRouted, contractAddr, msgBytes, nil } -func (h WasmHooks) SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { - concretePacket, ok := packet.(channeltypes.Packet) - if !ok { - return i.channel.SendPacket(ctx, chanCap, packet) // continue - } - - isIcs20, data := isIcs20Packet(concretePacket) +func (h WasmHooks) SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight ibcclienttypes.Height, timeoutTimestamp uint64, data []byte) (sequence uint64, err error) { + isIcs20, ics20data := isIcs20Packet(data) if !isIcs20 { - return i.channel.SendPacket(ctx, chanCap, packet) // continue + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) // continue } - isCallbackRouted, metadata := jsonStringHasKey(data.GetMemo(), types.IBCCallbackKey) + isCallbackRouted, metadata := jsonStringHasKey(ics20data.GetMemo(), types.IBCCallbackKey) if !isCallbackRouted { - return i.channel.SendPacket(ctx, chanCap, packet) // continue + return i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) // continue } // We remove the callback metadata from the memo as it has already been processed. @@ -245,52 +241,40 @@ func (h WasmHooks) SendPacketOverride(i ICS4Middleware, ctx sdk.Context, chanCap // If the only available key in the memo is the callback, we should remove the memo // from the data completely so the packet is sent without it. // This way receiver chains that are on old versions of IBC will be able to process the packet - callbackRaw := metadata[types.IBCCallbackKey] // This will be used later. delete(metadata, types.IBCCallbackKey) bzMetadata, err := json.Marshal(metadata) if err != nil { - return sdkerrors.Wrap(err, "Send packet with callback error") + return 0, errors.Wrap(err, "ibc_callback marshall error") } stringMetadata := string(bzMetadata) if stringMetadata == "{}" { - data.Memo = "" + ics20data.Memo = "" } else { - data.Memo = stringMetadata + ics20data.Memo = stringMetadata } - dataBytes, err := json.Marshal(data) + dataBytes, err := json.Marshal(ics20data) if err != nil { - return sdkerrors.Wrap(err, "Send packet with callback error") - } - - packetWithoutCallbackMemo := channeltypes.Packet{ - Sequence: concretePacket.Sequence, - SourcePort: concretePacket.SourcePort, - SourceChannel: concretePacket.SourceChannel, - DestinationPort: concretePacket.DestinationPort, - DestinationChannel: concretePacket.DestinationChannel, - Data: dataBytes, - TimeoutTimestamp: concretePacket.TimeoutTimestamp, - TimeoutHeight: concretePacket.TimeoutHeight, + return 0, errors.Wrap(err, "ics20data marshall error") } - err = i.channel.SendPacket(ctx, chanCap, packetWithoutCallbackMemo) + seq, err := i.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, dataBytes) if err != nil { - return err + return 0, err } // Make sure the callback contract is a string and a valid bech32 addr. If it isn't, ignore this packet contract, ok := callbackRaw.(string) if !ok { - return nil + return 0, nil } _, err = sdk.AccAddressFromBech32(contract) if err != nil { - return nil + return 0, nil } - h.ibcHooksKeeper.StorePacketCallback(ctx, packet.GetSourceChannel(), packet.GetSequence(), contract) - return nil + h.ibcHooksKeeper.StorePacketCallback(ctx, sourceChannel, seq, contract) + return seq, nil } func (h WasmHooks) OnAcknowledgementPacketOverride(im IBCMiddleware, ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error { @@ -312,7 +296,7 @@ func (h WasmHooks) OnAcknowledgementPacketOverride(im IBCMiddleware, ctx sdk.Con contractAddr, err := sdk.AccAddressFromBech32(contract) if err != nil { - return sdkerrors.Wrap(err, "Ack callback error") // The callback configured is not a bech32. Error out + return errors.Wrap(err, "Ack callback error") // The callback configured is not a bech32. Error out } success := "false" @@ -334,7 +318,7 @@ func (h WasmHooks) OnAcknowledgementPacketOverride(im IBCMiddleware, ctx sdk.Con if err != nil { // error processing the callback // ToDo: Open Question: Should we also delete the callback here? - return sdkerrors.Wrap(err, "Ack callback error") + return errors.Wrap(err, "Ack callback error") } h.ibcHooksKeeper.DeletePacketCallback(ctx, packet.GetSourceChannel(), packet.GetSequence()) return nil @@ -359,7 +343,7 @@ func (h WasmHooks) OnTimeoutPacketOverride(im IBCMiddleware, ctx sdk.Context, pa contractAddr, err := sdk.AccAddressFromBech32(contract) if err != nil { - return sdkerrors.Wrap(err, "Timeout callback error") // The callback configured is not a bech32. Error out + return errors.Wrap(err, "Timeout callback error") // The callback configured is not a bech32. Error out } sudoMsg := []byte(fmt.Sprintf( @@ -421,7 +405,7 @@ func IsJsonAckError(acknowledgement []byte) bool { // If the data cannot be unmarshalled this function will panic func MustExtractDenomFromPacketOnRecv(packet ibcexported.PacketI) string { var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + if err := json.Unmarshal(packet.GetData(), &data); err != nil { panic("unable to unmarshal ICS20 packet data") } diff --git a/wormchain/x/tokenfactory/bindings/custom_msg_test.go b/wormchain/x/tokenfactory/bindings/custom_msg_test.go index b812a9bbf8..4e64833faa 100644 --- a/wormchain/x/tokenfactory/bindings/custom_msg_test.go +++ b/wormchain/x/tokenfactory/bindings/custom_msg_test.go @@ -5,69 +5,70 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/require" - "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmvmtypes "github.com/CosmWasm/wasmvm/types" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/wormhole-foundation/wormchain/app" bindings "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings/types" - //"github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) func TestCreateDenomMsg(t *testing.T) { creator := RandomAccountAddress() - osmosis, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) lucky := RandomAccountAddress() - reflect := instantiateReflectContract(t, ctx, osmosis, lucky) + reflect := instantiateReflectContract(t, ctx, wormchain, lucky) require.NotEmpty(t, reflect) // Fund reflect contract with 100 base denom creation fees - //reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, osmosis, reflect, reflectAmount) + // reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, reflect, reflectAmount) - msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{ - Subdenom: "SUN", - }} - err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + msg := bindings.TokenMsg{ + CreateDenom: &bindings.CreateDenom{ + Subdenom: "SUN", + }, + } + err := executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) // query the denom and see if it matches - /*query := bindings.TokenQuery{ + /*query := bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "SUN", }, } resp := bindings.FullDenomResponse{} - queryCustom(t, ctx, osmosis, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) - require.Equal(t, &resp.AuthorityMetadata.Admin, reflect.String())*/ + require.Equal(t, resp.Denom, fmt.Sprintf("factory/%s/SUN", reflect.String()))*/ } func TestMintMsg(t *testing.T) { creator := RandomAccountAddress() - osmosis, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) lucky := RandomAccountAddress() - reflect := instantiateReflectContract(t, ctx, osmosis, lucky) + reflect := instantiateReflectContract(t, ctx, wormchain, lucky) require.NotEmpty(t, reflect) // Fund reflect contract with 100 base denom creation fees - //reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, osmosis, reflect, reflectAmount) + // reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, reflect, reflectAmount) // lucky was broke - balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances := wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Empty(t, balances) // Create denom for minting msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{ Subdenom: "SUN", }} - err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err := executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) sunDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom) @@ -78,46 +79,46 @@ func TestMintMsg(t *testing.T) { Amount: amount, MintToAddress: lucky.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) - balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances = wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Len(t, balances, 1) coin := balances[0] require.Equal(t, amount, coin.Amount) require.Contains(t, coin.Denom, "factory/") // query the denom and see if it matches - /*query := bindings.TokenQuery{ + /*query := bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "SUN", }, } resp := bindings.FullDenomResponse{} - queryCustom(t, ctx, osmosis, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) require.Equal(t, resp.Denom, coin.Denom)*/ // mint the same denom again - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) - balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances = wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Len(t, balances, 1) coin = balances[0] require.Equal(t, amount.MulRaw(2), coin.Amount) require.Contains(t, coin.Denom, "factory/") // query the denom and see if it matches - /*query = bindings.TokenQuery{ + /*query = bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "SUN", }, } resp = bindings.FullDenomResponse{} - queryCustom(t, ctx, osmosis, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) require.Equal(t, resp.Denom, coin.Denom)*/ @@ -126,7 +127,7 @@ func TestMintMsg(t *testing.T) { msg = bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{ Subdenom: "MOON", }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) moonDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom) @@ -136,24 +137,24 @@ func TestMintMsg(t *testing.T) { Amount: amount, MintToAddress: lucky.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) - balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances = wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Len(t, balances, 2) coin = balances[0] require.Equal(t, amount, coin.Amount) require.Contains(t, coin.Denom, "factory/") // query the denom and see if it matches - /*query = bindings.TokenQuery{ + /*query = bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "MOON", }, } resp = bindings.FullDenomResponse{} - queryCustom(t, ctx, osmosis, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) require.Equal(t, resp.Denom, coin.Denom)*/ @@ -163,41 +164,41 @@ func TestMintMsg(t *testing.T) { require.Contains(t, coin.Denom, "factory/") // query the denom and see if it matches - /*query = bindings.TokenQuery{ + /*query = bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "SUN", }, } resp = bindings.FullDenomResponse{} - queryCustom(t, ctx, osmosis, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) require.Equal(t, resp.Denom, coin.Denom)*/ } -// Capability is disabled +// Capability disabled /*func TestForceTransfer(t *testing.T) { creator := RandomAccountAddress() - osmosis, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) lucky := RandomAccountAddress() rcpt := RandomAccountAddress() - reflect := instantiateReflectContract(t, ctx, osmosis, lucky) + reflect := instantiateReflectContract(t, ctx, wormchain, lucky) require.NotEmpty(t, reflect) // Fund reflect contract with 100 base denom creation fees - //reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, osmosis, reflect, reflectAmount) + reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + fundAccount(t, ctx, wormchain, reflect, reflectAmount) // lucky was broke - balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances := wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Empty(t, balances) // Create denom for minting - msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{ + msg := bindings.TokenFactoryMsg{CreateDenom: &bindings.CreateDenom{ Subdenom: "SUN", }} - err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err := executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) sunDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom) @@ -205,26 +206,26 @@ func TestMintMsg(t *testing.T) { require.True(t, ok) // Mint new tokens to lucky - msg = bindings.TokenMsg{MintTokens: &bindings.MintTokens{ + msg = bindings.TokenFactoryMsg{MintTokens: &bindings.MintTokens{ Denom: sunDenom, Amount: amount, MintToAddress: lucky.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) // Force move 100 tokens from lucky to rcpt - msg = bindings.TokenMsg{ForceTransfer: &bindings.ForceTransfer{ + msg = bindings.TokenFactoryMsg{ForceTransfer: &bindings.ForceTransfer{ Denom: sunDenom, Amount: sdk.NewInt(100), FromAddress: lucky.String(), ToAddress: rcpt.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) // check the balance of rcpt - balances = osmosis.BankKeeper.GetAllBalances(ctx, rcpt) + balances = wormchain.BankKeeper.GetAllBalances(ctx, rcpt) require.Len(t, balances, 1) coin := balances[0] require.Equal(t, sdk.NewInt(100), coin.Amount) @@ -232,25 +233,25 @@ func TestMintMsg(t *testing.T) { func TestBurnMsg(t *testing.T) { creator := RandomAccountAddress() - osmosis, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) lucky := RandomAccountAddress() - reflect := instantiateReflectContract(t, ctx, osmosis, lucky) + reflect := instantiateReflectContract(t, ctx, wormchain, lucky) require.NotEmpty(t, reflect) // Fund reflect contract with 100 base denom creation fees - //reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, osmosis, reflect, reflectAmount) + // reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, reflect, reflectAmount) // lucky was broke - balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky) + balances := wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Empty(t, balances) // Create denom for minting msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{ Subdenom: "SUN", }} - err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err := executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) sunDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom) @@ -262,33 +263,32 @@ func TestBurnMsg(t *testing.T) { Amount: amount, MintToAddress: lucky.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err) + // Capability disabled // can burn from different address with burnFrom - // Capability is disabled /*amt, ok := sdk.NewIntFromString("1") require.True(t, ok) - msg = bindings.TokenMsg{BurnTokens: &bindings.BurnTokens{ + msg = bindings.TokenFactoryMsg{BurnTokens: &bindings.BurnTokens{ Denom: sunDenom, Amount: amt, BurnFromAddress: lucky.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) - require.NoError(t, err)*/ + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) + require.NoError(t, err) // lucky needs to send balance to reflect contract to burn it - // Capability is disabled - /*luckyBalance := osmosis.BankKeeper.GetAllBalances(ctx, lucky) - err = osmosis.BankKeeper.SendCoins(ctx, lucky, reflect, luckyBalance) + luckyBalance := wormchain.BankKeeper.GetAllBalances(ctx, lucky) + err = wormchain.BankKeeper.SendCoins(ctx, lucky, reflect, luckyBalance) require.NoError(t, err) - msg = bindings.TokenMsg{BurnTokens: &bindings.BurnTokens{ + msg = bindings.TokenFactoryMsg{BurnTokens: &bindings.BurnTokens{ Denom: sunDenom, Amount: amount.Abs().Sub(sdk.NewInt(1)), BurnFromAddress: reflect.String(), }} - err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{}) + err = executeCustom(t, ctx, wormchain, reflect, lucky, msg, sdk.Coin{}) require.NoError(t, err)*/ } @@ -305,7 +305,7 @@ type ReflectSubMsgs struct { Msgs []wasmvmtypes.SubMsg `json:"msgs"` } -func executeCustom(t *testing.T, ctx sdk.Context, osmosis *app.App, contract sdk.AccAddress, sender sdk.AccAddress, msg bindings.TokenMsg, funds sdk.Coin) error { +func executeCustom(t *testing.T, ctx sdk.Context, wormchain *app.App, contract sdk.AccAddress, sender sdk.AccAddress, msg bindings.TokenMsg, funds sdk.Coin) error { //nolint:unparam // funds is always nil but could change in the future. wrapped := bindings.TokenFactoryMsg{ Token: &msg, } @@ -328,7 +328,7 @@ func executeCustom(t *testing.T, ctx sdk.Context, osmosis *app.App, contract sdk coins = sdk.Coins{funds} } - contractKeeper := keeper.NewDefaultPermissionKeeper(osmosis.GetWasmKeeper()) + contractKeeper := keeper.NewDefaultPermissionKeeper(wormchain.GetWasmKeeper()) _, err = contractKeeper.Execute(ctx, contract, sender, reflectBz, coins) return err } diff --git a/wormchain/x/tokenfactory/bindings/custom_query_test.go b/wormchain/x/tokenfactory/bindings/custom_query_test.go index e7e101d573..5ebca9dd17 100644 --- a/wormchain/x/tokenfactory/bindings/custom_query_test.go +++ b/wormchain/x/tokenfactory/bindings/custom_query_test.go @@ -5,31 +5,32 @@ import ( "fmt" "testing" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" "github.com/stretchr/testify/require" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/wormhole-foundation/wormchain/app" bindings "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings/types" ) +// Capability disabled /*func TestQueryFullDenom(t *testing.T) { actor := RandomAccountAddress() - tokenz, ctx := SetupCustomApp(t, actor) + wormchain, ctx := SetupCustomApp(t, actor) - reflect := instantiateReflectContract(t, ctx, tokenz, actor) + reflect := instantiateReflectContract(t, ctx, wormchain, actor) require.NotEmpty(t, reflect) // query full denom - query := bindings.TokenQuery{ + query := bindings.TokenFactoryQuery{ FullDenom: &bindings.FullDenom{ CreatorAddr: reflect.String(), Subdenom: "ustart", }, } resp := bindings.FullDenomResponse{} - queryCustom(t, ctx, tokenz, reflect, query, &resp) + queryCustom(t, ctx, wormchain, reflect, query, &resp) expected := fmt.Sprintf("factory/%s/ustart", reflect.String()) require.EqualValues(t, expected, resp.Denom) @@ -47,13 +48,10 @@ type ChainResponse struct { Data []byte `json:"data"` } -func queryCustom(t *testing.T, ctx sdk.Context, tokenz *app.App, contract sdk.AccAddress, request bindings.TokenQuery, response interface{}) { - wrapped := bindings.TokenFactoryQuery{ - Token: &request, - } - msgBz, err := json.Marshal(wrapped) +func queryCustom(t *testing.T, ctx sdk.Context, wormchain *app.App, contract sdk.AccAddress, request bindings.TokenFactoryQuery, response interface{}) { + msgBz, err := json.Marshal(request) require.NoError(t, err) - fmt.Println(string(msgBz)) + fmt.Println("queryCustom1", string(msgBz)) query := ReflectQuery{ Chain: &ChainRequest{ @@ -62,9 +60,9 @@ func queryCustom(t *testing.T, ctx sdk.Context, tokenz *app.App, contract sdk.Ac } queryBz, err := json.Marshal(query) require.NoError(t, err) - fmt.Println(string(queryBz)) + fmt.Println("queryCustom2", string(queryBz)) - resBz, err := tokenz.GetWasmKeeper().QuerySmart(ctx, contract, queryBz) + resBz, err := wormchain.GetWasmKeeper().QuerySmart(ctx, contract, queryBz) require.NoError(t, err) var resp ChainResponse err = json.Unmarshal(resBz, &resp) diff --git a/wormchain/x/tokenfactory/bindings/helpers_test.go b/wormchain/x/tokenfactory/bindings/helpers_test.go index 2105d65271..41717eb352 100644 --- a/wormchain/x/tokenfactory/bindings/helpers_test.go +++ b/wormchain/x/tokenfactory/bindings/helpers_test.go @@ -5,28 +5,28 @@ import ( "testing" "time" + "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/ed25519" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cometbft/cometbft/crypto" + "github.com/cometbft/cometbft/crypto/ed25519" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" - "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/wormhole-foundation/wormchain/app" "github.com/wormhole-foundation/wormchain/app/apptesting" ) func CreateTestInput(t *testing.T) (*app.App, sdk.Context) { - osmosis := apptesting.Setup(t, true, 0) - ctx := osmosis.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "osmosis-1", Time: time.Now().UTC()}) - return osmosis, ctx + wormchain := apptesting.Setup(t, true, 0) + ctx := wormchain.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "testing", Time: time.Now().UTC()}) + return wormchain, ctx } -func FundAccount(t *testing.T, ctx sdk.Context, osmosis *app.App, acct sdk.AccAddress) { - err := simapp.FundAccount(osmosis.BankKeeper, ctx, acct, sdk.NewCoins( +func FundAccount(t *testing.T, ctx sdk.Context, wormchain *app.App, acct sdk.AccAddress) { + err := banktestutil.FundAccount(wormchain.BankKeeper, ctx, acct, sdk.NewCoins( sdk.NewCoin("uosmo", sdk.NewInt(10000000000)), )) require.NoError(t, err) @@ -49,20 +49,20 @@ func RandomBech32AccountAddress() string { return RandomAccountAddress().String() } -func storeReflectCode(t *testing.T, ctx sdk.Context, tokenz *app.App, addr sdk.AccAddress) uint64 { +func storeReflectCode(t *testing.T, ctx sdk.Context, wormchain *app.App, addr sdk.AccAddress) uint64 { wasmCode, err := os.ReadFile("./testdata/token_reflect.wasm") require.NoError(t, err) - contractKeeper := keeper.NewDefaultPermissionKeeper(tokenz.GetWasmKeeper()) + contractKeeper := keeper.NewDefaultPermissionKeeper(wormchain.GetWasmKeeper()) codeID, _, err := contractKeeper.Create(ctx, addr, wasmCode, nil) require.NoError(t, err) return codeID } -func instantiateReflectContract(t *testing.T, ctx sdk.Context, tokenz *app.App, funder sdk.AccAddress) sdk.AccAddress { +func instantiateReflectContract(t *testing.T, ctx sdk.Context, wormchain *app.App, funder sdk.AccAddress) sdk.AccAddress { initMsgBz := []byte("{}") - contractKeeper := keeper.NewDefaultPermissionKeeper(tokenz.GetWasmKeeper()) + contractKeeper := keeper.NewDefaultPermissionKeeper(wormchain.GetWasmKeeper()) codeID := uint64(1) addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) require.NoError(t, err) @@ -70,9 +70,9 @@ func instantiateReflectContract(t *testing.T, ctx sdk.Context, tokenz *app.App, return addr } -func fundAccount(t *testing.T, ctx sdk.Context, tokenz *app.App, addr sdk.AccAddress, coins sdk.Coins) { - err := simapp.FundAccount( - tokenz.BankKeeper, +func fundAccount(t *testing.T, ctx sdk.Context, wormchain *app.App, addr sdk.AccAddress, coins sdk.Coins) { + err := banktestutil.FundAccount( + wormchain.BankKeeper, ctx, addr, coins, @@ -81,13 +81,13 @@ func fundAccount(t *testing.T, ctx sdk.Context, tokenz *app.App, addr sdk.AccAdd } func SetupCustomApp(t *testing.T, addr sdk.AccAddress) (*app.App, sdk.Context) { - tokenz, ctx := CreateTestInput(t) - wasmKeeper := tokenz.GetWasmKeeper() + wormchain, ctx := CreateTestInput(t) + wasmKeeper := wormchain.GetWasmKeeper() - storeReflectCode(t, ctx, tokenz, addr) + storeReflectCode(t, ctx, wormchain, addr) cInfo := wasmKeeper.GetCodeInfo(ctx, 1) require.NotNil(t, cInfo) - return tokenz, ctx + return wormchain, ctx } diff --git a/wormchain/x/tokenfactory/bindings/message_plugin.go b/wormchain/x/tokenfactory/bindings/message_plugin.go index 33c57d07b8..ae0e5140bb 100644 --- a/wormchain/x/tokenfactory/bindings/message_plugin.go +++ b/wormchain/x/tokenfactory/bindings/message_plugin.go @@ -2,11 +2,14 @@ package bindings import ( "encoding/json" + "errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmvmtypes "github.com/CosmWasm/wasmvm/types" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -16,7 +19,7 @@ import ( ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages -func CustomMessageDecorator(bank *bankkeeper.BaseKeeper, tokenFactory *tokenfactorykeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger { +func CustomMessageDecorator(bank bankkeeper.Keeper, tokenFactory *tokenfactorykeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger { return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { return &CustomMessenger{ wrapped: old, @@ -28,7 +31,7 @@ func CustomMessageDecorator(bank *bankkeeper.BaseKeeper, tokenFactory *tokenfact type CustomMessenger struct { wrapped wasmkeeper.Messenger - bank *bankkeeper.BaseKeeper + bank bankkeeper.Keeper tokenFactory *tokenfactorykeeper.Keeper } @@ -41,10 +44,10 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre // leave everything else for the wrapped version var contractMsg bindingstypes.TokenFactoryMsg if err := json.Unmarshal(msg.Custom, &contractMsg); err != nil { - return nil, nil, sdkerrors.Wrap(err, "token factory msg") + return nil, nil, errorsmod.Wrap(err, "token factory msg") } if contractMsg.Token == nil { - return nil, nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") + return nil, nil, errors.New("token factory msg; token is nil") } tokenMsg := contractMsg.Token @@ -74,13 +77,14 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre func (m *CustomMessenger) createDenom(ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]sdk.Event, [][]byte, error) { bz, err := PerformCreateDenom(m.tokenFactory, m.bank, ctx, contractAddr, createDenom) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform create denom") + return nil, nil, errorsmod.Wrap(err, "perform create denom") } + // TODO: double check how this is all encoded to the contract return nil, [][]byte{bz}, nil } // PerformCreateDenom is used with createDenom to create a token denom; validates the msgCreateDenom. -func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]byte, error) { +func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b bankkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]byte, error) { if createDenom == nil { return nil, wasmvmtypes.InvalidRequest{Err: "create denom null create denom"} } @@ -90,7 +94,7 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, msgCreateDenom := tokenfactorytypes.NewMsgCreateDenom(contractAddr.String(), createDenom.Subdenom) if err := msgCreateDenom.ValidateBasic(); err != nil { - return nil, sdkerrors.Wrap(err, "failed validating MsgCreateDenom") + return nil, errorsmod.Wrap(err, "failed validating MsgCreateDenom") } // Create denom @@ -99,14 +103,14 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, msgCreateDenom, ) if err != nil { - return nil, sdkerrors.Wrap(err, "creating denom") + return nil, errorsmod.Wrap(err, "creating denom") } if createDenom.Metadata != nil { newDenom := resp.NewTokenDenom err := PerformSetMetadata(f, b, ctx, contractAddr, newDenom, *createDenom.Metadata) if err != nil { - return nil, sdkerrors.Wrap(err, "setting metadata") + return nil, errorsmod.Wrap(err, "setting metadata") } } @@ -117,13 +121,13 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, func (m *CustomMessenger) mintTokens(ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) ([]sdk.Event, [][]byte, error) { err := PerformMint(m.tokenFactory, m.bank, ctx, contractAddr, mint) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform mint") + return nil, nil, errorsmod.Wrap(err, "perform mint") } return nil, nil, nil } // PerformMint used with mintTokens to validate the mint message and mint through token factory. -func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) error { +func PerformMint(f *tokenfactorykeeper.Keeper, b bankkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) error { if mint == nil { return wasmvmtypes.InvalidRequest{Err: "mint token null mint"} } @@ -143,16 +147,16 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err = msgServer.Mint(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { - return sdkerrors.Wrap(err, "minting coins from message") + return errorsmod.Wrap(err, "minting coins from message") } if b.BlockedAddr(rcpt) { - return sdkerrors.Wrapf(err, "minting coins to blocked address %s", rcpt.String()) + return errorsmod.Wrapf(err, "minting coins to blocked address %s", rcpt.String()) } err = b.SendCoins(ctx, contractAddr, rcpt, sdk.NewCoins(coin)) if err != nil { - return sdkerrors.Wrap(err, "sending newly minted coins from message") + return errorsmod.Wrap(err, "sending newly minted coins from message") } return nil } @@ -161,7 +165,7 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk func (m *CustomMessenger) changeAdmin(ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindingstypes.ChangeAdmin) ([]sdk.Event, [][]byte, error) { err := ChangeAdmin(m.tokenFactory, ctx, contractAddr, changeAdmin) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "failed to change admin") + return nil, nil, errorsmod.Wrap(err, "failed to change admin") } return nil, nil, nil } @@ -184,7 +188,7 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err = msgServer.ChangeAdmin(sdk.WrapSDKContext(ctx), changeAdminMsg) if err != nil { - return sdkerrors.Wrap(err, "failed changing admin from message") + return errorsmod.Wrap(err, "failed changing admin from message") } return nil } @@ -193,7 +197,7 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindingstypes.BurnTokens) ([]sdk.Event, [][]byte, error) { err := PerformBurn(m.tokenFactory, ctx, contractAddr, burn) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform burn") + return nil, nil, errorsmod.Wrap(err, "perform burn") } return nil, nil, nil } @@ -218,7 +222,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err := msgServer.Burn(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { - return sdkerrors.Wrap(err, "burning coins from message") + return errorsmod.Wrap(err, "burning coins from message") } return nil } @@ -227,7 +231,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk func (m *CustomMessenger) forceTransfer(ctx sdk.Context, contractAddr sdk.AccAddress, forcetransfer *bindingstypes.ForceTransfer) ([]sdk.Event, [][]byte, error) { err := PerformForceTransfer(m.tokenFactory, ctx, contractAddr, forcetransfer) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform force transfer") + return nil, nil, errorsmod.Wrap(err, "perform force transfer") } return nil, nil, nil } @@ -259,7 +263,7 @@ func PerformForceTransfer(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contrac msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err = msgServer.ForceTransfer(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { - return sdkerrors.Wrap(err, "force transferring from message") + return errorsmod.Wrap(err, "force transferring from message") } return nil } @@ -268,14 +272,14 @@ func PerformForceTransfer(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contrac func (m *CustomMessenger) setMetadata(ctx sdk.Context, contractAddr sdk.AccAddress, setMetadata *bindingstypes.SetMetadata) ([]sdk.Event, [][]byte, error) { err := PerformSetMetadata(m.tokenFactory, m.bank, ctx, contractAddr, setMetadata.Denom, setMetadata.Metadata) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform create denom") + return nil, nil, errorsmod.Wrap(err, "perform create denom") } return nil, nil, nil } // PerformSetMetadata is used with setMetadata to add new metadata // It also is called inside CreateDenom if optional metadata field is set -func PerformSetMetadata(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, denom string, metadata bindingstypes.Metadata) error { +func PerformSetMetadata(f *tokenfactorykeeper.Keeper, b bankkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, denom string, metadata bindingstypes.Metadata) error { // ensure contract address is admin of denom auth, err := f.GetAuthorityMetadata(ctx, denom) if err != nil { @@ -311,7 +315,7 @@ func GetFullDenom(contract string, subDenom string) (string, error) { } fullDenom, err := tokenfactorytypes.GetTokenDenom(contract, subDenom) if err != nil { - return "", sdkerrors.Wrap(err, "validate sub-denom") + return "", errorsmod.Wrap(err, "validate sub-denom") } return fullDenom, nil @@ -321,11 +325,11 @@ func GetFullDenom(contract string, subDenom string) (string, error) { func parseAddress(addr string) (sdk.AccAddress, error) { parsed, err := sdk.AccAddressFromBech32(addr) if err != nil { - return nil, sdkerrors.Wrap(err, "address from bech32") + return nil, errorsmod.Wrap(err, "address from bech32") } err = sdk.VerifyAddressFormat(parsed) if err != nil { - return nil, sdkerrors.Wrap(err, "verify address format") + return nil, errorsmod.Wrap(err, "verify address format") } return parsed, nil } diff --git a/wormchain/x/tokenfactory/bindings/queries.go b/wormchain/x/tokenfactory/bindings/queries.go index 084dfbae75..6092664e5b 100644 --- a/wormchain/x/tokenfactory/bindings/queries.go +++ b/wormchain/x/tokenfactory/bindings/queries.go @@ -11,12 +11,12 @@ import ( ) type QueryPlugin struct { - bankKeeper *bankkeeper.BaseKeeper + bankKeeper bankkeeper.Keeper tokenFactoryKeeper *tokenfactorykeeper.Keeper } // NewQueryPlugin returns a reference to a new QueryPlugin. -func NewQueryPlugin(b *bankkeeper.BaseKeeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin { +func NewQueryPlugin(b bankkeeper.Keeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin { return &QueryPlugin{ bankKeeper: b, tokenFactoryKeeper: tfk, diff --git a/wormchain/x/tokenfactory/bindings/query_plugin.go b/wormchain/x/tokenfactory/bindings/query_plugin.go index e7b7cd19ec..37e7aef2a4 100644 --- a/wormchain/x/tokenfactory/bindings/query_plugin.go +++ b/wormchain/x/tokenfactory/bindings/query_plugin.go @@ -2,11 +2,14 @@ package bindings import ( "encoding/json" + "errors" "fmt" wasmvmtypes "github.com/CosmWasm/wasmvm/types" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bindingstypes "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings/types" ) @@ -16,10 +19,10 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { var contractQuery bindingstypes.TokenFactoryQuery if err := json.Unmarshal(request, &contractQuery); err != nil { - return nil, sdkerrors.Wrap(err, "osmosis query") + return nil, errorsmod.Wrap(err, "osmosis query") } if contractQuery.Token == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") + return nil, errors.New("token factory query; token is nil") } tokenQuery := contractQuery.Token @@ -30,7 +33,7 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag fullDenom, err := GetFullDenom(creator, subdenom) if err != nil { - return nil, sdkerrors.Wrap(err, "osmo full denom query") + return nil, errorsmod.Wrap(err, "osmo full denom query") } res := bindingstypes.FullDenomResponse{ @@ -39,7 +42,7 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "failed to marshal FullDenomResponse") + return nil, errorsmod.Wrap(err, "failed to marshal FullDenomResponse") } return bz, nil diff --git a/wormchain/x/tokenfactory/bindings/types/msg.go b/wormchain/x/tokenfactory/bindings/types/msg.go index 4e27354725..538d426512 100644 --- a/wormchain/x/tokenfactory/bindings/types/msg.go +++ b/wormchain/x/tokenfactory/bindings/types/msg.go @@ -1,6 +1,6 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import "cosmossdk.io/math" type TokenFactoryMsg struct { Token *TokenMsg `json:"token,omitempty"` @@ -44,15 +44,15 @@ type ChangeAdmin struct { } type MintTokens struct { - Denom string `json:"denom"` - Amount sdk.Int `json:"amount"` - MintToAddress string `json:"mint_to_address"` + Denom string `json:"denom"` + Amount math.Int `json:"amount"` + MintToAddress string `json:"mint_to_address"` } type BurnTokens struct { - Denom string `json:"denom"` - Amount sdk.Int `json:"amount"` - BurnFromAddress string `json:"burn_from_address"` + Denom string `json:"denom"` + Amount math.Int `json:"amount"` + BurnFromAddress string `json:"burn_from_address"` } type SetMetadata struct { @@ -61,8 +61,8 @@ type SetMetadata struct { } type ForceTransfer struct { - Denom string `json:"denom"` - Amount sdk.Int `json:"amount"` - FromAddress string `json:"from_address"` - ToAddress string `json:"to_address"` + Denom string `json:"denom"` + Amount math.Int `json:"amount"` + FromAddress string `json:"from_address"` + ToAddress string `json:"to_address"` } diff --git a/wormchain/x/tokenfactory/bindings/validate_msg_test.go b/wormchain/x/tokenfactory/bindings/validate_msg_test.go index df30646448..d3fce7f501 100644 --- a/wormchain/x/tokenfactory/bindings/validate_msg_test.go +++ b/wormchain/x/tokenfactory/bindings/validate_msg_test.go @@ -4,24 +4,21 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" wasmbinding "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings" bindings "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings/types" - - //"github.com/wormhole-foundation/wormchain/x/tokenfactory/types" - - "github.com/stretchr/testify/require" ) func TestCreateDenom(t *testing.T) { actor := RandomAccountAddress() - tokenz, ctx := SetupCustomApp(t, actor) + wormchain, ctx := SetupCustomApp(t, actor) // Fund actor with 100 base denom creation fees - //actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, tokenz, actor, actorAmount) + // actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, actor, actorAmount) specs := map[string]struct { createDenom *bindings.CreateDenom @@ -42,7 +39,7 @@ func TestCreateDenom(t *testing.T) { createDenom: &bindings.CreateDenom{ Subdenom: "sub-denom_2", }, - expErr: true, + expErr: false, }, "null create denom": { createDenom: nil, @@ -52,15 +49,10 @@ func TestCreateDenom(t *testing.T) { for name, spec := range specs { t.Run(name, func(t *testing.T) { // when - - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - _, gotErr := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, actor, spec.createDenom) + _, gotErr := wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, actor, spec.createDenom) // then if spec.expErr { + t.Logf("validate_msg_test got error: %v", gotErr) require.Error(t, gotErr) return } @@ -150,23 +142,18 @@ func TestChangeAdmin(t *testing.T) { for name, spec := range specs { t.Run(name, func(t *testing.T) { // Setup - tokenz, ctx := SetupCustomApp(t, tokenCreator) + wormchain, ctx := SetupCustomApp(t, tokenCreator) // Fund actor with 100 base denom creation fees - //actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, tokenz, tokenCreator, actorAmount) + // actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, tokenCreator, actorAmount) - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, tokenCreator, &bindings.CreateDenom{ + _, err := wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, tokenCreator, &bindings.CreateDenom{ Subdenom: validDenom, }) require.NoError(t, err) - err = wasmbinding.ChangeAdmin(&tokenz.TokenFactoryKeeper, ctx, spec.actor, spec.changeAdmin) + err = wasmbinding.ChangeAdmin(&wormchain.TokenFactoryKeeper, ctx, spec.actor, spec.changeAdmin) if len(spec.expErrMsg) > 0 { require.Error(t, err) actualErrMsg := err.Error() @@ -180,29 +167,23 @@ func TestChangeAdmin(t *testing.T) { func TestMint(t *testing.T) { creator := RandomAccountAddress() - tokenz, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) // Fund actor with 100 base denom creation fees - //tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, tokenz, creator, tokenCreationFeeAmt) + // tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + // fundAccount(t, ctx, wormchain, creator, tokenCreationFeeAmt) // Create denoms for valid mint tests validDenom := bindings.CreateDenom{ Subdenom: "MOON", } - - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, &validDenom) + _, err := wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, &validDenom) require.NoError(t, err) emptyDenom := bindings.CreateDenom{ Subdenom: "", } - _, err = wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, &emptyDenom) + _, err = wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, &emptyDenom) require.NoError(t, err) validDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), validDenom.Subdenom) @@ -211,7 +192,7 @@ func TestMint(t *testing.T) { lucky := RandomAccountAddress() // lucky was broke - balances := tokenz.BankKeeper.GetAllBalances(ctx, lucky) + balances := wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Empty(t, balances) amount, ok := sdk.NewIntFromString("8080") @@ -292,13 +273,7 @@ func TestMint(t *testing.T) { for name, spec := range specs { t.Run(name, func(t *testing.T) { // when - - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - gotErr := wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, spec.mint) + gotErr := wasmbinding.PerformMint(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, spec.mint) // then if spec.expErr { require.Error(t, gotErr) @@ -309,38 +284,32 @@ func TestMint(t *testing.T) { } } -// Capability not enabled as all test use the burn from capability +// Capability disabled /*func TestBurn(t *testing.T) { creator := RandomAccountAddress() - tokenz, ctx := SetupCustomApp(t, creator) + wormchain, ctx := SetupCustomApp(t, creator) // Fund actor with 100 base denom creation fees - //tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) - //fundAccount(t, ctx, tokenz, creator, tokenCreationFeeAmt) + tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100))) + fundAccount(t, ctx, wormchain, creator, tokenCreationFeeAmt) // Create denoms for valid burn tests validDenom := bindings.CreateDenom{ Subdenom: "MOON", } - - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, &validDenom) + _, err := wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, &validDenom) require.NoError(t, err) emptyDenom := bindings.CreateDenom{ Subdenom: "", } - _, err = wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, &emptyDenom) + _, err = wasmbinding.PerformCreateDenom(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, &emptyDenom) require.NoError(t, err) lucky := RandomAccountAddress() // lucky was broke - balances := tokenz.BankKeeper.GetAllBalances(ctx, lucky) + balances := wormchain.BankKeeper.GetAllBalances(ctx, lucky) require.Empty(t, balances) validDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), validDenom.Subdenom) @@ -422,13 +391,7 @@ func TestMint(t *testing.T) { Amount: mintAmount, MintToAddress: creator.String(), } - - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := tokenz.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - err := wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, mintBinding) + err := wasmbinding.PerformMint(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, mintBinding) require.NoError(t, err) emptyDenomMintBinding := &bindings.MintTokens{ @@ -436,11 +399,11 @@ func TestMint(t *testing.T) { Amount: mintAmount, MintToAddress: creator.String(), } - err = wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &bankBaseKeeper, ctx, creator, emptyDenomMintBinding) + err = wasmbinding.PerformMint(&wormchain.TokenFactoryKeeper, wormchain.BankKeeper, ctx, creator, emptyDenomMintBinding) require.NoError(t, err) // when - gotErr := wasmbinding.PerformBurn(&tokenz.TokenFactoryKeeper, ctx, creator, spec.burn) + gotErr := wasmbinding.PerformBurn(&wormchain.TokenFactoryKeeper, ctx, creator, spec.burn) // then if spec.expErr { require.Error(t, gotErr) diff --git a/wormchain/x/tokenfactory/bindings/validate_queries_test.go b/wormchain/x/tokenfactory/bindings/validate_queries_test.go index 1879d4e636..c6226ed7cf 100644 --- a/wormchain/x/tokenfactory/bindings/validate_queries_test.go +++ b/wormchain/x/tokenfactory/bindings/validate_queries_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" wasmbinding "github.com/wormhole-foundation/wormchain/x/tokenfactory/bindings" ) @@ -42,10 +41,10 @@ func TestFullDenom(t *testing.T) { subdenom: "", expFullDenom: fmt.Sprintf("factory/%s/", actor.String()), }, - "invalid sub-denom (contains underscore)": { - addr: actor.String(), - subdenom: "sub_denom", - expErr: true, + "valid sub-denom (contains underscore)": { + addr: actor.String(), + subdenom: "sub_denom", + expFullDenom: fmt.Sprintf("factory/%s/sub_denom", actor.String()), }, } for name, spec := range specs { @@ -65,25 +64,22 @@ func TestFullDenom(t *testing.T) { func TestDenomAdmin(t *testing.T) { addr := RandomAccountAddress() - app, ctx := SetupCustomApp(t, addr) + wormchain, ctx := SetupCustomApp(t, addr) // set token creation fee to zero to make testing easier - tfParams := app.TokenFactoryKeeper.GetParams(ctx) + tfParams := wormchain.TokenFactoryKeeper.GetParams(ctx) tfParams.DenomCreationFee = sdk.NewCoins() - app.TokenFactoryKeeper.SetParams(ctx, tfParams) + if err := wormchain.TokenFactoryKeeper.SetParams(ctx, tfParams); err != nil { + t.Fatal(err) + } // create a subdenom via the token factory admin := sdk.AccAddress([]byte("addr1_______________")) - tfDenom, err := app.TokenFactoryKeeper.CreateDenom(ctx, admin.String(), "subdenom") + tfDenom, err := wormchain.TokenFactoryKeeper.CreateDenom(ctx, admin.String(), "subdenom") require.NoError(t, err) require.NotEmpty(t, tfDenom) - var bankBaseKeeper bankkeeper.BaseKeeper - bankBaseKeeper, ok := app.BankKeeper.(bankkeeper.BaseKeeper) - if !ok { - panic("Cannot cast bank keeper to bank basekeeper") - } - queryPlugin := wasmbinding.NewQueryPlugin(&bankBaseKeeper, &app.TokenFactoryKeeper) + queryPlugin := wasmbinding.NewQueryPlugin(wormchain.BankKeeper, &wormchain.TokenFactoryKeeper) testCases := []struct { name string diff --git a/wormchain/x/tokenfactory/bindings/wasm.go b/wormchain/x/tokenfactory/bindings/wasm.go index 54c8412cfc..dd823f8078 100644 --- a/wormchain/x/tokenfactory/bindings/wasm.go +++ b/wormchain/x/tokenfactory/bindings/wasm.go @@ -1,30 +1,28 @@ package bindings import ( - "github.com/CosmWasm/wasmd/x/wasm" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + tokenfactorykeeper "github.com/wormhole-foundation/wormchain/x/tokenfactory/keeper" ) func RegisterCustomPlugins( - bank *bankkeeper.BaseKeeper, + bank bankkeeper.Keeper, tokenFactory *tokenfactorykeeper.Keeper, ) []wasmkeeper.Option { - // Disabling tokenfactory custom querier because wormchain custom querier exists - //wasmQueryPlugin := NewQueryPlugin(bank, tokenFactory) + // wasmQueryPlugin := NewQueryPlugin(bank, tokenFactory) - //queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ - // Custom: CustomQuerier(wasmQueryPlugin), - //}) + // queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ + // Custom: CustomQuerier(wasmQueryPlugin), + // }) messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( CustomMessageDecorator(bank, tokenFactory), ) - return []wasm.Option{ - // queryPluginOpt, + return []wasmkeeper.Option{ + // queryPluginOpt, messengerDecoratorOpt, } } diff --git a/wormchain/x/tokenfactory/client/cli/query.go b/wormchain/x/tokenfactory/client/cli/query.go index 336dbd4115..2c72e78c30 100644 --- a/wormchain/x/tokenfactory/client/cli/query.go +++ b/wormchain/x/tokenfactory/client/cli/query.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -36,7 +37,7 @@ func GetParams() *cobra.Command { Use: "params [flags]", Short: "Get the params for the x/tokenfactory module", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/wormchain/x/tokenfactory/client/cli/tx.go b/wormchain/x/tokenfactory/client/cli/tx.go index df996eebed..11ed38ecc9 100644 --- a/wormchain/x/tokenfactory/client/cli/tx.go +++ b/wormchain/x/tokenfactory/client/cli/tx.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -29,7 +29,10 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( NewCreateDenomCmd(), NewMintCmd(), + NewMintToCmd(), NewBurnCmd(), + NewBurnFromCmd(), + NewForceTransferCmd(), NewChangeAdminCmd(), NewModifyDenomMetadataCmd(), ) @@ -49,7 +52,12 @@ func NewCreateDenomCmd() *cobra.Command { return err } - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) msg := types.NewMsgCreateDenom( clientCtx.GetFromAddress().String(), @@ -76,7 +84,12 @@ func NewMintCmd() *cobra.Command { return err } - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) amount, err := sdk.ParseCoinNormalized(args[0]) if err != nil { @@ -96,6 +109,48 @@ func NewMintCmd() *cobra.Command { return cmd } +// NewMintToCmd broadcast MsgMintTo +func NewMintToCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "mint-to [address] [amount] [flags]", + Short: "Mint a denom to an address. Must have admin authority to do so.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + toAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgMintTo( + clientCtx.GetFromAddress().String(), + amount, + toAddr.String(), + ) + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + // NewBurnCmd broadcast MsgBurn func NewBurnCmd() *cobra.Command { cmd := &cobra.Command{ @@ -108,7 +163,11 @@ func NewBurnCmd() *cobra.Command { return err } - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) amount, err := sdk.ParseCoinNormalized(args[0]) if err != nil { @@ -128,6 +187,86 @@ func NewBurnCmd() *cobra.Command { return cmd } +// NewBurnFromCmd broadcast MsgBurnFrom +func NewBurnFromCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn-from [address] [amount] [flags]", + Short: "Burn tokens from an address. Must have admin authority to do so.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + fromAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgBurnFrom( + clientCtx.GetFromAddress().String(), + amount, + fromAddr.String(), + ) + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// NewForceTransferCmd broadcast MsgForceTransfer +func NewForceTransferCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "force-transfer [amount] [transfer-from-address] [transfer-to-address] [flags]", + Short: "Force transfer tokens from one address to another address. Must have admin authority to do so.", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + amount, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + msg := types.NewMsgForceTransfer( + clientCtx.GetFromAddress().String(), + amount, + args[1], + args[2], + ) + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + // NewChangeAdminCmd broadcast MsgChangeAdmin func NewChangeAdminCmd() *cobra.Command { cmd := &cobra.Command{ @@ -140,7 +279,11 @@ func NewChangeAdminCmd() *cobra.Command { return err } - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) msg := types.NewMsgChangeAdmin( clientCtx.GetFromAddress().String(), @@ -168,7 +311,11 @@ func NewModifyDenomMetadataCmd() *cobra.Command { return err } - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) fullDenom, ticker, desc := args[0], strings.ToUpper(args[1]), args[2] @@ -188,7 +335,7 @@ func NewModifyDenomMetadataCmd() *cobra.Command { bankMetadata := banktypes.Metadata{ Description: desc, - Display: fullDenom, + Display: ticker, Symbol: ticker, Name: fullDenom, DenomUnits: []*banktypes.DenomUnit{ diff --git a/wormchain/x/tokenfactory/exported/exported.go b/wormchain/x/tokenfactory/exported/exported.go new file mode 100644 index 0000000000..000114e619 --- /dev/null +++ b/wormchain/x/tokenfactory/exported/exported.go @@ -0,0 +1,18 @@ +package exported + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + ParamSet = paramtypes.ParamSet + + // Subspace defines an interface that implements the legacy x/params Subspace + // type. + // + // NOTE: This is used solely for migration of x/params managed parameters. + Subspace interface { + GetParamSet(ctx sdk.Context, ps ParamSet) + } +) diff --git a/wormchain/x/tokenfactory/keeper/admins.go b/wormchain/x/tokenfactory/keeper/admins.go index 49b11ae560..9dc6c9d4e9 100644 --- a/wormchain/x/tokenfactory/keeper/admins.go +++ b/wormchain/x/tokenfactory/keeper/admins.go @@ -1,8 +1,9 @@ package keeper import ( + "github.com/cosmos/gogoproto/proto" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gogo/protobuf/proto" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) diff --git a/wormchain/x/tokenfactory/keeper/admins_test.go b/wormchain/x/tokenfactory/keeper/admins_test.go index 3e86aa5987..6f9f11e0db 100644 --- a/wormchain/x/tokenfactory/keeper/admins_test.go +++ b/wormchain/x/tokenfactory/keeper/admins_test.go @@ -4,7 +4,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - //banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -35,14 +34,14 @@ func (suite *KeeperTestSuite) TestAdminMsgs() { suite.Require().NoError(err) suite.Require().True(suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom).Amount.Int64() == addr1bal, suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom)) + // Capaility is disabled // Test force transferring - // Capability is disabled - /*_, err = suite.msgServer.ForceTransfer(sdk.WrapSDKContext(suite.Ctx), types.NewMsgForceTransfer(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5), suite.TestAccs[1].String(), suite.TestAccs[0].String())) - addr1bal -= 5 - addr0bal += 5 - suite.Require().NoError(err) - suite.Require().True(suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64() == addr0bal, suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom)) - suite.Require().True(suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom).Amount.Int64() == addr1bal, suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom))*/ + // _, err = suite.msgServer.ForceTransfer(sdk.WrapSDKContext(suite.Ctx), types.NewMsgForceTransfer(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5), suite.TestAccs[1].String(), suite.TestAccs[0].String())) + // addr1bal -= 5 + // addr0bal += 5 + // suite.Require().NoError(err) + // suite.Require().True(suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64() == addr0bal, suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom)) + // suite.Require().True(suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom).Amount.Int64() == addr1bal, suite.App.BankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom)) // Test burning from own account _, err = suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), types.NewMsgBurn(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5))) @@ -79,7 +78,7 @@ func (suite *KeeperTestSuite) TestAdminMsgs() { } // TestMintDenom ensures the following properties of the MintMessage: -// * Noone can mint tokens for a denom that doesn't exist +// * No one can mint tokens for a denom that doesn't exist // * Only the admin of a denom can mint tokens for it // * The admin of a denom can mint tokens for it func (suite *KeeperTestSuite) TestMintDenom() { @@ -132,6 +131,7 @@ func (suite *KeeperTestSuite) TestMintDenom() { }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { + tc := tc _, err := suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), &tc.mintMsg) if tc.expectPass { suite.Require().NoError(err) @@ -197,17 +197,18 @@ func (suite *KeeperTestSuite) TestBurnDenom() { ), expectPass: true, }, - /*{ - desc: "success case - burn from another address", - burnMsg: *types.NewMsgBurnFrom( - suite.TestAccs[0].String(), - sdk.NewInt64Coin(suite.defaultDenom, 10), - suite.TestAccs[1].String(), - ), - expectPass: true, - },*/ + // { + // desc: "success case - burn from another address", + // burnMsg: *types.NewMsgBurnFrom( + // suite.TestAccs[0].String(), + // sdk.NewInt64Coin(suite.defaultDenom, 10), + // suite.TestAccs[1].String(), + // ), + // expectPass: true, + // }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { + tc := tc _, err := suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), &tc.burnMsg) if tc.expectPass { suite.Require().NoError(err) @@ -283,6 +284,7 @@ func (suite *KeeperTestSuite) TestBurnDenom() { }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { + tc := tc _, err := suite.msgServer.ForceTransfer(sdk.WrapSDKContext(suite.Ctx), &tc.forceTransferMsg) if tc.expectPass { suite.Require().NoError(err) @@ -394,7 +396,7 @@ func (suite *KeeperTestSuite) TestChangeAdminDenom() { } } -// Capability is diabled +// Capability is disabled /*func (suite *KeeperTestSuite) TestSetDenomMetaData() { // setup test suite.SetupTest() @@ -508,6 +510,7 @@ func (suite *KeeperTestSuite) TestChangeAdminDenom() { }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { + tc := tc bankKeeper := suite.App.BankKeeper res, err := suite.msgServer.SetDenomMetadata(sdk.WrapSDKContext(suite.Ctx), &tc.msgSetDenomMetadata) if tc.expectedPass { diff --git a/wormchain/x/tokenfactory/keeper/bankactions.go b/wormchain/x/tokenfactory/keeper/bankactions.go index 303bb16625..0decaf50b5 100644 --- a/wormchain/x/tokenfactory/keeper/bankactions.go +++ b/wormchain/x/tokenfactory/keeper/bankactions.go @@ -1,8 +1,6 @@ package keeper import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" @@ -25,8 +23,8 @@ func (k Keeper) mintTo(ctx sdk.Context, amount sdk.Coin, mintTo string) error { return err } - if k.bankKeeper.BlockedAddr(addr) { - return fmt.Errorf("failed to mint to blocked address: %s", addr) + if k.IsModuleAcc(ctx, addr) { + return types.ErrModuleAccount } return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, @@ -46,8 +44,8 @@ func (k Keeper) burnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom string) erro return err } - if k.bankKeeper.BlockedAddr(addr) { - return fmt.Errorf("failed to burn from blocked address: %s", addr) + if k.IsModuleAcc(ctx, addr) { + return types.ErrModuleAccount } err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, @@ -68,19 +66,28 @@ func (k Keeper) forceTransfer(ctx sdk.Context, amount sdk.Coin, fromAddr string, return err } - fromSdkAddr, err := sdk.AccAddressFromBech32(fromAddr) + fromAcc, err := sdk.AccAddressFromBech32(fromAddr) if err != nil { return err } - toSdkAddr, err := sdk.AccAddressFromBech32(toAddr) + if k.IsModuleAcc(ctx, fromAcc) { + return types.ErrModuleAccount + } + + toAcc, err := sdk.AccAddressFromBech32(toAddr) if err != nil { return err } - if k.bankKeeper.BlockedAddr(toSdkAddr) { - return fmt.Errorf("failed to force transfer to blocked address: %s", toSdkAddr) + if k.IsModuleAcc(ctx, toAcc) { + return types.ErrModuleAccount } - return k.bankKeeper.SendCoins(ctx, fromSdkAddr, toSdkAddr, sdk.NewCoins(amount)) + return k.bankKeeper.SendCoins(ctx, fromAcc, toAcc, sdk.NewCoins(amount)) +} + +// IsModuleAcc checks if a given address is restricted +func (k Keeper) IsModuleAcc(_ sdk.Context, addr sdk.AccAddress) bool { + return k.permAddrMap[addr.String()] } diff --git a/wormchain/x/tokenfactory/keeper/createdenom.go b/wormchain/x/tokenfactory/keeper/createdenom.go index 5455f3422b..171488b347 100644 --- a/wormchain/x/tokenfactory/keeper/createdenom.go +++ b/wormchain/x/tokenfactory/keeper/createdenom.go @@ -32,6 +32,10 @@ func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr string, Exponent: 0, }}, Base: denom, + // The following is necessary for x/bank denom validation + Display: denom, + Name: denom, + Symbol: denom, } k.bankKeeper.SetDenomMetaData(ctx, denomMetaData) diff --git a/wormchain/x/tokenfactory/keeper/createdenom_test.go b/wormchain/x/tokenfactory/keeper/createdenom_test.go index 1a94d8eaea..62df42cbc1 100644 --- a/wormchain/x/tokenfactory/keeper/createdenom_test.go +++ b/wormchain/x/tokenfactory/keeper/createdenom_test.go @@ -4,20 +4,20 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - //"github.com/wormhole-foundation/wormchain/x/tokenfactory/testhelpers" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) func (suite *KeeperTestSuite) TestMsgCreateDenom() { - //var ( - //tokenFactoryKeeper = suite.App.TokenFactoryKeeper - //bankKeeper = suite.App.BankKeeper - //denomCreationFee = tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee - //) + // var ( + // tokenFactoryKeeper = suite.App.TokenFactoryKeeper + // bankKeeper = suite.App.BankKeeper + // denomCreationFee = tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee + // ) // Get balance of acc 0 before creating a denom - //preCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], denomCreationFee[0].Denom) + // preCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], denomCreationFee[0].Denom) // Creating a denom should work res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin")) @@ -31,9 +31,16 @@ func (suite *KeeperTestSuite) TestMsgCreateDenom() { suite.Require().NoError(err) suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin) + // Make sure that the denom is valid from the perspective of x/bank + bankQueryRes, err := suite.bankQueryClient.DenomMetadata(suite.Ctx.Context(), &banktypes.QueryDenomMetadataRequest{ + Denom: res.GetNewTokenDenom(), + }) + suite.Require().NoError(err) + suite.Require().NoError(bankQueryRes.Metadata.Validate()) + // Make sure that creation fee was deducted - //postCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee[0].Denom) - //suite.Require().True(preCreateBalance.Sub(postCreateBalance).IsEqual(denomCreationFee[0])) + // postCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee[0].Denom) + // suite.Require().True(preCreateBalance.Sub(postCreateBalance).IsEqual(denomCreationFee[0])) // Make sure that a second version of the same denom can't be recreated _, err = suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin")) @@ -62,31 +69,31 @@ func (suite *KeeperTestSuite) TestMsgCreateDenom() { } func (suite *KeeperTestSuite) TestCreateDenom() { - var ( - //primaryDenom = types.DefaultParams().DenomCreationFee[0].Denom - //secondaryDenom = testhelpers.SecondaryDenom - //defaultDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)))} - //twoDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)), sdk.NewCoin(secondaryDenom, sdk.NewInt(50000000)))} - //nilCreationFee = types.Params{DenomCreationFee: nil} - //largeCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(5000000000)))} - ) + // var ( + // primaryDenom = types.DefaultParams().DenomCreationFee[0].Denom + // secondaryDenom = apptesting.SecondaryDenom + // defaultDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)))} + // twoDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)), sdk.NewCoin(secondaryDenom, sdk.NewInt(50000000)))} + // nilCreationFee = types.Params{DenomCreationFee: nil} + // largeCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(5000000000)))} + // ) for _, tc := range []struct { - desc string - //denomCreationFee types.Params - setup func() - subdenom string - valid bool + desc string + denomCreationFee types.Params + setup func() + subdenom string + valid bool }{ { desc: "subdenom too long", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, subdenom: "assadsadsadasdasdsadsadsadsadsadsadsklkadaskkkdasdasedskhanhassyeunganassfnlksdflksafjlkasd", valid: false, }, { desc: "subdenom and creator pair already exists", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, setup: func() { _, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin")) suite.Require().NoError(err) @@ -96,31 +103,31 @@ func (suite *KeeperTestSuite) TestCreateDenom() { }, { desc: "success case: defaultDenomCreationFee", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, subdenom: "evmos", valid: true, }, { desc: "success case: twoDenomCreationFee", - //denomCreationFee: twoDenomCreationFee, + // denomCreationFee: twoDenomCreationFee, subdenom: "catcoin", valid: true, }, { desc: "success case: nilCreationFee", - //denomCreationFee: nilCreationFee, + // denomCreationFee: nilCreationFee, subdenom: "czcoin", valid: true, }, - //{ - // desc: "account doesn't have enough to pay for denom creation fee", - //denomCreationFee: largeCreationFee, - // subdenom: "tooexpensive", - // valid: false, - //}, + // { + // desc: "account doesn't have enough to pay for denom creation fee", + // denomCreationFee: largeCreationFee, + // subdenom: "tooexpensive", + // valid: false, + // }, { desc: "subdenom having invalid characters", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, subdenom: "bit/***///&&&/coin", valid: false, }, @@ -130,20 +137,26 @@ func (suite *KeeperTestSuite) TestCreateDenom() { if tc.setup != nil { tc.setup() } - //tokenFactoryKeeper := suite.App.TokenFactoryKeeper + tokenFactoryKeeper := suite.App.TokenFactoryKeeper bankKeeper := suite.App.BankKeeper // Set denom creation fee in params - //tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee) - //denomCreationFee := tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee - //suite.Require().Equal(tc.denomCreationFee.DenomCreationFee, denomCreationFee) + if err := tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee); err != nil { + suite.Require().NoError(err) + } + denomCreationFee := tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee + suite.Require().Equal(tc.denomCreationFee.DenomCreationFee, denomCreationFee) // note balance, create a tokenfactory denom, then note balance again - preCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0]) + // preCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0]) + preCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], "stake") res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), tc.subdenom)) - postCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0]) + // postCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0]) + postCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], "stake") if tc.valid { suite.Require().NoError(err) - //suite.Require().True(preCreateBalance.Sub(postCreateBalance).IsEqual(denomCreationFee)) + if denomCreationFee != nil { + suite.Require().True(preCreateBalance.Sub(postCreateBalance).IsEqual(denomCreationFee[0])) + } // Make sure that the admin is set correctly queryRes, err := suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{ diff --git a/wormchain/x/tokenfactory/keeper/genesis.go b/wormchain/x/tokenfactory/keeper/genesis.go index 325cf207aa..cd06859999 100644 --- a/wormchain/x/tokenfactory/keeper/genesis.go +++ b/wormchain/x/tokenfactory/keeper/genesis.go @@ -14,7 +14,9 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { if genState.Params.DenomCreationFee == nil { genState.Params.DenomCreationFee = sdk.NewCoins() } - k.SetParams(ctx, genState.Params) + if err := k.SetParams(ctx, genState.Params); err != nil { + panic(err) + } for _, genDenom := range genState.GetFactoryDenoms() { creator, _, err := types.DeconstructDenom(genDenom.GetDenom()) diff --git a/wormchain/x/tokenfactory/keeper/genesis_test.go b/wormchain/x/tokenfactory/keeper/genesis_test.go index be73bfe997..7729865fa9 100644 --- a/wormchain/x/tokenfactory/keeper/genesis_test.go +++ b/wormchain/x/tokenfactory/keeper/genesis_test.go @@ -11,49 +11,47 @@ func (suite *KeeperTestSuite) TestGenesis() { genesisState := types.GenesisState{ FactoryDenoms: []types.GenesisDenom{ { - Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin", + Denom: "factory/wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg/bitcoin", AuthorityMetadata: types.DenomAuthorityMetadata{ - Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8", + Admin: "wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg", }, }, { - Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/diff-admin", + Denom: "factory/wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg/diff-admin", AuthorityMetadata: types.DenomAuthorityMetadata{ - Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8", + Admin: "wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg", }, }, { - Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/litecoin", + Denom: "factory/wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg/litecoin", AuthorityMetadata: types.DenomAuthorityMetadata{ - Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8", + Admin: "wormhole13p05zcjlfsxsjua77es6g9kxg8kr243nrhf7jg", }, }, }, } suite.SetupTestForInitGenesis() - app := suite.App + wormchain := suite.App // Test both with bank denom metadata set, and not set. for i, denom := range genesisState.FactoryDenoms { // hacky, sets bank metadata to exist if i != 0, to cover both cases. if i != 0 { - app.BankKeeper.SetDenomMetaData(suite.Ctx, banktypes.Metadata{Base: denom.GetDenom()}) + wormchain.BankKeeper.SetDenomMetaData(suite.Ctx, banktypes.Metadata{Base: denom.GetDenom()}) } } - // check before initGenesis that the module account is nil - //tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) - //suite.Require().Nil(tokenfactoryModuleAccount) - - app.TokenFactoryKeeper.SetParams(suite.Ctx, types.Params{DenomCreationFee: sdk.Coins{sdk.NewInt64Coin("uosmo", 100)}}) - app.TokenFactoryKeeper.InitGenesis(suite.Ctx, genesisState) + if err := wormchain.TokenFactoryKeeper.SetParams(suite.Ctx, types.Params{DenomCreationFee: sdk.Coins{sdk.NewInt64Coin("stake", 100)}}); err != nil { + panic(err) + } + wormchain.TokenFactoryKeeper.InitGenesis(suite.Ctx, genesisState) // check that the module account is now initialized - tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + tokenfactoryModuleAccount := wormchain.AccountKeeper.GetAccount(suite.Ctx, wormchain.AccountKeeper.GetModuleAddress(types.ModuleName)) suite.Require().NotNil(tokenfactoryModuleAccount) - exportedGenesis := app.TokenFactoryKeeper.ExportGenesis(suite.Ctx) + exportedGenesis := wormchain.TokenFactoryKeeper.ExportGenesis(suite.Ctx) suite.Require().NotNil(exportedGenesis) suite.Require().Equal(genesisState, *exportedGenesis) } diff --git a/wormchain/x/tokenfactory/keeper/keeper.go b/wormchain/x/tokenfactory/keeper/keeper.go index 0c1645a123..3f3369ac83 100644 --- a/wormchain/x/tokenfactory/keeper/keeper.go +++ b/wormchain/x/tokenfactory/keeper/keeper.go @@ -3,57 +3,76 @@ package keeper import ( "fmt" - "github.com/tendermint/tendermint/libs/log" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) type ( Keeper struct { - storeKey storetypes.StoreKey - - paramSpace paramtypes.Subspace + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + permAddrs map[string]authtypes.PermissionsForAddress + permAddrMap map[string]bool accountKeeper types.AccountKeeper bankKeeper types.BankKeeper communityPoolKeeper types.CommunityPoolKeeper enabledCapabilities []string + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string } ) // NewKeeper returns a new instance of the x/tokenfactory keeper func NewKeeper( + cdc codec.BinaryCodec, storeKey storetypes.StoreKey, - paramSpace paramtypes.Subspace, + maccPerms map[string][]string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, communityPoolKeeper types.CommunityPoolKeeper, enabledCapabilities []string, + authority string, ) Keeper { - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + permAddrs := make(map[string]authtypes.PermissionsForAddress) + permAddrMap := make(map[string]bool) + for name, perms := range maccPerms { + permsForAddr := authtypes.NewPermissionsForAddress(name, perms) + permAddrs[name] = permsForAddr + permAddrMap[permsForAddr.GetAddress().String()] = true } return Keeper{ - storeKey: storeKey, - paramSpace: paramSpace, + cdc: cdc, + storeKey: storeKey, + permAddrs: permAddrs, + permAddrMap: permAddrMap, accountKeeper: accountKeeper, bankKeeper: bankKeeper, communityPoolKeeper: communityPoolKeeper, enabledCapabilities: enabledCapabilities, + + authority: authority, } } +// GetAuthority returns the x/mint module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + // Logger returns a logger for the x/tokenfactory module func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) diff --git a/wormchain/x/tokenfactory/keeper/keeper_test.go b/wormchain/x/tokenfactory/keeper/keeper_test.go index 8172105ac9..faa895af2e 100644 --- a/wormchain/x/tokenfactory/keeper/keeper_test.go +++ b/wormchain/x/tokenfactory/keeper/keeper_test.go @@ -3,21 +3,24 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/wormhole-foundation/wormchain/app/apptesting" "github.com/wormhole-foundation/wormchain/x/tokenfactory/keeper" - "github.com/wormhole-foundation/wormchain/x/tokenfactory/testhelpers" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) type KeeperTestSuite struct { apptesting.KeeperTestHelper - queryClient types.QueryClient - msgServer types.MsgServer + queryClient types.QueryClient + bankQueryClient banktypes.QueryClient + msgServer types.MsgServer // defaultDenom is on the suite, as it depends on the creator test address. defaultDenom string } @@ -28,15 +31,18 @@ func TestKeeperTestSuite(t *testing.T) { func (suite *KeeperTestSuite) SetupTest() { suite.Setup() - // There is no denom creation fee - fundAccsAmount := sdk.NewCoins(sdk.NewCoin(testhelpers.SecondaryDenom, testhelpers.SecondaryAmount)) - // Fund every TestAcc with two denoms, one of which is the denom creation fee - //fundAccsAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)), sdk.NewCoin(testhelpers.SecondaryDenom, testhelpers.SecondaryAmount)) + + // DenomCreationFee is nil, only the secondary denom is funded + // OUTDATED: Fund every TestAcc with two denoms, one of which is the denom creation fee + // OUTDATED: fundAccsAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)), sdk.NewCoin(apptesting.SecondaryDenom, apptesting.SecondaryAmount)) + + fundAccsAmount := sdk.NewCoins(sdk.NewCoin(apptesting.SecondaryDenom, apptesting.SecondaryAmount)) for _, acc := range suite.TestAccs { suite.FundAcc(acc, fundAccsAmount) } suite.queryClient = types.NewQueryClient(suite.QueryHelper) + suite.bankQueryClient = banktypes.NewQueryClient(suite.QueryHelper) suite.msgServer = keeper.NewMsgServerImpl(suite.App.TokenFactoryKeeper) } @@ -46,21 +52,21 @@ func (suite *KeeperTestSuite) CreateDefaultDenom() { } func (suite *KeeperTestSuite) TestCreateModuleAccount() { - app := suite.App + wormchain := suite.App // remove module account - tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) - app.AccountKeeper.RemoveAccount(suite.Ctx, tokenfactoryModuleAccount) + tokenfactoryModuleAccount := wormchain.AccountKeeper.GetAccount(suite.Ctx, wormchain.AccountKeeper.GetModuleAddress(types.ModuleName)) + wormchain.AccountKeeper.RemoveAccount(suite.Ctx, tokenfactoryModuleAccount) // ensure module account was removed - suite.Ctx = app.BaseApp.NewContext(false, tmproto.Header{}) - tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + suite.Ctx = wormchain.BaseApp.NewContext(false, tmproto.Header{ChainID: "testing"}) + tokenfactoryModuleAccount = wormchain.AccountKeeper.GetAccount(suite.Ctx, wormchain.AccountKeeper.GetModuleAddress(types.ModuleName)) suite.Require().Nil(tokenfactoryModuleAccount) // create module account - app.TokenFactoryKeeper.CreateModuleAccount(suite.Ctx) + wormchain.TokenFactoryKeeper.CreateModuleAccount(suite.Ctx) // check that the module account is now initialized - tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName)) + tokenfactoryModuleAccount = wormchain.AccountKeeper.GetAccount(suite.Ctx, wormchain.AccountKeeper.GetModuleAddress(types.ModuleName)) suite.Require().NotNil(tokenfactoryModuleAccount) } diff --git a/wormchain/x/tokenfactory/keeper/migrator.go b/wormchain/x/tokenfactory/keeper/migrator.go new file mode 100644 index 0000000000..b16df0cde8 --- /dev/null +++ b/wormchain/x/tokenfactory/keeper/migrator.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory/exported" + v2 "github.com/wormhole-foundation/wormchain/x/tokenfactory/migrations/v2" +) + +// Migrator is a struct for handling in-place state migrations. +type Migrator struct { + keeper Keeper + legacySubspace exported.Subspace +} + +func NewMigrator(k Keeper, ss exported.Subspace) Migrator { + return Migrator{ + keeper: k, + legacySubspace: ss, + } +} + +// Migrate1to2 migrates the x/tokenfactory module state from the consensus version 1 to +// version 2. Specifically, it takes the parameters that are currently stored +// and managed by the x/params modules and stores them directly into the x/tokenfactory +// module state. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + // Fixes hard forking genesis being invalid. + // https://github.com/sei-protocol/sei-chain/pull/861 + iter := m.keeper.GetAllDenomsIterator(ctx) + defer iter.Close() + for ; iter.Valid(); iter.Next() { + denom := string(iter.Value()) + denomMetadata, err := m.keeper.bankKeeper.GetDenomMetaData(ctx, denom) + if err { + panic(fmt.Errorf("denom %s does not exist", denom)) + } + + fmt.Printf("Migrating denom: %s\n", denom) + m.SetMetadata(&denomMetadata) + m.keeper.bankKeeper.SetDenomMetaData(ctx, denomMetadata) + + } + + return v2.Migrate(ctx, ctx.KVStore(m.keeper.storeKey), m.legacySubspace, m.keeper.cdc) +} + +func (m Migrator) SetMetadata(denomMetadata *banktypes.Metadata) { + if len(denomMetadata.Base) == 0 { + panic(fmt.Errorf("no base exists for denom %v", denomMetadata)) + } + if len(denomMetadata.Display) == 0 { + denomMetadata.Display = denomMetadata.Base + denomMetadata.Name = denomMetadata.Base + denomMetadata.Symbol = denomMetadata.Base + } else { + fmt.Printf("Denom %s already has denom set", denomMetadata.Base) + } +} diff --git a/wormchain/x/tokenfactory/keeper/msg_server.go b/wormchain/x/tokenfactory/keeper/msg_server.go index 0b305dfa8c..b0a179f2f1 100644 --- a/wormchain/x/tokenfactory/keeper/msg_server.go +++ b/wormchain/x/tokenfactory/keeper/msg_server.go @@ -3,7 +3,10 @@ package keeper import ( "context" + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -21,6 +24,10 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { var _ types.MsgServer = msgServer{} func (server msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateDenom) (*types.MsgCreateDenomResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) denom, err := server.Keeper.CreateDenom(ctx, msg.Sender, msg.Subdenom) @@ -207,3 +214,16 @@ func (server msgServer) SetDenomMetadata(goCtx context.Context, msg *types.MsgSe return &types.MsgSetDenomMetadataResponse{}, nil } + +func (server msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if server.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", server.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := server.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/wormchain/x/tokenfactory/keeper/msg_server_test.go b/wormchain/x/tokenfactory/keeper/msg_server_test.go index 484d60ec68..7f14c7e507 100644 --- a/wormchain/x/tokenfactory/keeper/msg_server_test.go +++ b/wormchain/x/tokenfactory/keeper/msg_server_test.go @@ -3,10 +3,9 @@ package keeper_test import ( "fmt" - "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" - sdk "github.com/cosmos/cosmos-sdk/types" - //banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) // TestMintDenomMsg tests TypeMsgMint message is emitted on a successful mint @@ -91,23 +90,23 @@ func (suite *KeeperTestSuite) TestBurnDenomMsg() { // TestCreateDenomMsg tests TypeMsgCreateDenom message is emitted on a successful denom creation func (suite *KeeperTestSuite) TestCreateDenomMsg() { - //defaultDenomCreationFee := types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(50000000)))} + // defaultDenomCreationFee := types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(50000000)))} for _, tc := range []struct { - desc string - //denomCreationFee types.Params + desc string + denomCreationFee types.Params subdenom string valid bool expectedMessageEvents int }{ { desc: "subdenom too long", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, subdenom: "assadsadsadasdasdsadsadsadsadsadsadsklkadaskkkdasdasedskhanhassyeunganassfnlksdflksafjlkasd", valid: false, }, { desc: "success case: defaultDenomCreationFee", - //denomCreationFee: defaultDenomCreationFee, + // denomCreationFee: defaultDenomCreationFee, subdenom: "evmos", valid: true, expectedMessageEvents: 1, @@ -115,11 +114,13 @@ func (suite *KeeperTestSuite) TestCreateDenomMsg() { } { suite.SetupTest() suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { - //tokenFactoryKeeper := suite.App.TokenFactoryKeeper + tokenFactoryKeeper := suite.App.TokenFactoryKeeper ctx := suite.Ctx.WithEventManager(sdk.NewEventManager()) suite.Require().Equal(0, len(ctx.EventManager().Events())) // Set denom creation fee in params - //tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee) + if err := tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee); err != nil { + suite.Require().NoError(err) + } // Test create denom message suite.msgServer.CreateDenom(sdk.WrapSDKContext(ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), tc.subdenom)) //nolint:errcheck // Ensure current number and type of event is emitted @@ -179,8 +180,8 @@ func (suite *KeeperTestSuite) TestChangeAdminDenomMsg() { } } -// TestSetDenomMetaDataMsg tests TypeMsgSetDenomMetadata message is emitted on a successful denom metadata change // Capability disabled +// TestSetDenomMetaDataMsg tests TypeMsgSetDenomMetadata message is emitted on a successful denom metadata change /*func (suite *KeeperTestSuite) TestSetDenomMetaDataMsg() { // setup test suite.SetupTest() @@ -211,7 +212,7 @@ func (suite *KeeperTestSuite) TestChangeAdminDenomMsg() { Name: "OSMO", Symbol: "OSMO", }), - expectedPass: false, + expectedPass: true, expectedMessageEvents: 1, }, { @@ -237,6 +238,7 @@ func (suite *KeeperTestSuite) TestChangeAdminDenomMsg() { }, } { suite.Run(fmt.Sprintf("Case %s", tc.desc), func() { + tc := tc ctx := suite.Ctx.WithEventManager(sdk.NewEventManager()) suite.Require().Equal(0, len(ctx.EventManager().Events())) // Test set denom metadata message diff --git a/wormchain/x/tokenfactory/keeper/params.go b/wormchain/x/tokenfactory/keeper/params.go index aac56a3b73..6633d92004 100644 --- a/wormchain/x/tokenfactory/keeper/params.go +++ b/wormchain/x/tokenfactory/keeper/params.go @@ -1,18 +1,31 @@ package keeper import ( - "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" - sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) // GetParams returns the total set params. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return params +func (k Keeper) GetParams(ctx sdk.Context) (p types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return p + } + k.cdc.MustUnmarshal(bz, &p) + return p } // SetParams sets the total set of params. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) +func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error { + if err := p.Validate(); err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&p) + store.Set(types.ParamsKey, bz) + + return nil } diff --git a/wormchain/x/tokenfactory/migrations/v2/migrate.go b/wormchain/x/tokenfactory/migrations/v2/migrate.go new file mode 100644 index 0000000000..a51832d6c9 --- /dev/null +++ b/wormchain/x/tokenfactory/migrations/v2/migrate.go @@ -0,0 +1,39 @@ +package v2 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory/exported" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" +) + +const ModuleName = "tokenfactory" + +var ParamsKey = []byte{0x00} + +// Migrate migrates the x/tokenfactory module state from the consensus version 1 to +// version 2. Specifically, it takes the parameters that are currently stored +// and managed by the x/params modules and stores them directly into the x/tokenfactory +// module state. +func Migrate( + _ sdk.Context, + store sdk.KVStore, + _ exported.Subspace, + cdc codec.BinaryCodec, +) error { + // Migrates mainnet params -> the new keeper params storeKey (from x/params) + currParams := types.Params{ + DenomCreationFee: nil, + DenomCreationGasConsume: 2_000_000, + } + + if err := currParams.Validate(); err != nil { + return err + } + + bz := cdc.MustMarshal(&currParams) + store.Set(ParamsKey, bz) + + return nil +} diff --git a/wormchain/x/tokenfactory/migrations/v2/migrate_test.go b/wormchain/x/tokenfactory/migrations/v2/migrate_test.go new file mode 100644 index 0000000000..30de62d2d1 --- /dev/null +++ b/wormchain/x/tokenfactory/migrations/v2/migrate_test.go @@ -0,0 +1,50 @@ +package v2_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/exported" + v2 "github.com/wormhole-foundation/wormchain/x/tokenfactory/migrations/v2" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" +) + +type mockSubspace struct { + ps types.Params +} + +func newMockSubspace(ps types.Params) mockSubspace { + return mockSubspace{ps: ps} +} + +func (ms mockSubspace) GetParamSet(_ sdk.Context, ps exported.ParamSet) { + *ps.(*types.Params) = ms.ps +} + +func TestMigrate(t *testing.T) { + // x/param conversion + encCfg := moduletestutil.MakeTestEncodingConfig(tokenfactory.AppModuleBasic{}) + cdc := encCfg.Codec + + storeKey := sdk.NewKVStoreKey(v2.ModuleName) + tKey := sdk.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) + store := ctx.KVStore(storeKey) + + legacySubspace := newMockSubspace(types.Params{ + DenomCreationFee: nil, + DenomCreationGasConsume: 2_000_000, + }) + require.NoError(t, v2.Migrate(ctx, store, legacySubspace, cdc)) + + var res types.Params + bz := store.Get(v2.ParamsKey) + require.NoError(t, cdc.Unmarshal(bz, &res)) + require.Equal(t, legacySubspace.ps, res) +} diff --git a/wormchain/x/tokenfactory/module.go b/wormchain/x/tokenfactory/module.go index 52adfd1341..5acc5c448d 100644 --- a/wormchain/x/tokenfactory/module.go +++ b/wormchain/x/tokenfactory/module.go @@ -12,23 +12,24 @@ import ( "context" "encoding/json" "fmt" - "math/rand" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - simulation "github.com/wormhole-foundation/wormchain/x/tokenfactory/simulation" "github.com/wormhole-foundation/wormchain/x/tokenfactory/client/cli" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/exported" "github.com/wormhole-foundation/wormchain/x/tokenfactory/keeper" + simulation "github.com/wormhole-foundation/wormchain/x/tokenfactory/simulation" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -37,6 +38,9 @@ var ( _ module.AppModuleBasic = AppModuleBasic{} ) +// ConsensusVersion defines the current x/tokenfactory module consensus version. +const ConsensusVersion = 2 + // ---------------------------------------------------------------------------- // AppModuleBasic // ---------------------------------------------------------------------------- @@ -53,8 +57,9 @@ func (AppModuleBasic) Name() string { return types.ModuleName } +// RegisterLegacyAminoCodec registers the x/tokenfactory module's types for the given codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) + types.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers the module's interface types @@ -107,18 +112,24 @@ type AppModule struct { keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + + legacySubspace exported.Subspace } func NewAppModule( keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + + // legacySubspace is used solely for migration of x/params managed parameters + legacySubspace exported.Subspace, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(), keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + legacySubspace: legacySubspace, } } @@ -127,24 +138,19 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns the x/tokenfactory module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.Route{} -} - // QuerierRoute returns the x/tokenfactory module's query routing key. func (AppModule) QuerierRoute() string { return types.QuerierRoute } -// LegacyQuerierHandler returns the x/tokenfactory module's Querier. -func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + m := keeper.NewMigrator(am.keeper, am.legacySubspace) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/%s from version 1 to 2: %v", types.ModuleName, err)) + } } // RegisterInvariants registers the x/tokenfactory module's invariants. @@ -169,7 +175,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { + return ConsensusVersion +} // BeginBlock executes all ABCI BeginBlock logic respective to the tokenfactory module. func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} @@ -187,7 +195,7 @@ func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.Valid // // GenerateGenesisState creates a randomized GenState of the tokenfactory module. // func (am AppModule) SimulatorGenesisState(simState *module.SimulationState, s *simtypes.SimCtx) { // tfDefaultGen := types.DefaultGenesis() -// tfDefaultGen.Params.DenomCreationFee = sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10000000))) +// tfDefaultGen.Params.DenomCreationFee = sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, sdk.NewInt(10000000))) // tfDefaultGenJson := simState.Cdc.MustMarshalJSON(tfDefaultGen) // simState.GenState[types.ModuleName] = tfDefaultGenJson // } @@ -210,15 +218,10 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // GenerateGenesisState creates a randomized GenState of the bank module. -func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { return nil } -// RandomizedParams creates randomized bank param changes for the simulator. -func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { - return simulation.ParamChanges(r) -} - // RegisterStoreDecoder registers a decoder for supply module's types func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { } diff --git a/wormchain/x/tokenfactory/simulation/genesis.go b/wormchain/x/tokenfactory/simulation/genesis.go index 484aca3a73..f47d485fd2 100644 --- a/wormchain/x/tokenfactory/simulation/genesis.go +++ b/wormchain/x/tokenfactory/simulation/genesis.go @@ -5,14 +5,18 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + + appparams "github.com/wormhole-foundation/wormchain/app/params" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) +// RandDenomCreationFeeParam returns a random DenomCreationFeeParam func RandDenomCreationFeeParam(r *rand.Rand) sdk.Coins { amount := r.Int63n(10_000_000) - return sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(amount))) + return sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, sdk.NewInt(amount))) } +// RandomizedGenState generates a random GenesisState for mint func RandomizedGenState(simstate *module.SimulationState) { tfGenesis := types.DefaultGenesis() diff --git a/wormchain/x/tokenfactory/simulation/operations.go b/wormchain/x/tokenfactory/simulation/operations.go index 0a4b6d7df5..a0c9afea53 100644 --- a/wormchain/x/tokenfactory/simulation/operations.go +++ b/wormchain/x/tokenfactory/simulation/operations.go @@ -4,13 +4,13 @@ import ( "math/rand" "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/wormhole-foundation/wormchain/app/params" + + appparams "github.com/wormhole-foundation/wormchain/app/params" "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) @@ -56,32 +56,32 @@ func WeightedOperations( simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgCreateDenom, &weightMsgCreateDenom, nil, func(_ *rand.Rand) { - weightMsgCreateDenom = params.DefaultWeightMsgCreateDenom + weightMsgCreateDenom = appparams.DefaultWeightMsgCreateDenom }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgMint, &weightMsgMint, nil, func(_ *rand.Rand) { - weightMsgMint = params.DefaultWeightMsgMint + weightMsgMint = appparams.DefaultWeightMsgMint }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgBurn, &weightMsgBurn, nil, func(_ *rand.Rand) { - weightMsgBurn = params.DefaultWeightMsgBurn + weightMsgBurn = appparams.DefaultWeightMsgBurn }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgChangeAdmin, &weightMsgChangeAdmin, nil, func(_ *rand.Rand) { - weightMsgChangeAdmin = params.DefaultWeightMsgChangeAdmin + weightMsgChangeAdmin = appparams.DefaultWeightMsgChangeAdmin }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgSetDenomMetadata, &weightMsgSetDenomMetadata, nil, func(_ *rand.Rand) { - weightMsgSetDenomMetadata = params.DefaultWeightMsgSetDenomMetadata + weightMsgSetDenomMetadata = appparams.DefaultWeightMsgSetDenomMetadata }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgForceTransfer, &weightMsgForceTransfer, nil, func(_ *rand.Rand) { - weightMsgForceTransfer = params.DefaultWeightMsgForceTransfer + weightMsgForceTransfer = appparams.DefaultWeightMsgForceTransfer }, ) @@ -156,7 +156,7 @@ func SimulateMsgSetDenomMetadata( app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, - chainID string, + _ string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // Get create denom account createdDenomAccount, _ := simtypes.RandomAcc(r, accs) @@ -210,7 +210,7 @@ func SimulateMsgChangeAdmin( app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, - chainID string, + _ string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // Get create denom account createdDenomAccount, _ := simtypes.RandomAcc(r, accs) @@ -260,7 +260,7 @@ func SimulateMsgBurn( app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, - chainID string, + _ string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // Get create denom account createdDenomAccount, _ := simtypes.RandomAcc(r, accs) @@ -314,7 +314,7 @@ func SimulateMsgMint( app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, - chainID string, + _ string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // Get create denom account createdDenomAccount, _ := simtypes.RandomAcc(r, accs) @@ -356,7 +356,7 @@ func SimulateMsgCreateDenom(tfKeeper TokenfactoryKeeper, ak types.AccountKeeper, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, - chainID string, + _ string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // Get sims account simAccount, _ := simtypes.RandomAcc(r, accs) @@ -364,7 +364,7 @@ func SimulateMsgCreateDenom(tfKeeper TokenfactoryKeeper, ak types.AccountKeeper, // Check if sims account enough create fee createFee := tfKeeper.GetParams(ctx).DenomCreationFee balances := bk.GetAllBalances(ctx, simAccount.Address) - _, hasNeg := balances.SafeSub(createFee) + _, hasNeg := balances.SafeSub(createFee[0]) if hasNeg { return simtypes.NoOpMsg(types.ModuleName, types.MsgCreateDenom{}.Type(), "Creator not enough creation fee"), nil, nil } @@ -397,7 +397,7 @@ func BuildOperationInput( return simulation.OperationInput{ R: r, App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + TxGen: appparams.MakeEncodingConfig().TxConfig, Cdc: nil, Msg: msg, MsgType: msg.Type(), diff --git a/wormchain/x/tokenfactory/simulation/params.go b/wormchain/x/tokenfactory/simulation/params.go deleted file mode 100644 index b54b060a5e..0000000000 --- a/wormchain/x/tokenfactory/simulation/params.go +++ /dev/null @@ -1,23 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" -) - -func ParamChanges(_ *rand.Rand) []simtypes.ParamChange { - return []simtypes.ParamChange{ - simulation.NewSimParamChange( - types.ModuleName, - string(types.KeyDenomCreationFee), - func(r *rand.Rand) string { - amount := RandDenomCreationFeeParam(r) - return fmt.Sprintf("[{\"denom\":\"%v\",\"amount\":\"%v\"}]", amount[0].Denom, amount[0].Amount) - }, - ), - } -} diff --git a/wormchain/x/tokenfactory/testhelpers/suite.go b/wormchain/x/tokenfactory/testhelpers/authz.go similarity index 95% rename from wormchain/x/tokenfactory/testhelpers/suite.go rename to wormchain/x/tokenfactory/testhelpers/authz.go index 7df45ad15c..dfa78658e0 100644 --- a/wormchain/x/tokenfactory/testhelpers/suite.go +++ b/wormchain/x/tokenfactory/testhelpers/authz.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/x/authz" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" ) var ( @@ -41,7 +41,7 @@ func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) { // Authz: Grant Msg typeURL := sdk.MsgTypeURL(msg) later := someDate.Add(time.Hour) - grant, err := authz.NewGrant(authz.NewGenericAuthorization(typeURL), later) + grant, err := authz.NewGrant(someDate, authz.NewGenericAuthorization(typeURL), &later) require.NoError(t, err) msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant} diff --git a/wormchain/x/tokenfactory/testhelpers/consts.go b/wormchain/x/tokenfactory/testhelpers/consts.go deleted file mode 100644 index d7804a3726..0000000000 --- a/wormchain/x/tokenfactory/testhelpers/consts.go +++ /dev/null @@ -1,8 +0,0 @@ -package testhelpers - -import sdk "github.com/cosmos/cosmos-sdk/types" - -var ( - SecondaryDenom = "uion" - SecondaryAmount = sdk.NewInt(100000000) -) diff --git a/wormchain/x/tokenfactory/types/authorityMetadata.pb.go b/wormchain/x/tokenfactory/types/authorityMetadata.pb.go index c5bc78fe56..8e75a2a3d8 100644 --- a/wormchain/x/tokenfactory/types/authorityMetadata.pb.go +++ b/wormchain/x/tokenfactory/types/authorityMetadata.pb.go @@ -5,9 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -81,23 +80,22 @@ func init() { } var fileDescriptor_99435de88ae175f7 = []byte{ - // 252 bytes of a gzipped FileDescriptorProto + // 233 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xc9, 0x2f, 0xce, 0xcd, 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, 0xa9, 0xf4, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x81, 0xea, 0xd2, 0x43, 0xd6, 0xa5, 0x07, 0xd5, 0x25, 0x25, 0x92, 0x9e, 0x9f, 0x9e, - 0x0f, 0x56, 0xa8, 0x0f, 0x62, 0x41, 0xf4, 0x48, 0xc9, 0x25, 0x83, 0x35, 0xe9, 0x27, 0x25, 0x16, - 0xa7, 0xc2, 0x2d, 0x48, 0xce, 0xcf, 0xcc, 0x83, 0xc8, 0x2b, 0xb9, 0x71, 0x89, 0xb9, 0xa4, 0xe6, - 0xe5, 0xe7, 0x3a, 0xa2, 0xdb, 0x29, 0xa4, 0xc6, 0xc5, 0x9a, 0x98, 0x92, 0x9b, 0x99, 0x27, 0xc1, - 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, 0x8e, 0x95, - 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x53, 0xf8, 0x89, - 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xd9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x97, 0xe7, 0x17, 0xe5, 0x66, 0xe4, 0xe7, 0xa4, 0xea, 0xa6, 0xe5, - 0x97, 0xe6, 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x81, 0xc5, 0x92, 0x33, 0x12, 0x33, 0xf3, 0xf4, - 0x2b, 0x50, 0x83, 0xa3, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x4e, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xca, 0xa6, 0x48, 0xf8, 0x33, 0x01, 0x00, 0x00, + 0x0f, 0x56, 0xa8, 0x0f, 0x62, 0x41, 0xf4, 0x28, 0xb9, 0x71, 0x89, 0xb9, 0xa4, 0xe6, 0xe5, 0xe7, + 0x3a, 0xa2, 0x9b, 0x29, 0xa4, 0xc6, 0xc5, 0x9a, 0x98, 0x92, 0x9b, 0x99, 0x27, 0xc1, 0xa8, 0xc0, + 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x58, + 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x53, 0xf8, 0x89, 0x47, 0x72, + 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, + 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xd9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, + 0xe7, 0xe7, 0xea, 0x97, 0xe7, 0x17, 0xe5, 0x66, 0xe4, 0xe7, 0xa4, 0xea, 0xa6, 0xe5, 0x97, 0xe6, + 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x81, 0xc5, 0x92, 0x33, 0x12, 0x33, 0xf3, 0xf4, 0x2b, 0x50, + 0xbd, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa7, 0x31, 0x20, 0x00, 0x00, 0xff, + 0xff, 0xd7, 0xd2, 0x63, 0x2f, 0x13, 0x01, 0x00, 0x00, } func (this *DenomAuthorityMetadata) Equal(that interface{}) bool { diff --git a/wormchain/x/tokenfactory/types/authzcodec/codec.go b/wormchain/x/tokenfactory/types/authzcodec/codec.go deleted file mode 100644 index 366e337a1c..0000000000 --- a/wormchain/x/tokenfactory/types/authzcodec/codec.go +++ /dev/null @@ -1,24 +0,0 @@ -package authzcodec - -// Note: this file is a copy from authz/codec in 0.46 so we can be compatible with 0.45 - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(Amino) -) - -func init() { - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - sdk.RegisterLegacyAminoCodec(Amino) - cryptocodec.RegisterCrypto(Amino) - codec.RegisterEvidences(Amino) - - Amino.Seal() -} diff --git a/wormchain/x/tokenfactory/types/codec.go b/wormchain/x/tokenfactory/types/codec.go index 8984dd89eb..d7fa63bd40 100644 --- a/wormchain/x/tokenfactory/types/codec.go +++ b/wormchain/x/tokenfactory/types/codec.go @@ -2,47 +2,70 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - - // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" +) + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global erc20 module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding. + // + // The actual codec used for serialization should be provided to modules/erc20 and + // defined at the application level. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino JSON compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) ) -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgCreateDenom{}, "osmosis/tokenfactory/create-denom", nil) - cdc.RegisterConcrete(&MsgMint{}, "osmosis/tokenfactory/mint", nil) - cdc.RegisterConcrete(&MsgBurn{}, "osmosis/tokenfactory/burn", nil) - cdc.RegisterConcrete(&MsgForceTransfer{}, "osmosis/tokenfactory/force-transfer", nil) - cdc.RegisterConcrete(&MsgChangeAdmin{}, "osmosis/tokenfactory/change-admin", nil) +const ( + // Amino names + createTFDenom = "osmosis/tokenfactory/create-denom" + mintTFDenom = "osmosis/tokenfactory/mint" + burnTFDenom = "osmosis/tokenfactory/burn" + forceTransferTFDenom = "osmosis/tokenfactory/force-transfer" + changeAdminTFDenom = "osmosis/tokenfactory/change-admin" + updateTFparams = "osmosis/tokenfactory/msg-update-params" +) + +// NOTE: This is required for the GetSignBytes function +func init() { + RegisterLegacyAminoCodec(amino) + + sdk.RegisterLegacyAminoCodec(amino) + // cryptocodec.RegisterCrypto(amino) + // codec.RegisterEvidences(amino) + + // Register all Amino interfaces and concrete types on the authz Amino codec + // so that this can later be used to properly serialize MsgGrant and MsgExec + // instances. + RegisterLegacyAminoCodec(authzcodec.Amino) + + amino.Seal() } -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgCreateDenom{}, &MsgMint{}, &MsgBurn{}, - // &MsgForceTransfer{}, + &MsgForceTransfer{}, &MsgChangeAdmin{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) - -func init() { - RegisterCodec(amino) - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - // Note: these 3 are inlines from authz/codec in 0.46 so we can be compatible with 0.45 - sdk.RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - codec.RegisterEvidences(amino) - - amino.Seal() +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgCreateDenom{}, createTFDenom, nil) + cdc.RegisterConcrete(&MsgMint{}, mintTFDenom, nil) + cdc.RegisterConcrete(&MsgBurn{}, burnTFDenom, nil) + cdc.RegisterConcrete(&MsgForceTransfer{}, forceTransferTFDenom, nil) + cdc.RegisterConcrete(&MsgChangeAdmin{}, changeAdminTFDenom, nil) + cdc.RegisterConcrete(&MsgUpdateParams{}, updateTFparams, nil) } diff --git a/wormchain/x/tokenfactory/types/codec_test.go b/wormchain/x/tokenfactory/types/codec_test.go new file mode 100644 index 0000000000..7b826372cf --- /dev/null +++ b/wormchain/x/tokenfactory/types/codec_test.go @@ -0,0 +1,36 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type CodecTestSuite struct { + suite.Suite +} + +func TestCodecSuite(t *testing.T) { + suite.Run(t, new(CodecTestSuite)) +} + +func (suite *CodecTestSuite) TestRegisterInterfaces() { + registry := codectypes.NewInterfaceRegistry() + registry.RegisterInterface(sdk.MsgInterfaceProtoName, (*sdk.Msg)(nil)) + RegisterInterfaces(registry) + + impls := registry.ListImplementations(sdk.MsgInterfaceProtoName) + suite.Require().Equal(7, len(impls)) + suite.Require().ElementsMatch([]string{ + "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + "/osmosis.tokenfactory.v1beta1.MsgMint", + "/osmosis.tokenfactory.v1beta1.MsgBurn", + "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", + "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", + "/osmosis.tokenfactory.v1beta1.MsgUpdateParams", + }, impls) +} diff --git a/wormchain/x/tokenfactory/types/denoms.go b/wormchain/x/tokenfactory/types/denoms.go index 7a9f2f9e99..a6fc4e0847 100644 --- a/wormchain/x/tokenfactory/types/denoms.go +++ b/wormchain/x/tokenfactory/types/denoms.go @@ -3,8 +3,9 @@ package types import ( "strings" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -46,17 +47,17 @@ func DeconstructDenom(denom string) (creator string, subdenom string, err error) strParts := strings.Split(denom, "/") if len(strParts) < 3 { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "not enough parts of denom %s", denom) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "not enough parts of denom %s", denom) } if strParts[0] != ModuleDenomPrefix { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "denom prefix is incorrect. Is: %s. Should be: %s", strParts[0], ModuleDenomPrefix) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "denom prefix is incorrect. Is: %s. Should be: %s", strParts[0], ModuleDenomPrefix) } creator = strParts[1] creatorAddr, err := sdk.AccAddressFromBech32(creator) if err != nil { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "Invalid creator address (%s)", err) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "Invalid creator address (%s)", err) } // Handle the case where a denom has a slash in its subdenom. For example, diff --git a/wormchain/x/tokenfactory/types/errors.go b/wormchain/x/tokenfactory/types/errors.go index d5e09de191..c04cc008c2 100644 --- a/wormchain/x/tokenfactory/types/errors.go +++ b/wormchain/x/tokenfactory/types/errors.go @@ -5,19 +5,20 @@ package types import ( fmt "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/tokenfactory module sentinel errors var ( - ErrDenomExists = sdkerrors.Register(ModuleName, 2, "attempting to create a denom that already exists (has bank metadata)") - ErrUnauthorized = sdkerrors.Register(ModuleName, 3, "unauthorized account") - ErrInvalidDenom = sdkerrors.Register(ModuleName, 4, "invalid denom") - ErrInvalidCreator = sdkerrors.Register(ModuleName, 5, "invalid creator") - ErrInvalidAuthorityMetadata = sdkerrors.Register(ModuleName, 6, "invalid authority metadata") - ErrInvalidGenesis = sdkerrors.Register(ModuleName, 7, "invalid genesis") - ErrSubdenomTooLong = sdkerrors.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength)) - ErrCreatorTooLong = sdkerrors.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) - ErrDenomDoesNotExist = sdkerrors.Register(ModuleName, 10, "denom does not exist") - ErrCapabilityNotEnabled = sdkerrors.Register(ModuleName, 11, "this capability is not enabled on chain") + ErrDenomExists = errorsmod.Register(ModuleName, 2, "attempting to create a denom that already exists (has bank metadata)") + ErrUnauthorized = errorsmod.Register(ModuleName, 3, "unauthorized account") + ErrInvalidDenom = errorsmod.Register(ModuleName, 4, "invalid denom") + ErrInvalidCreator = errorsmod.Register(ModuleName, 5, "invalid creator") + ErrInvalidAuthorityMetadata = errorsmod.Register(ModuleName, 6, "invalid authority metadata") + ErrInvalidGenesis = errorsmod.Register(ModuleName, 7, "invalid genesis") + ErrSubdenomTooLong = errorsmod.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength)) + ErrCreatorTooLong = errorsmod.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) + ErrDenomDoesNotExist = errorsmod.Register(ModuleName, 10, "denom does not exist") + ErrCapabilityNotEnabled = errorsmod.Register(ModuleName, 11, "this capability is not enabled on chain") + ErrModuleAccount = errorsmod.Register(ModuleName, 12, "interacting with module accounts not allowed") ) diff --git a/wormchain/x/tokenfactory/types/expected_keepers.go b/wormchain/x/tokenfactory/types/expected_keepers.go index 5500dab76b..07e19ff6b7 100644 --- a/wormchain/x/tokenfactory/types/expected_keepers.go +++ b/wormchain/x/tokenfactory/types/expected_keepers.go @@ -12,6 +12,7 @@ type BankKeeper interface { SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata) HasSupply(ctx sdk.Context, denom string) bool + IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error @@ -30,6 +31,7 @@ type BankKeeper interface { type AccountKeeper interface { SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI } // CommunityPoolKeeper defines the contract needed to be fulfilled for community pool interactions. diff --git a/wormchain/x/tokenfactory/types/genesis.go b/wormchain/x/tokenfactory/types/genesis.go index b1ba181fab..408dc5f9f9 100644 --- a/wormchain/x/tokenfactory/types/genesis.go +++ b/wormchain/x/tokenfactory/types/genesis.go @@ -1,8 +1,9 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // this line is used by starport scaffolding # genesis/types/import @@ -30,7 +31,7 @@ func (gs GenesisState) Validate() error { for _, denom := range gs.GetFactoryDenoms() { if seenDenoms[denom.GetDenom()] { - return sdkerrors.Wrapf(ErrInvalidGenesis, "duplicate denom: %s", denom.GetDenom()) + return errorsmod.Wrapf(ErrInvalidGenesis, "duplicate denom: %s", denom.GetDenom()) } seenDenoms[denom.GetDenom()] = true @@ -42,7 +43,7 @@ func (gs GenesisState) Validate() error { if denom.AuthorityMetadata.Admin != "" { _, err = sdk.AccAddressFromBech32(denom.AuthorityMetadata.Admin) if err != nil { - return sdkerrors.Wrapf(ErrInvalidAuthorityMetadata, "Invalid admin address (%s)", err) + return errorsmod.Wrapf(ErrInvalidAuthorityMetadata, "Invalid admin address (%s)", err) } } } diff --git a/wormchain/x/tokenfactory/types/genesis.pb.go b/wormchain/x/tokenfactory/types/genesis.pb.go index 05d583acfb..fcddc2011b 100644 --- a/wormchain/x/tokenfactory/types/genesis.pb.go +++ b/wormchain/x/tokenfactory/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" diff --git a/wormchain/x/tokenfactory/types/keys.go b/wormchain/x/tokenfactory/types/keys.go index fac4a6e39c..bb52b5dcb7 100644 --- a/wormchain/x/tokenfactory/types/keys.go +++ b/wormchain/x/tokenfactory/types/keys.go @@ -4,6 +4,8 @@ import ( "strings" ) +var ParamsKey = []byte{0x00} + const ( // ModuleName defines the module name ModuleName = "tokenfactory" diff --git a/wormchain/x/tokenfactory/types/msgs.go b/wormchain/x/tokenfactory/types/msgs.go index be5e8a7167..0a1dd5c24a 100644 --- a/wormchain/x/tokenfactory/types/msgs.go +++ b/wormchain/x/tokenfactory/types/msgs.go @@ -1,12 +1,13 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -// constants const ( TypeMsgCreateDenom = "create_denom" TypeMsgMint = "tf_mint" @@ -31,12 +32,12 @@ func (m MsgCreateDenom) Type() string { return TypeMsgCreateDenom } func (m MsgCreateDenom) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = GetTokenDenom(m.Sender, m.Subdenom) if err != nil { - return sdkerrors.Wrap(ErrInvalidDenom, err.Error()) + return errorsmod.Wrap(ErrInvalidDenom, err.Error()) } return nil @@ -74,18 +75,18 @@ func (m MsgMint) Type() string { return TypeMsgMint } func (m MsgMint) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } if m.MintToAddress != "" { _, err = sdk.AccAddressFromBech32(m.MintToAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid mint to address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid mint to address (%s)", err) } } if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } return nil @@ -124,17 +125,17 @@ func (m MsgBurn) Type() string { return TypeMsgBurn } func (m MsgBurn) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } if m.BurnFromAddress != "" { _, err = sdk.AccAddressFromBech32(m.BurnFromAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid burn from address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid burn from address (%s)", err) } } @@ -167,20 +168,20 @@ func (m MsgForceTransfer) Type() string { return TypeMsgForceTransfer } func (m MsgForceTransfer) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = sdk.AccAddressFromBech32(m.TransferFromAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid from address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid from address (%s)", err) } _, err = sdk.AccAddressFromBech32(m.TransferToAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid to address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid to address (%s)", err) } if !m.Amount.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } return nil @@ -211,12 +212,12 @@ func (m MsgChangeAdmin) Type() string { return TypeMsgChangeAdmin } func (m MsgChangeAdmin) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = sdk.AccAddressFromBech32(m.NewAdmin) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) } _, _, err = DeconstructDenom(m.Denom) @@ -251,7 +252,7 @@ func (m MsgSetDenomMetadata) Type() string { return TypeMsgSetDenomMetadata } func (m MsgSetDenomMetadata) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } err = m.Metadata.Validate() @@ -275,3 +276,25 @@ func (m MsgSetDenomMetadata) GetSigners() []sdk.AccAddress { sender, _ := sdk.AccAddressFromBech32(m.Sender) return []sdk.AccAddress{sender} } + +var _ sdk.Msg = &MsgUpdateParams{} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + return m.Params.Validate() +} diff --git a/wormchain/x/tokenfactory/types/msgs_test.go b/wormchain/x/tokenfactory/types/msgs_test.go index 206f16d61d..93c611b3c3 100644 --- a/wormchain/x/tokenfactory/types/msgs_test.go +++ b/wormchain/x/tokenfactory/types/msgs_test.go @@ -4,17 +4,18 @@ import ( fmt "fmt" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/wormhole-foundation/wormchain/x/tokenfactory/testhelpers" - "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" + "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/tendermint/tendermint/crypto/ed25519" + + "github.com/wormhole-foundation/wormchain/x/tokenfactory/testhelpers" + "github.com/wormhole-foundation/wormchain/x/tokenfactory/types" ) -// // Test authz serialize and de-serializes for tokenfactory msg. +// Test authz serialize and de-serializes for tokenfactory msg. func TestAuthzMsg(t *testing.T) { t.Skip("TODO: figure out how to register authz interfaces for tests") pk1 := ed25519.GenPrivKey().PubKey() diff --git a/wormchain/x/tokenfactory/types/params.go b/wormchain/x/tokenfactory/types/params.go index 18cb973c04..2ec3412ba2 100644 --- a/wormchain/x/tokenfactory/types/params.go +++ b/wormchain/x/tokenfactory/types/params.go @@ -4,20 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -// Parameter store keys. -var ( - KeyDenomCreationFee = []byte("DenomCreationFee") - KeyDenomCreationGasConsume = []byte("DenomCreationGasConsume") -) - -// ParamTable for tokenfactory module. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - func NewParams(denomCreationFee sdk.Coins) Params { return Params{ DenomCreationFee: denomCreationFee, @@ -27,8 +15,7 @@ func NewParams(denomCreationFee sdk.Coins) Params { // default tokenfactory module parameters. func DefaultParams() Params { return Params{ - DenomCreationFee: nil, - //DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10_000_000)), + DenomCreationFee: nil, DenomCreationGasConsume: 0, } } @@ -40,14 +27,6 @@ func (p Params) Validate() error { return err } -// Implements params.ParamSet. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee), - paramtypes.NewParamSetPair(KeyDenomCreationGasConsume, &p.DenomCreationGasConsume, validateDenomCreationFeeGasConsume), - } -} - func validateDenomCreationFee(i interface{}) error { v, ok := i.(sdk.Coins) if !ok { diff --git a/wormchain/x/tokenfactory/types/params.pb.go b/wormchain/x/tokenfactory/types/params.pb.go index 5e1fc14b43..1da6b81008 100644 --- a/wormchain/x/tokenfactory/types/params.pb.go +++ b/wormchain/x/tokenfactory/types/params.pb.go @@ -7,9 +7,8 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/regen-network/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -29,8 +28,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the tokenfactory module. type Params struct { DenomCreationFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=denom_creation_fee,json=denomCreationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"denom_creation_fee" yaml:"denom_creation_fee"` - // if denom_creation_fee is an empty array, then this field is used to add more gas consumption - // to the base cost. + // if denom_creation_fee is an empty array, then this field is used to add + // more gas consumption to the base cost. // https://github.com/CosmWasm/token-factory/issues/11 DenomCreationGasConsume uint64 `protobuf:"varint,2,opt,name=denom_creation_gas_consume,json=denomCreationGasConsume,proto3" json:"denom_creation_gas_consume,omitempty" yaml:"denom_creation_gas_consume"` } @@ -91,30 +90,28 @@ func init() { } var fileDescriptor_cc8299d306f3ff47 = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xbf, 0x4e, 0xf3, 0x30, - 0x14, 0xc5, 0x93, 0x7e, 0x9f, 0x3a, 0x84, 0x05, 0x45, 0x48, 0xb4, 0x15, 0x4a, 0x4a, 0xa6, 0x76, - 0x68, 0xa2, 0x02, 0x13, 0x12, 0x4b, 0x2b, 0xc1, 0x54, 0x09, 0x75, 0x41, 0x62, 0x89, 0x6e, 0x12, - 0xe7, 0x8f, 0xda, 0xf8, 0x56, 0xb1, 0x03, 0xe4, 0x11, 0xd8, 0x98, 0x78, 0x08, 0x9e, 0xa4, 0x63, - 0x47, 0xa6, 0x80, 0xda, 0x37, 0xe8, 0x13, 0xa0, 0x3a, 0x06, 0xb5, 0x80, 0x98, 0xec, 0xeb, 0x7b, - 0xce, 0xcf, 0xe7, 0xda, 0x5a, 0x17, 0x59, 0x8a, 0x2c, 0x61, 0x0e, 0xc7, 0x09, 0xa1, 0x21, 0xf8, - 0x1c, 0xb3, 0xc2, 0xb9, 0xeb, 0x7b, 0x84, 0x43, 0xdf, 0x99, 0x41, 0x06, 0x29, 0xb3, 0x67, 0x19, - 0x72, 0xd4, 0x8f, 0xa4, 0xd4, 0xde, 0x96, 0xda, 0x52, 0xda, 0x3a, 0x88, 0x30, 0x42, 0x21, 0x74, - 0x36, 0xbb, 0xca, 0xd3, 0x3a, 0xfb, 0x13, 0x0f, 0x39, 0x8f, 0x31, 0x4b, 0x78, 0x31, 0x22, 0x1c, - 0x02, 0xe0, 0x20, 0x5d, 0x4d, 0x5f, 0xd8, 0xdc, 0x0a, 0x57, 0x15, 0xb2, 0x65, 0x54, 0x95, 0xe3, - 0x01, 0x23, 0x5f, 0x1c, 0x1f, 0x13, 0x5a, 0xf5, 0xad, 0xc7, 0x9a, 0x56, 0xbf, 0x16, 0xa9, 0xf5, - 0x67, 0x55, 0xd3, 0x03, 0x42, 0x31, 0x75, 0xfd, 0x8c, 0x00, 0x4f, 0x90, 0xba, 0x21, 0x21, 0x0d, - 0xb5, 0xfd, 0xaf, 0xb3, 0x77, 0xd2, 0xb4, 0x25, 0x76, 0x03, 0xfa, 0x1c, 0xc2, 0x1e, 0x62, 0x42, - 0x07, 0xa3, 0x79, 0x69, 0x2a, 0xeb, 0xd2, 0x6c, 0x16, 0x90, 0x4e, 0xcf, 0xad, 0x9f, 0x08, 0xeb, - 0xe5, 0xcd, 0xec, 0x44, 0x09, 0x8f, 0x73, 0xcf, 0xf6, 0x31, 0x95, 0x01, 0xe5, 0xd2, 0x63, 0xc1, - 0xc4, 0xe1, 0xc5, 0x8c, 0x30, 0x41, 0x63, 0xe3, 0x7d, 0x01, 0x18, 0x4a, 0xff, 0x25, 0x21, 0x7a, - 0xa8, 0xb5, 0xbe, 0x41, 0x23, 0x60, 0xae, 0x8f, 0x94, 0xe5, 0x29, 0x69, 0xd4, 0xda, 0x6a, 0xe7, - 0xff, 0xa0, 0x3b, 0x2f, 0x4d, 0x75, 0x5d, 0x9a, 0xc7, 0xbf, 0x86, 0xd8, 0xd2, 0x5b, 0xe3, 0xc3, - 0x9d, 0x0b, 0xae, 0x80, 0x0d, 0xab, 0xce, 0xe0, 0x66, 0xbe, 0x34, 0xd4, 0xc5, 0xd2, 0x50, 0xdf, - 0x97, 0x86, 0xfa, 0xb4, 0x32, 0x94, 0xc5, 0xca, 0x50, 0x5e, 0x57, 0x86, 0x72, 0x7b, 0xb1, 0x95, - 0xfe, 0x1e, 0xb3, 0x34, 0xc6, 0x29, 0xe9, 0x85, 0x98, 0xd3, 0x40, 0x30, 0xc4, 0x99, 0x1f, 0x43, - 0x42, 0x9d, 0x87, 0xdd, 0x9f, 0x13, 0x83, 0x79, 0x75, 0xf1, 0xd6, 0xa7, 0x1f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xdf, 0x2c, 0x19, 0x8a, 0x3d, 0x02, 0x00, 0x00, + // 334 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4e, 0x02, 0x31, + 0x1c, 0xc6, 0xaf, 0x68, 0x18, 0xce, 0xc5, 0x5c, 0x4c, 0x04, 0x62, 0x7a, 0x78, 0x13, 0x0c, 0xb4, + 0x41, 0x37, 0x13, 0x17, 0x48, 0x74, 0x32, 0x31, 0x2c, 0x26, 0x2e, 0xa4, 0x57, 0x7a, 0xc7, 0x05, + 0xda, 0x3f, 0xb9, 0x16, 0x95, 0x47, 0x70, 0x73, 0xf2, 0x21, 0x7c, 0x12, 0x46, 0x46, 0xa7, 0xd3, + 0xc0, 0x1b, 0xf0, 0x04, 0x86, 0xde, 0x69, 0x40, 0x9d, 0xda, 0xf4, 0xff, 0x7d, 0xbf, 0xef, 0x6b, + 0xeb, 0x36, 0x41, 0x4b, 0xd0, 0x89, 0xa6, 0x06, 0x46, 0x42, 0x45, 0x8c, 0x1b, 0x48, 0x67, 0xf4, + 0xa1, 0x1d, 0x0a, 0xc3, 0xda, 0x74, 0xc2, 0x52, 0x26, 0x35, 0x99, 0xa4, 0x60, 0xc0, 0x3b, 0x29, + 0xa4, 0x64, 0x5b, 0x4a, 0x0a, 0x69, 0xed, 0x28, 0x86, 0x18, 0xac, 0x90, 0x6e, 0x76, 0xb9, 0xa7, + 0x86, 0xb9, 0x35, 0xd1, 0x90, 0x69, 0xf1, 0x43, 0xe5, 0x90, 0xa8, 0x7c, 0x1e, 0x3c, 0x97, 0xdc, + 0xf2, 0xad, 0x0d, 0xf1, 0x5e, 0x91, 0xeb, 0x0d, 0x84, 0x02, 0xd9, 0xe7, 0xa9, 0x60, 0x26, 0x01, + 0xd5, 0x8f, 0x84, 0xa8, 0xa0, 0xfa, 0x5e, 0xe3, 0xe0, 0xac, 0x4a, 0x72, 0x10, 0xd9, 0x80, 0xbe, + 0x33, 0x49, 0x17, 0x12, 0xd5, 0xb9, 0x99, 0x67, 0xbe, 0xb3, 0xce, 0xfc, 0xea, 0x8c, 0xc9, 0xf1, + 0x45, 0xf0, 0x17, 0x11, 0xbc, 0x7d, 0xf8, 0x8d, 0x38, 0x31, 0xc3, 0x69, 0x48, 0x38, 0x48, 0x5a, + 0x54, 0xca, 0x97, 0x96, 0x1e, 0x8c, 0xa8, 0x99, 0x4d, 0x84, 0xb6, 0x34, 0xdd, 0x3b, 0xb4, 0x80, + 0x6e, 0xe1, 0xbf, 0x12, 0xc2, 0x8b, 0xdc, 0xda, 0x2f, 0x68, 0xcc, 0x74, 0x9f, 0x83, 0xd2, 0x53, + 0x29, 0x2a, 0xa5, 0x3a, 0x6a, 0xec, 0x77, 0x9a, 0xf3, 0xcc, 0x47, 0xeb, 0xcc, 0x3f, 0xfd, 0xb7, + 0xc4, 0x96, 0x3e, 0xe8, 0x1d, 0xef, 0x04, 0x5c, 0x33, 0xdd, 0xcd, 0x27, 0x9d, 0xbb, 0xf9, 0x12, + 0xa3, 0xc5, 0x12, 0xa3, 0xcf, 0x25, 0x46, 0x2f, 0x2b, 0xec, 0x2c, 0x56, 0xd8, 0x79, 0x5f, 0x61, + 0xe7, 0xfe, 0x72, 0xab, 0xfd, 0x23, 0xa4, 0x72, 0x08, 0x63, 0xd1, 0x8a, 0x60, 0xaa, 0x06, 0x96, + 0x61, 0xcf, 0xf8, 0x90, 0x25, 0x8a, 0x3e, 0xed, 0xfe, 0xa3, 0xbd, 0x58, 0x58, 0xb6, 0x6f, 0x7d, + 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xb4, 0xcb, 0xfe, 0xec, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/tokenfactory/types/params_legacy.go b/wormchain/x/tokenfactory/types/params_legacy.go new file mode 100644 index 0000000000..43c1f6f9ac --- /dev/null +++ b/wormchain/x/tokenfactory/types/params_legacy.go @@ -0,0 +1,30 @@ +/* +NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov +controlled execution of MsgUpdateParams messages. These types remains solely +for migration purposes and will be removed in a future release. +*/ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// Parameter legacy store keys. +var ( + KeyDenomCreationFee = []byte("DenomCreationFee") + KeyDenomCreationGasConsume = []byte("DenomCreationGasConsume") +) + +// ParamTable for tokenfactory module. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// Implements params.ParamSet. +// Deprecated: legacy code. Remove after v47 upgrade. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee), + paramtypes.NewParamSetPair(KeyDenomCreationGasConsume, &p.DenomCreationGasConsume, validateDenomCreationFeeGasConsume), + } +} diff --git a/wormchain/x/tokenfactory/types/query.pb.go b/wormchain/x/tokenfactory/types/query.pb.go index 149af1be01..42d1132c43 100644 --- a/wormchain/x/tokenfactory/types/query.pb.go +++ b/wormchain/x/tokenfactory/types/query.pb.go @@ -6,10 +6,9 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -311,44 +310,43 @@ func init() { } var fileDescriptor_6f22013ad0f72e3f = []byte{ - // 582 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0xa1, 0x0d, 0xea, 0xf2, 0x23, 0xba, 0x54, 0x08, 0xa2, 0xe2, 0xc0, 0x52, 0x55, 0x29, - 0x2a, 0x5e, 0x52, 0x7a, 0xa2, 0x54, 0x10, 0x17, 0xc1, 0x01, 0x2a, 0x81, 0x2f, 0x08, 0x2e, 0xd1, - 0x26, 0xd9, 0x38, 0x16, 0xb1, 0xc7, 0xf5, 0x6e, 0x80, 0xa8, 0xea, 0x85, 0x03, 0x67, 0x24, 0x8e, - 0xbc, 0x03, 0xcf, 0xd1, 0x63, 0xa5, 0x5e, 0x38, 0x45, 0x28, 0xa9, 0x78, 0x80, 0x3c, 0x01, 0xca, - 0xee, 0xb6, 0xb4, 0x38, 0x58, 0x01, 0x4e, 0xb6, 0x66, 0xbe, 0xf9, 0xe6, 0xfb, 0x66, 0x46, 0x8b, - 0x4a, 0x20, 0x42, 0x10, 0x81, 0xa0, 0x12, 0xde, 0xf0, 0xa8, 0xc9, 0xea, 0x12, 0x92, 0x2e, 0x7d, - 0x5b, 0xae, 0x71, 0xc9, 0xca, 0x74, 0xab, 0xc3, 0x93, 0xae, 0x13, 0x27, 0x20, 0x01, 0xcf, 0x1b, - 0xa4, 0x73, 0x1c, 0xe9, 0x18, 0x64, 0x61, 0xce, 0x07, 0x1f, 0x14, 0x90, 0x8e, 0xfe, 0x74, 0x4d, - 0x61, 0xde, 0x07, 0xf0, 0xdb, 0x9c, 0xb2, 0x38, 0xa0, 0x2c, 0x8a, 0x40, 0x32, 0x19, 0x40, 0x24, - 0x4c, 0xf6, 0x56, 0x5d, 0x51, 0xd2, 0x1a, 0x13, 0x5c, 0xb7, 0x3a, 0x6a, 0x1c, 0x33, 0x3f, 0x88, - 0x14, 0xd8, 0x60, 0x57, 0x33, 0x75, 0xb2, 0x8e, 0x6c, 0x41, 0x12, 0xc8, 0xee, 0x26, 0x97, 0xac, - 0xc1, 0x24, 0x33, 0x55, 0x4b, 0x99, 0x55, 0x31, 0x4b, 0x58, 0x68, 0xc4, 0x90, 0x39, 0x84, 0x5f, - 0x8c, 0x24, 0x3c, 0x57, 0x41, 0x8f, 0x6f, 0x75, 0xb8, 0x90, 0xe4, 0x15, 0xba, 0x74, 0x22, 0x2a, - 0x62, 0x88, 0x04, 0xc7, 0x2e, 0xca, 0xeb, 0xe2, 0x2b, 0xd6, 0x75, 0xab, 0x74, 0x76, 0x65, 0xc1, - 0xc9, 0x1a, 0x8e, 0xa3, 0xab, 0xdd, 0xa9, 0xdd, 0x5e, 0x31, 0xe7, 0x99, 0x4a, 0xf2, 0x0c, 0x11, - 0x45, 0xfd, 0x88, 0x47, 0x10, 0x56, 0x7e, 0x37, 0x60, 0x04, 0xe0, 0x45, 0x34, 0xdd, 0x18, 0x01, - 0x54, 0xa3, 0x19, 0xf7, 0xe2, 0xb0, 0x57, 0x3c, 0xd7, 0x65, 0x61, 0xfb, 0x1e, 0x51, 0x61, 0xe2, - 0xe9, 0x34, 0xf9, 0x6a, 0xa1, 0x9b, 0x99, 0x74, 0x46, 0xf9, 0x47, 0x0b, 0xe1, 0xa3, 0x69, 0x55, - 0x43, 0x93, 0x36, 0x36, 0x56, 0xb3, 0x6d, 0x8c, 0xa7, 0x76, 0x6f, 0x8c, 0x6c, 0x0d, 0x7b, 0xc5, - 0xab, 0x5a, 0x57, 0x9a, 0x9d, 0x78, 0xb3, 0xa9, 0x05, 0x91, 0x4d, 0x74, 0xed, 0x97, 0x5e, 0xf1, - 0x38, 0x81, 0x70, 0x23, 0xe1, 0x4c, 0x42, 0x72, 0xe8, 0x7c, 0x19, 0x9d, 0xa9, 0xeb, 0x88, 0xf1, - 0x8e, 0x87, 0xbd, 0xe2, 0x05, 0xdd, 0xc3, 0x24, 0x88, 0x77, 0x08, 0x21, 0x4f, 0x91, 0xfd, 0x27, - 0x3a, 0xe3, 0x7c, 0x09, 0xe5, 0xd5, 0xa8, 0x46, 0x3b, 0x3b, 0x5d, 0x9a, 0x71, 0x67, 0x87, 0xbd, - 0xe2, 0xf9, 0x63, 0xa3, 0x14, 0xc4, 0x33, 0x80, 0x95, 0x83, 0x29, 0x34, 0xad, 0xd8, 0xf0, 0x17, - 0x0b, 0xe5, 0xf5, 0xf6, 0xf0, 0x9d, 0xec, 0xe1, 0xa4, 0x8f, 0xa7, 0x50, 0xfe, 0x8b, 0x0a, 0x2d, - 0x92, 0x2c, 0x7f, 0xd8, 0x3f, 0xf8, 0x7c, 0x6a, 0x11, 0x2f, 0xd0, 0x09, 0x2e, 0x17, 0xff, 0xb0, - 0xd0, 0xe5, 0xf1, 0x4b, 0xc1, 0x0f, 0x27, 0xe8, 0x9d, 0x79, 0x79, 0x85, 0xca, 0x7f, 0x30, 0x18, - 0x37, 0x4f, 0x94, 0x9b, 0x0a, 0x7e, 0x90, 0xed, 0x46, 0x4f, 0x9d, 0x6e, 0xab, 0xef, 0x0e, 0x4d, - 0x1f, 0x10, 0xde, 0xb7, 0xd0, 0x6c, 0x6a, 0xb3, 0x78, 0x6d, 0x52, 0x85, 0x63, 0xce, 0xab, 0x70, - 0xff, 0xdf, 0x8a, 0x8d, 0xb3, 0x0d, 0xe5, 0x6c, 0x1d, 0xaf, 0x4d, 0xe2, 0xac, 0xda, 0x4c, 0x20, - 0xac, 0x9a, 0x4b, 0xa5, 0xdb, 0xe6, 0x67, 0xc7, 0x7d, 0xb9, 0xdb, 0xb7, 0xad, 0xbd, 0xbe, 0x6d, - 0x7d, 0xef, 0xdb, 0xd6, 0xa7, 0x81, 0x9d, 0xdb, 0x1b, 0xd8, 0xb9, 0x6f, 0x03, 0x3b, 0xf7, 0x7a, - 0xdd, 0x0f, 0x64, 0xab, 0x53, 0x73, 0xea, 0x10, 0xd2, 0x77, 0x90, 0x84, 0x2d, 0x68, 0xf3, 0xdb, - 0x4d, 0xe8, 0x44, 0x0d, 0xf5, 0x26, 0xaa, 0x58, 0xbd, 0xc5, 0x82, 0x88, 0xbe, 0x3f, 0xd9, 0x58, - 0x76, 0x63, 0x2e, 0x6a, 0x79, 0xf5, 0xa4, 0xdd, 0xfd, 0x19, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x68, - 0xf9, 0x44, 0xdd, 0x05, 0x00, 0x00, + // 564 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0xc7, 0xb3, 0xd0, 0x06, 0xd5, 0x7c, 0x88, 0x98, 0x0a, 0x41, 0x54, 0x36, 0x60, 0xaa, 0x2a, + 0x95, 0xca, 0x9a, 0x94, 0x9e, 0x28, 0x15, 0x64, 0x8b, 0xe0, 0x00, 0x95, 0x60, 0x2f, 0x08, 0x2e, + 0x91, 0x93, 0x38, 0xc9, 0x8a, 0xec, 0x4e, 0x6a, 0x3b, 0x40, 0x54, 0xf5, 0xc2, 0x81, 0x33, 0x12, + 0x47, 0xde, 0x81, 0xe7, 0xe8, 0xb1, 0x52, 0x2f, 0x9c, 0x22, 0x94, 0x54, 0x3c, 0x40, 0x9e, 0x00, + 0xc5, 0x76, 0xa1, 0x65, 0xc3, 0x2a, 0xc0, 0x69, 0x57, 0x33, 0xf3, 0x9f, 0x99, 0xdf, 0xcc, 0xc8, + 0xa8, 0x08, 0x32, 0x02, 0x19, 0x4a, 0xaa, 0xe0, 0x35, 0x8f, 0x1b, 0xac, 0xa6, 0x40, 0xf4, 0xe8, + 0x9b, 0x52, 0x95, 0x2b, 0x56, 0xa2, 0xdb, 0x5d, 0x2e, 0x7a, 0x5e, 0x47, 0x80, 0x02, 0xbc, 0x60, + 0x23, 0xbd, 0xe3, 0x91, 0x9e, 0x8d, 0xcc, 0xcf, 0x37, 0xa1, 0x09, 0x3a, 0x90, 0x8e, 0xff, 0x8c, + 0x26, 0xbf, 0xd0, 0x04, 0x68, 0xb6, 0x39, 0x65, 0x9d, 0x90, 0xb2, 0x38, 0x06, 0xc5, 0x54, 0x08, + 0xb1, 0xb4, 0xde, 0xb5, 0xd4, 0xda, 0xac, 0xab, 0x5a, 0x20, 0x42, 0xd5, 0xdb, 0xe2, 0x8a, 0xd5, + 0x99, 0x62, 0x56, 0xb5, 0x9c, 0xaa, 0xea, 0x30, 0xc1, 0x22, 0x5b, 0x80, 0xcc, 0x23, 0xfc, 0x7c, + 0x4c, 0xf0, 0x4c, 0x1b, 0x03, 0xbe, 0xdd, 0xe5, 0x52, 0x91, 0x97, 0xe8, 0xd2, 0x09, 0xab, 0xec, + 0x40, 0x2c, 0x39, 0xf6, 0x51, 0xd6, 0x88, 0xaf, 0x38, 0xd7, 0x9d, 0xe2, 0xd9, 0xd5, 0x45, 0x2f, + 0x0d, 0xd8, 0x33, 0x6a, 0x7f, 0x66, 0xaf, 0x5f, 0xc8, 0x04, 0x56, 0x49, 0x9e, 0x22, 0xa2, 0x53, + 0x3f, 0xe4, 0x31, 0x44, 0xe5, 0xdf, 0x01, 0x6c, 0x03, 0x78, 0x09, 0xcd, 0xd6, 0xc7, 0x01, 0xba, + 0xd0, 0x9c, 0x7f, 0x71, 0xd4, 0x2f, 0x9c, 0xeb, 0xb1, 0xa8, 0x7d, 0x97, 0x68, 0x33, 0x09, 0x8c, + 0x9b, 0x7c, 0x71, 0xd0, 0xcd, 0xd4, 0x74, 0xb6, 0xf3, 0x0f, 0x0e, 0xc2, 0x3f, 0xa7, 0x55, 0x89, + 0xac, 0xdb, 0x62, 0xac, 0xa5, 0x63, 0x4c, 0x4e, 0xed, 0xdf, 0x18, 0x63, 0x8d, 0xfa, 0x85, 0xab, + 0xa6, 0xaf, 0x64, 0x76, 0x12, 0xe4, 0x12, 0x0b, 0x22, 0x5b, 0xe8, 0xda, 0xaf, 0x7e, 0xe5, 0x23, + 0x01, 0xd1, 0xa6, 0xe0, 0x4c, 0x81, 0x38, 0x22, 0x5f, 0x41, 0x67, 0x6a, 0xc6, 0x62, 0xd9, 0xf1, + 0xa8, 0x5f, 0xb8, 0x60, 0x6a, 0x58, 0x07, 0x09, 0x8e, 0x42, 0xc8, 0x13, 0xe4, 0xfe, 0x29, 0x9d, + 0x25, 0x5f, 0x46, 0x59, 0x3d, 0xaa, 0xf1, 0xce, 0x4e, 0x17, 0xe7, 0xfc, 0xdc, 0xa8, 0x5f, 0x38, + 0x7f, 0x6c, 0x94, 0x92, 0x04, 0x36, 0x60, 0xf5, 0x70, 0x06, 0xcd, 0xea, 0x6c, 0xf8, 0xb3, 0x83, + 0xb2, 0x66, 0x7b, 0xf8, 0x76, 0xfa, 0x70, 0x92, 0xc7, 0x93, 0x2f, 0xfd, 0x85, 0xc2, 0x34, 0x49, + 0x56, 0xde, 0x1f, 0x1c, 0x7e, 0x3a, 0xb5, 0x84, 0x17, 0xe9, 0x14, 0x97, 0x8b, 0xbf, 0x3b, 0xe8, + 0xf2, 0xe4, 0xa5, 0xe0, 0x07, 0x53, 0xd4, 0x4e, 0xbd, 0xbc, 0x7c, 0xf9, 0x3f, 0x32, 0x58, 0x9a, + 0xc7, 0x9a, 0xa6, 0x8c, 0xef, 0xa7, 0xd3, 0x98, 0xa9, 0xd3, 0x1d, 0xfd, 0xdd, 0xa5, 0xc9, 0x03, + 0xc2, 0x07, 0x0e, 0xca, 0x25, 0x36, 0x8b, 0xd7, 0xa7, 0xed, 0x70, 0xc2, 0x79, 0xe5, 0xef, 0xfd, + 0x9b, 0xd8, 0x92, 0x6d, 0x6a, 0xb2, 0x0d, 0xbc, 0x3e, 0x0d, 0x59, 0xa5, 0x21, 0x20, 0xaa, 0xd8, + 0x4b, 0xa5, 0x3b, 0xf6, 0x67, 0xd7, 0x7f, 0xb1, 0x37, 0x70, 0x9d, 0xfd, 0x81, 0xeb, 0x7c, 0x1b, + 0xb8, 0xce, 0xc7, 0xa1, 0x9b, 0xd9, 0x1f, 0xba, 0x99, 0xaf, 0x43, 0x37, 0xf3, 0x6a, 0xa3, 0x19, + 0xaa, 0x56, 0xb7, 0xea, 0xd5, 0x20, 0xa2, 0x6f, 0x41, 0x44, 0x2d, 0x68, 0xf3, 0x5b, 0x0d, 0xe8, + 0xc6, 0x75, 0xfd, 0x28, 0x6a, 0x5b, 0xad, 0xc5, 0xc2, 0x98, 0xbe, 0x3b, 0x59, 0x58, 0xf5, 0x3a, + 0x5c, 0x56, 0xb3, 0xfa, 0x49, 0xbb, 0xf3, 0x23, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xf5, 0x2f, 0x18, + 0xb1, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -494,6 +492,7 @@ func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.tokenfactory.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/wormchain/x/tokenfactory/types/tx.pb.go b/wormchain/x/tokenfactory/types/tx.pb.go index 72cdc12f93..de5f742d6e 100644 --- a/wormchain/x/tokenfactory/types/tx.pb.go +++ b/wormchain/x/tokenfactory/types/tx.pb.go @@ -6,11 +6,13 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" types1 "github.com/cosmos/cosmos-sdk/x/bank/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -630,6 +632,105 @@ func (m *MsgForceTransferResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgForceTransferResponse proto.InternalMessageInfo +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_283b6c9a90a846b4, []int{12} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_283b6c9a90a846b4, []int{13} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateDenom)(nil), "osmosis.tokenfactory.v1beta1.MsgCreateDenom") proto.RegisterType((*MsgCreateDenomResponse)(nil), "osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse") @@ -643,6 +744,8 @@ func init() { proto.RegisterType((*MsgSetDenomMetadataResponse)(nil), "osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse") proto.RegisterType((*MsgForceTransfer)(nil), "osmosis.tokenfactory.v1beta1.MsgForceTransfer") proto.RegisterType((*MsgForceTransferResponse)(nil), "osmosis.tokenfactory.v1beta1.MsgForceTransferResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "osmosis.tokenfactory.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "osmosis.tokenfactory.v1beta1.MsgUpdateParamsResponse") } func init() { @@ -650,55 +753,63 @@ func init() { } var fileDescriptor_283b6c9a90a846b4 = []byte{ - // 753 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0xfb, 0x77, 0xdb, 0xe9, 0xcd, 0x4d, 0xea, 0xf6, 0x96, 0x60, 0x5a, 0xbb, 0x1a, 0xa9, - 0x08, 0x24, 0x6a, 0x2b, 0x05, 0x21, 0x81, 0x84, 0x44, 0x53, 0x54, 0xb1, 0x20, 0x1b, 0x53, 0x09, - 0x09, 0x55, 0x8a, 0x26, 0xc9, 0xc4, 0xb1, 0x5a, 0xcf, 0x14, 0xcf, 0x84, 0xb4, 0x3b, 0x1e, 0x81, - 0x05, 0xe2, 0x05, 0x58, 0xf1, 0x16, 0xac, 0x50, 0x97, 0x5d, 0xb2, 0xb2, 0x50, 0xfb, 0x06, 0x7e, - 0x02, 0xe4, 0x99, 0xb1, 0xf3, 0x57, 0x91, 0x64, 0xd5, 0x5d, 0x32, 0xe7, 0xfb, 0xbe, 0x39, 0xdf, - 0x99, 0x73, 0x8e, 0x0c, 0xb6, 0x29, 0x0b, 0x28, 0xf3, 0x99, 0xc3, 0xe9, 0x31, 0x26, 0x2d, 0xd4, - 0xe0, 0x34, 0x3c, 0x77, 0x3e, 0x96, 0xeb, 0x98, 0xa3, 0xb2, 0xc3, 0xcf, 0xec, 0xd3, 0x90, 0x72, - 0xaa, 0x6f, 0x28, 0x98, 0xdd, 0x0f, 0xb3, 0x15, 0xcc, 0x58, 0xf3, 0xa8, 0x47, 0x05, 0xd0, 0x49, - 0x7e, 0x49, 0x8e, 0x61, 0x36, 0x04, 0xc9, 0xa9, 0x23, 0x86, 0x33, 0xc5, 0x06, 0xf5, 0xc9, 0x48, - 0x9c, 0x1c, 0x67, 0xf1, 0xe4, 0x8f, 0x8c, 0xc3, 0x13, 0xf0, 0x5f, 0x95, 0x79, 0xfb, 0x21, 0x46, - 0x1c, 0xbf, 0xc2, 0x84, 0x06, 0xfa, 0x43, 0xb0, 0xc0, 0x30, 0x69, 0xe2, 0xb0, 0xa4, 0x6d, 0x69, - 0x0f, 0x96, 0x2a, 0x2b, 0x71, 0x64, 0xe5, 0xcf, 0x51, 0x70, 0xf2, 0x1c, 0xca, 0x73, 0xe8, 0x2a, - 0x80, 0xee, 0x80, 0x45, 0xd6, 0xa9, 0x37, 0x13, 0x5a, 0x69, 0x46, 0x80, 0x57, 0xe3, 0xc8, 0x2a, - 0x28, 0xb0, 0x8a, 0x40, 0x37, 0x03, 0xc1, 0x23, 0xb0, 0x3e, 0x78, 0x9b, 0x8b, 0xd9, 0x29, 0x25, - 0x0c, 0xeb, 0x15, 0x50, 0x20, 0xb8, 0x5b, 0x13, 0xce, 0x6b, 0x52, 0x51, 0x5e, 0x6f, 0xc4, 0x91, - 0xb5, 0x2e, 0x15, 0x87, 0x00, 0xd0, 0xcd, 0x13, 0xdc, 0x3d, 0x4c, 0x0e, 0x84, 0x16, 0xfc, 0xa1, - 0x81, 0x7f, 0xaa, 0xcc, 0xab, 0xfa, 0x84, 0x4f, 0xe3, 0xe2, 0x35, 0x58, 0x40, 0x01, 0xed, 0x10, - 0x2e, 0x3c, 0x2c, 0xef, 0xde, 0xb5, 0x65, 0xcd, 0xec, 0xa4, 0xa6, 0x69, 0xf9, 0xed, 0x7d, 0xea, - 0x93, 0xca, 0xff, 0x17, 0x91, 0x95, 0xeb, 0x29, 0x49, 0x1a, 0x74, 0x15, 0x5f, 0x7f, 0x09, 0xf2, - 0x81, 0x4f, 0xf8, 0x21, 0xdd, 0x6b, 0x36, 0x43, 0xcc, 0x58, 0x69, 0x76, 0xd8, 0x42, 0x12, 0xae, - 0x71, 0x5a, 0x43, 0x12, 0x00, 0xdd, 0x41, 0x02, 0x5c, 0x01, 0x05, 0xe5, 0x20, 0xad, 0x0c, 0xfc, - 0x29, 0x5d, 0x55, 0x3a, 0x21, 0xb9, 0x1d, 0x57, 0x07, 0xa0, 0x50, 0xef, 0x84, 0xe4, 0x20, 0xa4, - 0xc1, 0xa0, 0xaf, 0x8d, 0x38, 0xb2, 0x4a, 0x92, 0x93, 0x00, 0x6a, 0xad, 0x90, 0x06, 0x3d, 0x67, - 0xc3, 0x24, 0xe5, 0x2d, 0xf1, 0x91, 0x79, 0xfb, 0xaa, 0xc9, 0xf6, 0x6b, 0x23, 0xe2, 0xe1, 0xbd, - 0x66, 0xe0, 0x4f, 0x65, 0xf1, 0x3e, 0x98, 0xef, 0xef, 0xbd, 0x62, 0x1c, 0x59, 0xff, 0x4a, 0xa4, - 0xea, 0x0f, 0x19, 0xd6, 0xcb, 0x60, 0x29, 0x69, 0x1d, 0x94, 0xe8, 0xab, 0xd4, 0xd7, 0xe2, 0xc8, - 0x2a, 0xf6, 0xba, 0x4a, 0x84, 0xa0, 0xbb, 0x48, 0x70, 0x57, 0x64, 0x01, 0x4b, 0xb2, 0x51, 0x7b, - 0x79, 0x65, 0x29, 0x7f, 0xd1, 0xc0, 0x6a, 0x95, 0x79, 0x6f, 0x31, 0x17, 0x4d, 0x57, 0xc5, 0x1c, - 0x35, 0x11, 0x47, 0xd3, 0xe4, 0xed, 0x82, 0xc5, 0x40, 0xd1, 0xd4, 0xe3, 0x6c, 0xf6, 0x1e, 0x87, - 0x1c, 0x67, 0x8f, 0x93, 0x6a, 0x57, 0xee, 0xa8, 0x07, 0x52, 0x93, 0x95, 0x92, 0xa1, 0x9b, 0xe9, - 0xc0, 0x4d, 0x70, 0xef, 0x86, 0xac, 0xb2, 0xac, 0xbf, 0xcf, 0x80, 0x62, 0x95, 0x79, 0x07, 0x34, - 0x6c, 0xe0, 0xc3, 0x10, 0x11, 0xd6, 0xc2, 0xe1, 0xed, 0x74, 0x93, 0x0b, 0x56, 0xb9, 0x4a, 0x60, - 0xb4, 0xa3, 0xb6, 0xe2, 0xc8, 0xda, 0x90, 0xbc, 0x14, 0x34, 0xd4, 0x55, 0x37, 0x91, 0xf5, 0x37, - 0x60, 0x25, 0x3d, 0xee, 0xcd, 0xde, 0x9c, 0x50, 0x34, 0xe3, 0xc8, 0x32, 0x86, 0x14, 0xfb, 0xe7, - 0x6f, 0x94, 0x08, 0x0d, 0x50, 0x1a, 0x2e, 0x55, 0x5a, 0xc7, 0xdd, 0x6f, 0xf3, 0x60, 0xb6, 0xca, - 0x3c, 0xfd, 0x03, 0x58, 0xee, 0xdf, 0x99, 0x8f, 0xec, 0xbf, 0xad, 0x6e, 0x7b, 0x70, 0xe7, 0x19, - 0x4f, 0xa6, 0x41, 0x67, 0x1b, 0xf2, 0x08, 0xcc, 0x89, 0xcd, 0xb6, 0x3d, 0x96, 0x9d, 0xc0, 0x8c, - 0x9d, 0x89, 0x60, 0xfd, 0xea, 0x62, 0xc3, 0x8c, 0x57, 0x4f, 0x60, 0x13, 0xa8, 0xf7, 0xcf, 0xb9, - 0x28, 0x57, 0xdf, 0x8c, 0x4f, 0x50, 0xae, 0x1e, 0x7a, 0x92, 0x72, 0x8d, 0xce, 0xa9, 0xfe, 0x49, - 0x03, 0xc5, 0x91, 0x21, 0x2d, 0x8f, 0x95, 0x1a, 0xa6, 0x18, 0xcf, 0xa6, 0xa6, 0x64, 0x29, 0x74, - 0x41, 0x7e, 0x70, 0xe0, 0xec, 0xb1, 0x5a, 0x03, 0x78, 0xe3, 0xe9, 0x74, 0xf8, 0xf4, 0xe2, 0xca, - 0xbb, 0x8b, 0x2b, 0x53, 0xbb, 0xbc, 0x32, 0xb5, 0xdf, 0x57, 0xa6, 0xf6, 0xf9, 0xda, 0xcc, 0x5d, - 0x5e, 0x9b, 0xb9, 0x5f, 0xd7, 0x66, 0xee, 0xfd, 0x0b, 0xcf, 0xe7, 0xed, 0x4e, 0xdd, 0x6e, 0xd0, - 0xc0, 0xe9, 0xd2, 0x30, 0x68, 0xd3, 0x13, 0xbc, 0xd3, 0xa2, 0x1d, 0xd2, 0x44, 0xdc, 0xa7, 0x44, - 0x9c, 0x35, 0xda, 0xc8, 0x27, 0xce, 0xd9, 0xe0, 0xc7, 0x0a, 0x3f, 0x3f, 0xc5, 0xac, 0xbe, 0x20, - 0x3e, 0x1a, 0x1e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe0, 0xd3, 0x97, 0xd1, 0x08, 0x00, - 0x00, + // 885 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xb6, 0xc1, 0x24, 0xd3, 0xa6, 0x49, 0x36, 0xa1, 0x71, 0x96, 0xd4, 0x5b, 0x8d, 0x28, + 0xa2, 0x88, 0xec, 0xca, 0x05, 0x2a, 0x51, 0x09, 0x89, 0x6e, 0x51, 0xc4, 0x01, 0x4b, 0x68, 0x1b, + 0x84, 0x84, 0x2a, 0x59, 0x63, 0xef, 0x64, 0xbd, 0x4a, 0x76, 0xc6, 0xcc, 0x8c, 0xeb, 0xe6, 0x86, + 0xf8, 0x04, 0x1c, 0x10, 0x12, 0x07, 0x3e, 0x00, 0x37, 0x0e, 0x7c, 0x00, 0x4e, 0xa8, 0xc7, 0x8a, + 0x13, 0xa7, 0x15, 0x4a, 0x0e, 0xdc, 0xf7, 0x13, 0xa0, 0x9d, 0x99, 0xfd, 0xeb, 0x2a, 0x8e, 0x4f, + 0x39, 0x25, 0x9e, 0xf7, 0xfb, 0xfd, 0xe6, 0xfd, 0xde, 0x7b, 0xf3, 0x6c, 0x70, 0x8f, 0xf2, 0x98, + 0xf2, 0x88, 0xbb, 0x82, 0x1e, 0x63, 0x72, 0x84, 0x86, 0x82, 0xb2, 0x53, 0xf7, 0x79, 0x77, 0x80, + 0x05, 0xea, 0xba, 0xe2, 0x85, 0x33, 0x66, 0x54, 0x50, 0x73, 0x4f, 0xc3, 0x9c, 0x2a, 0xcc, 0xd1, + 0x30, 0x6b, 0x3b, 0xa4, 0x21, 0x95, 0x40, 0x37, 0xfb, 0x4f, 0x71, 0xac, 0xce, 0x50, 0x92, 0xdc, + 0x01, 0xe2, 0xb8, 0x50, 0x1c, 0xd2, 0x88, 0xcc, 0xc4, 0xc9, 0x71, 0x11, 0xcf, 0x3e, 0xe8, 0xf8, + 0xfd, 0x0b, 0x53, 0x1b, 0x23, 0x86, 0x62, 0xae, 0xa1, 0x3b, 0x5a, 0x2a, 0xe6, 0xa1, 0xfb, 0xbc, + 0x9b, 0xfd, 0xd1, 0x81, 0x5d, 0x15, 0xe8, 0xab, 0xe4, 0xd4, 0x07, 0x15, 0x82, 0x27, 0xe0, 0x56, + 0x8f, 0x87, 0x4f, 0x18, 0x46, 0x02, 0x7f, 0x8e, 0x09, 0x8d, 0xcd, 0xfb, 0xa0, 0xc5, 0x31, 0x09, + 0x30, 0x6b, 0x1b, 0x77, 0x8d, 0xf7, 0x56, 0xbd, 0xcd, 0x34, 0xb1, 0xd7, 0x4e, 0x51, 0x7c, 0xf2, + 0x08, 0xaa, 0x73, 0xe8, 0x6b, 0x80, 0xe9, 0x82, 0x15, 0x3e, 0x19, 0x04, 0x19, 0xad, 0x7d, 0x4d, + 0x82, 0xb7, 0xd2, 0xc4, 0x5e, 0xd7, 0x60, 0x1d, 0x81, 0x7e, 0x01, 0x82, 0xcf, 0xc0, 0xed, 0xfa, + 0x6d, 0x3e, 0xe6, 0x63, 0x4a, 0x38, 0x36, 0x3d, 0xb0, 0x4e, 0xf0, 0xb4, 0x2f, 0x4d, 0xf6, 0x95, + 0xa2, 0xba, 0xde, 0x4a, 0x13, 0xfb, 0xb6, 0x52, 0x6c, 0x00, 0xa0, 0xbf, 0x46, 0xf0, 0xf4, 0x30, + 0x3b, 0x90, 0x5a, 0xf0, 0x4f, 0x03, 0xbc, 0xd9, 0xe3, 0x61, 0x2f, 0x22, 0x62, 0x11, 0x17, 0x5f, + 0x80, 0x16, 0x8a, 0xe9, 0x84, 0x08, 0xe9, 0xe1, 0xc6, 0x83, 0x5d, 0x47, 0x57, 0x28, 0x6b, 0x59, + 0xde, 0x5d, 0xe7, 0x09, 0x8d, 0x88, 0xf7, 0xd6, 0xcb, 0xc4, 0x5e, 0x2a, 0x95, 0x14, 0x0d, 0xfa, + 0x9a, 0x6f, 0x7e, 0x06, 0xd6, 0xe2, 0x88, 0x88, 0x43, 0xfa, 0x38, 0x08, 0x18, 0xe6, 0xbc, 0x7d, + 0xbd, 0x69, 0x21, 0x0b, 0xf7, 0x05, 0xed, 0x23, 0x05, 0x80, 0x7e, 0x9d, 0x00, 0x37, 0xc1, 0xba, + 0x76, 0x90, 0x57, 0x06, 0xfe, 0xa5, 0x5c, 0x79, 0x13, 0x46, 0xae, 0xc6, 0xd5, 0x01, 0x58, 0x1f, + 0x4c, 0x18, 0x39, 0x60, 0x34, 0xae, 0xfb, 0xda, 0x4b, 0x13, 0xbb, 0xad, 0x38, 0x19, 0xa0, 0x7f, + 0xc4, 0x68, 0x5c, 0x3a, 0x6b, 0x92, 0xb4, 0xb7, 0xcc, 0x47, 0xe1, 0xed, 0x67, 0x43, 0x8d, 0xdf, + 0x08, 0x91, 0x10, 0x3f, 0x0e, 0xe2, 0x68, 0x21, 0x8b, 0xef, 0x82, 0x37, 0xaa, 0xb3, 0xb7, 0x91, + 0x26, 0xf6, 0x4d, 0x85, 0xd4, 0xf3, 0xa1, 0xc2, 0x66, 0x17, 0xac, 0x66, 0xa3, 0x83, 0x32, 0x7d, + 0x9d, 0xfa, 0x76, 0x9a, 0xd8, 0x1b, 0xe5, 0x54, 0xc9, 0x10, 0xf4, 0x57, 0x08, 0x9e, 0xca, 0x2c, + 0x60, 0x5b, 0x0d, 0x6a, 0x99, 0x57, 0x91, 0xf2, 0x4f, 0x06, 0xd8, 0xea, 0xf1, 0xf0, 0x29, 0x16, + 0x72, 0xe8, 0x7a, 0x58, 0xa0, 0x00, 0x09, 0xb4, 0x48, 0xde, 0x3e, 0x58, 0x89, 0x35, 0x4d, 0x37, + 0xe7, 0x4e, 0xd9, 0x1c, 0x72, 0x5c, 0x34, 0x27, 0xd7, 0xf6, 0x76, 0x74, 0x83, 0xf4, 0xcb, 0xca, + 0xc9, 0xd0, 0x2f, 0x74, 0xe0, 0x1d, 0xf0, 0xf6, 0x6b, 0xb2, 0x2a, 0xb2, 0xfe, 0xed, 0x1a, 0xd8, + 0xe8, 0xf1, 0xf0, 0x80, 0xb2, 0x21, 0x3e, 0x64, 0x88, 0xf0, 0x23, 0xcc, 0xae, 0x66, 0x9a, 0x7c, + 0xb0, 0x25, 0x74, 0x02, 0xb3, 0x13, 0x75, 0x37, 0x4d, 0xec, 0x3d, 0xc5, 0xcb, 0x41, 0x8d, 0xa9, + 0x7a, 0x1d, 0xd9, 0xfc, 0x12, 0x6c, 0xe6, 0xc7, 0xe5, 0xdb, 0x5b, 0x96, 0x8a, 0x9d, 0x34, 0xb1, + 0xad, 0x86, 0x62, 0xf5, 0xfd, 0xcd, 0x12, 0xa1, 0x05, 0xda, 0xcd, 0x52, 0x15, 0x75, 0xfc, 0xd5, + 0x90, 0x43, 0xfc, 0xf5, 0x38, 0x40, 0x02, 0x7f, 0x25, 0x97, 0xaf, 0xf9, 0x10, 0xac, 0xa2, 0x89, + 0x18, 0x51, 0x16, 0x89, 0x53, 0x5d, 0xc9, 0xf6, 0xdf, 0x7f, 0xec, 0x6f, 0xeb, 0x0a, 0x69, 0xd9, + 0xa7, 0x82, 0x45, 0x24, 0xf4, 0x4b, 0xa8, 0xe9, 0x81, 0x96, 0x5a, 0xdf, 0xba, 0xa6, 0xef, 0x38, + 0x17, 0x7d, 0xbd, 0x38, 0xea, 0x36, 0x6f, 0x39, 0x2b, 0xaf, 0xaf, 0x99, 0x8f, 0x6e, 0xfd, 0xf0, + 0xdf, 0xef, 0xef, 0x97, 0x9a, 0x70, 0x17, 0xec, 0x34, 0xd2, 0xcb, 0x53, 0x7f, 0xf0, 0x4b, 0x0b, + 0x5c, 0xef, 0xf1, 0xd0, 0xfc, 0x0e, 0xdc, 0xa8, 0xae, 0xfb, 0x0f, 0x2e, 0xbe, 0xb5, 0xbe, 0xae, + 0xad, 0x8f, 0x16, 0x41, 0x17, 0xcb, 0xfd, 0x19, 0x58, 0x96, 0x4b, 0xf9, 0xde, 0x5c, 0x76, 0x06, + 0xb3, 0xf6, 0x2f, 0x05, 0xab, 0xaa, 0xcb, 0xe5, 0x38, 0x5f, 0x3d, 0x83, 0x5d, 0x42, 0xbd, 0xba, + 0xa2, 0x64, 0xb9, 0x2a, 0xeb, 0xe9, 0x12, 0xe5, 0x2a, 0xd1, 0x97, 0x29, 0xd7, 0xec, 0x8a, 0x31, + 0xbf, 0x37, 0xc0, 0xc6, 0xcc, 0x7e, 0xe9, 0xce, 0x95, 0x6a, 0x52, 0xac, 0x4f, 0x16, 0xa6, 0x14, + 0x29, 0x4c, 0xc1, 0x5a, 0x7d, 0x57, 0x38, 0x73, 0xb5, 0x6a, 0x78, 0xeb, 0xe1, 0x62, 0xf8, 0xe2, + 0x62, 0x01, 0x6e, 0xd6, 0x1e, 0xd7, 0xfc, 0x6e, 0x55, 0xe1, 0xd6, 0xc7, 0x0b, 0xc1, 0xf3, 0x5b, + 0xbd, 0x6f, 0x5e, 0x9e, 0x75, 0x8c, 0x57, 0x67, 0x1d, 0xe3, 0xdf, 0xb3, 0x8e, 0xf1, 0xe3, 0x79, + 0x67, 0xe9, 0xd5, 0x79, 0x67, 0xe9, 0x9f, 0xf3, 0xce, 0xd2, 0xb7, 0x9f, 0x86, 0x91, 0x18, 0x4d, + 0x06, 0xce, 0x90, 0xc6, 0xee, 0x94, 0xb2, 0x78, 0x44, 0x4f, 0xf0, 0xfe, 0x11, 0x9d, 0x90, 0x00, + 0x89, 0x88, 0x12, 0x79, 0x36, 0x1c, 0xa1, 0x88, 0xb8, 0x2f, 0xea, 0xbf, 0xd0, 0xc4, 0xe9, 0x18, + 0xf3, 0x41, 0x4b, 0xfe, 0xca, 0xfa, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x4d, 0x8f, + 0xd7, 0x61, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -719,6 +830,11 @@ type MsgClient interface { ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts ...grpc.CallOption) (*MsgChangeAdminResponse, error) SetDenomMetadata(ctx context.Context, in *MsgSetDenomMetadata, opts ...grpc.CallOption) (*MsgSetDenomMetadataResponse, error) ForceTransfer(ctx context.Context, in *MsgForceTransfer, opts ...grpc.CallOption) (*MsgForceTransferResponse, error) + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -783,6 +899,15 @@ func (c *msgClient) ForceTransfer(ctx context.Context, in *MsgForceTransfer, opt return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { CreateDenom(context.Context, *MsgCreateDenom) (*MsgCreateDenomResponse, error) @@ -791,6 +916,11 @@ type MsgServer interface { ChangeAdmin(context.Context, *MsgChangeAdmin) (*MsgChangeAdminResponse, error) SetDenomMetadata(context.Context, *MsgSetDenomMetadata) (*MsgSetDenomMetadataResponse, error) ForceTransfer(context.Context, *MsgForceTransfer) (*MsgForceTransferResponse, error) + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -815,6 +945,9 @@ func (*UnimplementedMsgServer) SetDenomMetadata(ctx context.Context, req *MsgSet func (*UnimplementedMsgServer) ForceTransfer(ctx context.Context, req *MsgForceTransfer) (*MsgForceTransferResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ForceTransfer not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -928,6 +1061,25 @@ func _Msg_ForceTransfer_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.tokenfactory.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -956,6 +1108,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ForceTransfer", Handler: _Msg_ForceTransfer_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/tokenfactory/v1beta1/tx.proto", @@ -1375,6 +1531,69 @@ func (m *MsgForceTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1558,6 +1777,30 @@ func (m *MsgForceTransferResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2744,6 +2987,171 @@ func (m *MsgForceTransferResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/wormchain/x/wormhole/ante/ante_test.go b/wormchain/x/wormhole/ante/ante_test.go new file mode 100644 index 0000000000..1967e96f67 --- /dev/null +++ b/wormchain/x/wormhole/ante/ante_test.go @@ -0,0 +1,28 @@ +package ante_test + +import sdk "github.com/cosmos/cosmos-sdk/types" + +// Define an empty ante handle +var ( + EmptyAnte = func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { + return ctx, nil + } +) + +type MockTx struct { + msgs []sdk.Msg +} + +func NewMockTx(msgs ...sdk.Msg) MockTx { + return MockTx{ + msgs: msgs, + } +} + +func (tx MockTx) GetMsgs() []sdk.Msg { + return tx.msgs +} + +func (tx MockTx) ValidateBasic() error { + return nil +} diff --git a/wormchain/x/wormhole/ante/wasmd_ante.go b/wormchain/x/wormhole/ante/wasmd_ante.go new file mode 100644 index 0000000000..440f2c927e --- /dev/null +++ b/wormchain/x/wormhole/ante/wasmd_ante.go @@ -0,0 +1,83 @@ +package ante + +import ( + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + wormholekeeper "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" +) + +// Reject all wasmd message unless authorized +type WormholeWasmdDecorator struct { + k wormholekeeper.Keeper + wasmdKeeper wasmkeeper.Keeper +} + +// NewWormholeWasmdDecorator creates a new WormholeWasmdDecorator +func NewWormholeWasmdDecorator(k wormholekeeper.Keeper, wasmd wasmkeeper.Keeper) WormholeWasmdDecorator { + return WormholeWasmdDecorator{ + k: k, + wasmdKeeper: wasmd, + } +} + +// AnteHandle implements the AnteHandler interface +// +// This handler rejects all wasmd messages except instantiate for allowed senders. +func (wh WormholeWasmdDecorator) AnteHandle(request sdk.Request, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Request, err error) { + // if this is a recheck, we already know the tx is valid + if request.IsReCheckTx() { + return next(request, tx, simulate) + } + + // don't reject gen_tx transactions + if request.BlockHeight() < 1 { + return next(request, tx, simulate) + } + + // reject all wasmd messages except instantiate for allowed senders + for _, msg := range tx.GetMsgs() { + + switch wasmMsg := msg.(type) { + + case *wasmtypes.MsgInstantiateContract: + if !wh.k.HasWasmInstantiateAllowlist(request, wasmMsg.Sender, wasmMsg.CodeID) { + return request, ErrNotSupported() + } else { + continue + } + + case *wasmtypes.MsgInstantiateContract2: + if !wh.k.HasWasmInstantiateAllowlist(request, wasmMsg.Sender, wasmMsg.CodeID) { + return request, ErrNotSupported() + } else { + continue + } + + case *wasmtypes.MsgStoreCode, + *wasmtypes.MsgMigrateContract, + *wasmtypes.MsgUpdateAdmin, + *wasmtypes.MsgClearAdmin, + *wasmtypes.MsgUpdateInstantiateConfig, + *wasmtypes.MsgUpdateParams, + *wasmtypes.MsgPinCodes, + *wasmtypes.MsgUnpinCodes, + *wasmtypes.MsgSudoContract, + *wasmtypes.MsgStoreAndInstantiateContract, + *wasmtypes.MsgAddCodeUploadParamsAddresses, + *wasmtypes.MsgRemoveCodeUploadParamsAddresses, + *wasmtypes.MsgStoreAndMigrateContract, + *wasmtypes.MsgUpdateContractLabel: + return request, ErrNotSupported() + } + } + + // continue to next AnteHandler + return next(request, tx, simulate) +} + +// ErrNotSupported returns an error indicating the message type is not supported. +func ErrNotSupported() error { + return sdkerrors.Wrapf(sdkerrors.ErrNotSupported, "must use x/wormhole") +} diff --git a/wormchain/x/wormhole/ante/wasmd_ante_test.go b/wormchain/x/wormhole/ante/wasmd_ante_test.go new file mode 100644 index 0000000000..63fd60d07d --- /dev/null +++ b/wormchain/x/wormhole/ante/wasmd_ante_test.go @@ -0,0 +1,173 @@ +package ante_test + +import ( + "testing" + "time" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/app/apptesting" + "github.com/wormhole-foundation/wormchain/x/wormhole/ante" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +func TestAnteHandle(t *testing.T) { + + // Setup app & ctx + app := apptesting.Setup(t, false, 0) + + ctx := app.BaseApp.NewContext(false, tmtypes.Header{ + Height: 1, + ChainID: apptesting.SimAppChainID, + Time: time.Now().UTC(), + }) + + // Create the decorator + decorator := ante.NewWormholeWasmdDecorator(app.WormholeKeeper, *app.GetWasmKeeper()) + + // Register a contract on the allowlist + app.WormholeKeeper.SetWasmInstantiateAllowlist(ctx, types.WasmInstantiateAllowedContractCodeId{ + ContractAddress: "contract", + CodeId: 1, + }) + + for _, tc := range []struct { + name string + msg sdk.Msg + shouldErr bool + }{ + { + "MsgInstantiateContract - Valid Sender & Code ID", + &wasmtypes.MsgInstantiateContract{ + Sender: "contract", + CodeID: 1, + }, + false, + }, + { + "MsgInstantiateContract - Sender Not On Allowlist", + &wasmtypes.MsgInstantiateContract{ + Sender: "contract_invalid", + CodeID: 1, + }, + true, + }, + { + "MsgInstantiateContract - Code ID Not On Allowlist", + &wasmtypes.MsgInstantiateContract{ + Sender: "contract", + CodeID: 2, + }, + true, + }, + { + "MsgInstantiateContract2 - Valid Sender & Code ID", + &wasmtypes.MsgInstantiateContract2{ + Sender: "contract", + CodeID: 1, + }, + false, + }, + { + "MsgInstantiateContract - Sender Not On Allowlist", + &wasmtypes.MsgInstantiateContract2{ + Sender: "contract_invalid", + CodeID: 1, + }, + true, + }, + { + "MsgInstantiateContract - Code ID Not On Allowlist", + &wasmtypes.MsgInstantiateContract2{ + Sender: "contract", + CodeID: 2, + }, + true, + }, + { + "MsgStoreCode", + &wasmtypes.MsgStoreCode{}, + true, + }, + { + "MsgMigrateContract", + &wasmtypes.MsgMigrateContract{}, + true, + }, + { + "MsgUpdateAdmin", + &wasmtypes.MsgUpdateAdmin{}, + true, + }, + { + "MsgClearAdmin", + &wasmtypes.MsgClearAdmin{}, + true, + }, + { + "MsgUpdateInstantiateConfig", + &wasmtypes.MsgUpdateInstantiateConfig{}, + true, + }, + { + "MsgUpdateParams", + &wasmtypes.MsgUpdateParams{}, + true, + }, + { + "MsgPinCodes", + &wasmtypes.MsgPinCodes{}, + true, + }, + { + "MsgUnpinCodes", + &wasmtypes.MsgUnpinCodes{}, + true, + }, + { + "MsgSudoContract", + &wasmtypes.MsgSudoContract{}, + true, + }, + { + "MsgStoreAndInstantiateContract", + &wasmtypes.MsgStoreAndInstantiateContract{}, + true, + }, + { + "MsgAddCodeUploadParamsAddresses", + &wasmtypes.MsgAddCodeUploadParamsAddresses{}, + true, + }, + { + "MsgRemoveCodeUploadParamsAddresses", + &wasmtypes.MsgRemoveCodeUploadParamsAddresses{}, + true, + }, + { + "MsgStoreAndMigrateContract", + &wasmtypes.MsgStoreAndMigrateContract{}, + true, + }, + { + "MsgUpdateContractLabel", + &wasmtypes.MsgUpdateContractLabel{}, + true, + }, + } { + t.Run(tc.name, func(t *testing.T) { + // Handle the tx + _, err := decorator.AnteHandle(ctx, NewMockTx(tc.msg), false, EmptyAnte) + + // Check the result + if tc.shouldErr { + require.ErrorIs(t, err, ante.ErrNotSupported()) + } else { + require.Nil(t, err) + } + }) + + } +} diff --git a/wormchain/x/wormhole/client/cli/genesis.go b/wormchain/x/wormhole/client/cli/genesis.go index 2d43fcc9e8..1121db649f 100644 --- a/wormchain/x/wormhole/client/cli/genesis.go +++ b/wormchain/x/wormhole/client/cli/genesis.go @@ -82,7 +82,7 @@ func CmdGenerateTestGuardianKey() *cobra.Command { if err != nil { return err } - os.WriteFile(outPublicPath, []byte(hex.EncodeToString(addr.Bytes())), 0644) + err = os.WriteFile(outPublicPath, []byte(hex.EncodeToString(addr.Bytes())), 0644) if err != nil { return err } @@ -425,7 +425,12 @@ func CmdTestSignAddress() *cobra.Command { if err != nil { return err } - addr := info.GetAddress() + + addr, err := info.GetAddress() + if err != nil { + return err + } + addrHash := crypto.Keccak256Hash(wormholesdk.SignedWormchainAddressPrefix, addr) sig, err := crypto.Sign(addrHash[:], key) if err != nil { diff --git a/wormchain/x/wormhole/client/cli/query_config_test.go b/wormchain/x/wormhole/client/cli/query_config_test.go index a6567d637c..bfa8426152 100644 --- a/wormchain/x/wormhole/client/cli/query_config_test.go +++ b/wormchain/x/wormhole/client/cli/query_config_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/status" "github.com/wormhole-foundation/wormchain/testutil/network" diff --git a/wormchain/x/wormhole/client/cli/query_consensus_guardian_set_index_test.go b/wormchain/x/wormhole/client/cli/query_consensus_guardian_set_index_test.go index e198f61fd8..3c7cdaa3ed 100644 --- a/wormchain/x/wormhole/client/cli/query_consensus_guardian_set_index_test.go +++ b/wormchain/x/wormhole/client/cli/query_consensus_guardian_set_index_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/status" "github.com/wormhole-foundation/wormchain/testutil/network" diff --git a/wormchain/x/wormhole/client/cli/query_guardian_set_test.go b/wormchain/x/wormhole/client/cli/query_guardian_set_test.go index 8e4bfc96e3..6ccfb01cae 100644 --- a/wormchain/x/wormhole/client/cli/query_guardian_set_test.go +++ b/wormchain/x/wormhole/client/cli/query_guardian_set_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/wormchain/x/wormhole/client/cli/query_guardian_validator_test.go b/wormchain/x/wormhole/client/cli/query_guardian_validator_test.go index 671a3e8205..24707d1683 100644 --- a/wormchain/x/wormhole/client/cli/query_guardian_validator_test.go +++ b/wormchain/x/wormhole/client/cli/query_guardian_validator_test.go @@ -6,10 +6,10 @@ import ( "strconv" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/wormchain/x/wormhole/client/cli/query_replay_protection_test.go b/wormchain/x/wormhole/client/cli/query_replay_protection_test.go index bcfba7e46a..f30e7a1654 100644 --- a/wormchain/x/wormhole/client/cli/query_replay_protection_test.go +++ b/wormchain/x/wormhole/client/cli/query_replay_protection_test.go @@ -5,10 +5,10 @@ import ( "strconv" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/wormchain/x/wormhole/client/cli/query_sequence_counter_test.go b/wormchain/x/wormhole/client/cli/query_sequence_counter_test.go index 72c3560ade..0585e379e1 100644 --- a/wormchain/x/wormhole/client/cli/query_sequence_counter_test.go +++ b/wormchain/x/wormhole/client/cli/query_sequence_counter_test.go @@ -5,10 +5,10 @@ import ( "strconv" "testing" + tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" - tmcli "github.com/tendermint/tendermint/libs/cli" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/wormchain/x/wormhole/client/cli/tx_governance.go b/wormchain/x/wormhole/client/cli/tx_governance.go deleted file mode 100644 index 053f8fddc2..0000000000 --- a/wormchain/x/wormhole/client/cli/tx_governance.go +++ /dev/null @@ -1,194 +0,0 @@ -package cli - -import ( - "encoding/hex" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/spf13/cobra" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" -) - -const FlagGuardianSetKeys = "guardian-set-keys" -const FlagGuardianSetIndex = "guardian-set-index" - -// NewCmdSubmitGuardianSetUpdateProposal implements a command handler for submitting a guardian set update governance -// proposal. -func NewCmdSubmitGuardianSetUpdateProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-guardian-set [flags]", - Args: cobra.ExactArgs(0), - Short: "Submit a guardian set update proposal", - Long: "Submit a proposal to update the current guardian set to a new one", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return err - } - - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return err - } - - keyStrings, err := cmd.Flags().GetStringArray(FlagGuardianSetKeys) - if err != nil { - return err - } - - newIndex, err := cmd.Flags().GetUint32(FlagGuardianSetIndex) - if err != nil { - return err - } - - keys := make([][]byte, len(keyStrings)) - for i, keyString := range keyStrings { - keyBytes, err := hex.DecodeString(keyString) - if err != nil { - return err - } - keys[i] = keyBytes - } - - content := types.NewGuardianSetUpdateProposal(title, description, types.GuardianSet{ - Index: newIndex, - Keys: keys, - ExpirationTime: 0, - }) - err = content.ValidateBasic() - if err != nil { - return err - } - - msg, err := gov.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") - cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") - cmd.Flags().StringArray(FlagGuardianSetKeys, []string{}, "list of guardian keys (hex encoded without 0x)") - cmd.Flags().Uint32(FlagGuardianSetIndex, 0, "index of the new guardian set") - cmd.MarkFlagRequired(cli.FlagTitle) - cmd.MarkFlagRequired(cli.FlagDescription) - cmd.MarkFlagRequired(FlagGuardianSetKeys) - cmd.MarkFlagRequired(FlagGuardianSetIndex) - - return cmd -} - -const FlagAction = "action" -const FlagModule = "module" -const FlagTargetChainID = "target-chain-id" -const FlagPayload = "payload" - -// NewCmdSubmitWormholeGovernanceMessageProposal implements a command handler for submitting a generic Wormhole -// governance message. -func NewCmdSubmitWormholeGovernanceMessageProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "wormhole-governance-message [flags]", - Args: cobra.ExactArgs(0), - Short: "Submit a wormhole governance message proposal", - Long: "Submit a proposal to emit a generic wormhole governance message", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return err - } - - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return err - } - - action, err := cmd.Flags().GetUint8(FlagAction) - if err != nil { - return err - } - - targetChain, err := cmd.Flags().GetUint16(FlagTargetChainID) - if err != nil { - return err - } - - module, err := cmd.Flags().GetBytesHex(FlagModule) - if err != nil { - return err - } - - payload, err := cmd.Flags().GetBytesHex(FlagPayload) - if err != nil { - return err - } - - content := types.NewGovernanceWormholeMessageProposal(title, description, action, targetChain, module, payload) - err = content.ValidateBasic() - if err != nil { - return err - } - - msg, err := gov.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") - cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") - cmd.Flags().Uint8(FlagAction, 0, "target chain of the message (0 for all)") - cmd.Flags().Uint16(FlagTargetChainID, 0, "target chain of the message (0 for all)") - cmd.Flags().BytesHex(FlagModule, []byte{}, "module identifier of the message") - cmd.Flags().BytesHex(FlagPayload, []byte{}, "payload of the message") - cmd.MarkFlagRequired(cli.FlagTitle) - cmd.MarkFlagRequired(cli.FlagDescription) - cmd.MarkFlagRequired(FlagAction) - cmd.MarkFlagRequired(FlagTargetChainID) - cmd.MarkFlagRequired(FlagModule) - cmd.MarkFlagRequired(FlagPayload) - - return cmd -} diff --git a/wormchain/x/wormhole/client/proposal_handler.go b/wormchain/x/wormhole/client/proposal_handler.go deleted file mode 100644 index 5f6d3c7717..0000000000 --- a/wormchain/x/wormhole/client/proposal_handler.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -import ( - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/wormhole-foundation/wormchain/x/wormhole/client/cli" - "github.com/wormhole-foundation/wormchain/x/wormhole/client/rest" -) - -var GuardianSetUpdateProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitGuardianSetUpdateProposal, rest.ProposalGuardianSetUpdateRESTHandler) -var WormholeGovernanceMessageProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitWormholeGovernanceMessageProposal, rest.ProposalWormholeGovernanceMessageRESTHandler) diff --git a/wormchain/x/wormhole/client/rest/rest.go b/wormchain/x/wormhole/client/rest/rest.go deleted file mode 100644 index f54e3c436a..0000000000 --- a/wormchain/x/wormhole/client/rest/rest.go +++ /dev/null @@ -1,125 +0,0 @@ -package rest - -import ( - "encoding/hex" - "net/http" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/rest" - govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" -) - -type ( - // GuardianSetUpdateProposalReq defines a guardian set update proposal request body. - GuardianSetUpdateProposalReq struct { - BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` - - Title string `json:"title" yaml:"title"` - Description string `json:"description" yaml:"description"` - GuardianSetIndex uint32 `json:"guardianSetIndex" yaml:"guardianSetIndex"` - GuardianSetKeys []string `json:"guardianSetKeys" yaml:"guardianSetKeys"` - Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` - Deposit sdk.Coins `json:"deposit" yaml:"deposit"` - } - - // WormholeGovernanceMessageProposalReq defines a wormhole governance message proposal request body. - WormholeGovernanceMessageProposalReq struct { - BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` - - Title string `json:"title" yaml:"title"` - Description string `json:"description" yaml:"description"` - TargetChain uint16 `json:"targetChain" yaml:"targetChain"` - Action uint8 `json:"action" yaml:"action"` - Module []byte `json:"module" yaml:"module"` - Payload []byte `json:"payload" yaml:"payload"` - Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` - Deposit sdk.Coins `json:"deposit" yaml:"deposit"` - } -) - -// ProposalGuardianSetUpdateRESTHandler returns a ProposalRESTHandler that exposes the guardian set update -// REST handler with a given sub-route. -func ProposalGuardianSetUpdateRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { - return govrest.ProposalRESTHandler{ - SubRoute: "wormhole_guardian_update", - Handler: postProposalGuardianSetUpdateHandlerFn(clientCtx), - } -} - -func postProposalGuardianSetUpdateHandlerFn(clientCtx client.Context) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req GuardianSetUpdateProposalReq - if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { - return - } - - req.BaseReq = req.BaseReq.Sanitize() - if !req.BaseReq.ValidateBasic(w) { - return - } - - keys := make([][]byte, len(req.GuardianSetKeys)) - for i, keyString := range req.GuardianSetKeys { - keyBytes, err := hex.DecodeString(keyString) - if rest.CheckBadRequestError(w, err) { - return - } - keys[i] = keyBytes - } - - content := types.NewGuardianSetUpdateProposal(req.Title, req.Description, types.GuardianSet{ - Index: req.GuardianSetIndex, - Keys: keys, - ExpirationTime: 0, - }) - - msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) - if rest.CheckBadRequestError(w, err) { - return - } - if rest.CheckBadRequestError(w, msg.ValidateBasic()) { - return - } - - tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) - } -} - -// ProposalWormholeGovernanceMessageRESTHandler returns a ProposalRESTHandler that exposes the wormhole governance message -// REST handler with a given sub-route. -func ProposalWormholeGovernanceMessageRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { - return govrest.ProposalRESTHandler{ - SubRoute: "wormhole_governance_message", - Handler: postProposalWormholeGovernanceMessageHandlerFn(clientCtx), - } -} - -func postProposalWormholeGovernanceMessageHandlerFn(clientCtx client.Context) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req WormholeGovernanceMessageProposalReq - if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { - return - } - - req.BaseReq = req.BaseReq.Sanitize() - if !req.BaseReq.ValidateBasic(w) { - return - } - - content := types.NewGovernanceWormholeMessageProposal(req.Title, req.Description, req.Action, req.TargetChain, req.Module, req.Payload) - - msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) - if rest.CheckBadRequestError(w, err) { - return - } - if rest.CheckBadRequestError(w, msg.ValidateBasic()) { - return - } - - tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) - } -} diff --git a/wormchain/x/wormhole/governance.go b/wormchain/x/wormhole/governance.go deleted file mode 100644 index 93cd26da14..0000000000 --- a/wormchain/x/wormhole/governance.go +++ /dev/null @@ -1,109 +0,0 @@ -package wormhole - -import ( - "bytes" - "encoding/binary" - "fmt" - "io" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" - "github.com/wormhole-foundation/wormhole/sdk/vaa" -) - -// NewWormholeGovernanceProposalHandler creates a governance handler to manage new proposal types. -// It enables GuardianSetProposal to update the guardian set and GenericWormholeMessageProposal to emit a generic wormhole -// message from the governance emitter. -func NewWormholeGovernanceProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.GuardianSetUpdateProposal: - return handleGuardianSetUpdateProposal(ctx, k, c) - - case *types.GovernanceWormholeMessageProposal: - return handleGovernanceWormholeMessageProposal(ctx, k, c) - - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized wormhole proposal content type: %T", c) - } - } -} - -func handleGuardianSetUpdateProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.GuardianSetUpdateProposal) error { - err := k.UpdateGuardianSet(ctx, types.GuardianSet{ - Index: proposal.NewGuardianSet.Index, - Keys: proposal.NewGuardianSet.Keys, - ExpirationTime: 0, - }) - if err != nil { - return fmt.Errorf("failed to update guardian set: %w", err) - } - - config, ok := k.GetConfig(ctx) - if !ok { - return types.ErrNoConfig - } - - // Post a wormhole guardian set update governance message - message := &bytes.Buffer{} - - // Header - message.Write(vaa.CoreModule) - MustWrite(message, binary.BigEndian, uint8(2)) - MustWrite(message, binary.BigEndian, uint16(0)) - - // Body - MustWrite(message, binary.BigEndian, proposal.NewGuardianSet.Index) - MustWrite(message, binary.BigEndian, uint8(len(proposal.NewGuardianSet.Keys))) - for _, key := range proposal.NewGuardianSet.Keys { - message.Write(key) - } - - emitterAddress, err := types.EmitterAddressFromBytes32(config.GovernanceEmitter) - if err != nil { - return fmt.Errorf("failed to post message: %w", err) - } - - err = k.PostMessage(ctx, emitterAddress, 0, message.Bytes()) - if err != nil { - return fmt.Errorf("failed to post message: %w", err) - } - - return nil -} - -func handleGovernanceWormholeMessageProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.GovernanceWormholeMessageProposal) error { - config, ok := k.GetConfig(ctx) - if !ok { - return types.ErrNoConfig - } - - // Post a wormhole governance message - message := &bytes.Buffer{} - message.Write(proposal.Module) - MustWrite(message, binary.BigEndian, uint8(proposal.Action)) - MustWrite(message, binary.BigEndian, uint16(proposal.TargetChain)) - message.Write(proposal.Payload) - - emitterAddress, err := types.EmitterAddressFromBytes32(config.GovernanceEmitter) - if err != nil { - return fmt.Errorf("failed to post message: %w", err) - } - - err = k.PostMessage(ctx, emitterAddress, 0, message.Bytes()) - if err != nil { - return fmt.Errorf("failed to post message: %w", err) - } - - return nil -} - -// MustWrite calls binary.Write and panics on errors -func MustWrite(w io.Writer, order binary.ByteOrder, data interface{}) { - if err := binary.Write(w, order, data); err != nil { - panic(fmt.Errorf("failed to write binary data: %v", data).Error()) - } -} diff --git a/wormchain/x/wormhole/handler.go b/wormchain/x/wormhole/handler.go deleted file mode 100644 index 64d870c1cc..0000000000 --- a/wormchain/x/wormhole/handler.go +++ /dev/null @@ -1,56 +0,0 @@ -package wormhole - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgExecuteGovernanceVAA: - res, err := msgServer.ExecuteGovernanceVAA(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRegisterAccountAsGuardian: - res, err := msgServer.RegisterAccountAsGuardian(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgStoreCode: - res, err := msgServer.StoreCode(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgInstantiateContract: - res, err := msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgAddWasmInstantiateAllowlist: - res, err := msgServer.AddWasmInstantiateAllowlist(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteWasmInstantiateAllowlist: - res, err := msgServer.DeleteWasmInstantiateAllowlist(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgMigrateContract: - res, err := msgServer.MigrateContract(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateAllowlistEntryRequest: - res, err := msgServer.CreateAllowlistEntry(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgDeleteAllowlistEntryRequest: - res, err := msgServer.DeleteAllowlistEntry(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgExecuteGatewayGovernanceVaa: - res, err := msgServer.ExecuteGatewayGovernanceVaa(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/wormchain/x/wormhole/keeper/allowlist_test.go b/wormchain/x/wormhole/keeper/allowlist_test.go new file mode 100644 index 0000000000..4feefe1cc9 --- /dev/null +++ b/wormchain/x/wormhole/keeper/allowlist_test.go @@ -0,0 +1,96 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +const ( + WormholeAddress1 = "wormhole1du4amsmvx8yqr8whw7qc5m3c0zpwknmzelwqy6" + WormholeAddress2 = "wormhole13ztxpktzsng3ewkepe2w39ugxzfdf23teptu9n" +) + +// TestAllowedAddressStore tests the setting, getting, and removing of allowed addresses. +func TestAllowedAddressStore(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + value := types.ValidatorAllowedAddress{ + ValidatorAddress: WormholeAddress1, + AllowedAddress: WormholeAddress2, + Name: "User1", + } + + // Set validator allowed list + k.SetValidatorAllowedAddress(ctx, value) + + // Check if address exists + hasAddr := k.HasValidatorAllowedAddress(ctx, value.AllowedAddress) + require.True(t, hasAddr) + + // Check faulty address - does not exist + hasAddr = k.HasValidatorAllowedAddress(ctx, "invalid") + require.False(t, hasAddr) + + // Retrieve & validate + res := k.GetValidatorAllowedAddress(ctx, value.AllowedAddress) + require.Equal(t, value.ValidatorAddress, res.ValidatorAddress) + require.Equal(t, value.AllowedAddress, res.AllowedAddress) + require.Equal(t, value.Name, res.Name) + + // Get all allowed addresses + addrList := k.GetAllAllowedAddresses(ctx) + require.Equal(t, 1, len(addrList)) + res = addrList[0] + require.Equal(t, value.ValidatorAddress, res.ValidatorAddress) + require.Equal(t, value.AllowedAddress, res.AllowedAddress) + require.Equal(t, value.Name, res.Name) + + // Remove address + k.RemoveValidatorAllowedAddress(ctx, value.AllowedAddress) + + // Check if address exists + hasAddr = k.HasValidatorAllowedAddress(ctx, value.AllowedAddress) + require.False(t, hasAddr) +} + +// TestValidatorAsAllowedAddress tests if a validator is a guardian or future validator. +func TestValidatorAsAllowedAddress(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Create guardian set + guardians, _ := createNGuardianValidator(k, ctx, 10) + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + ChainId: uint32(vaa.ChainIDWormchain), + GuardianSetExpiration: 86400, + }) + + createNewGuardianSet(k, ctx, guardians) + k.SetConsensusGuardianSetIndex(ctx, types.ConsensusGuardianSetIndex{ + Index: 0, + }) + + // Get validator addr + addr, err := sdk.Bech32ifyAddressBytes("wormhole", guardians[0].ValidatorAddr) + require.NoError(t, err) + + // Check if validator belongs to a guardian + _, found := k.GetGuardianValidatorByValidatorAddress(ctx, addr) + require.True(t, found) + + // Check if validator is a current/future validator + isVal := k.IsAddressValidatorOrFutureValidator(ctx, addr) + require.True(t, isVal) + + // Check invalid addresses + _, found = k.GetGuardianValidatorByValidatorAddress(ctx, WormholeAddress1) + require.False(t, found) + isVal = k.IsAddressValidatorOrFutureValidator(ctx, WormholeAddress1) + require.False(t, isVal) +} diff --git a/wormchain/x/wormhole/keeper/grpc_query_allowlist_test.go b/wormchain/x/wormhole/keeper/grpc_query_allowlist_test.go new file mode 100644 index 0000000000..ea285a903a --- /dev/null +++ b/wormchain/x/wormhole/keeper/grpc_query_allowlist_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestQueryAllowlist tests the allow list queries. +func TestQueryAllowlist(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Check if no allowlist exists + res, err := k.AllowlistAll(ctx, &types.QueryAllValidatorAllowlist{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, 0, len(res.Allowlist)) + + value := types.ValidatorAllowedAddress{ + ValidatorAddress: WormholeAddress1, + AllowedAddress: WormholeAddress2, + Name: "User1", + } + + // Set validator allowed list + k.SetValidatorAllowedAddress(ctx, value) + + // Query all allow lists + res, err = k.AllowlistAll(ctx, &types.QueryAllValidatorAllowlist{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, 1, len(res.Allowlist)) + require.Equal(t, value.ValidatorAddress, res.Allowlist[0].ValidatorAddress) + require.Equal(t, value.AllowedAddress, res.Allowlist[0].AllowedAddress) + require.Equal(t, value.Name, res.Allowlist[0].Name) + + // Invalid query all + _, err = k.Allowlist(ctx, nil) + require.Error(t, err) + + // Query allow list by address + res2, err := k.Allowlist(ctx, &types.QueryValidatorAllowlist{ + ValidatorAddress: value.ValidatorAddress, + }) + require.NoError(t, err) + require.NotNil(t, res2) + require.Equal(t, 1, len(res2.Allowlist)) + require.Equal(t, value.ValidatorAddress, res2.Allowlist[0].ValidatorAddress) + require.Equal(t, value.AllowedAddress, res2.Allowlist[0].AllowedAddress) + + // Query with nil request + _, err = k.Allowlist(ctx, nil) + require.Error(t, err) + + // Query invalid address + res2, err = k.Allowlist(ctx, &types.QueryValidatorAllowlist{ + ValidatorAddress: "invalid", + }) + require.NoError(t, err) + require.NotNil(t, res2) + require.Equal(t, 0, len(res2.Allowlist)) +} diff --git a/wormchain/x/wormhole/keeper/grpc_query_ibc_composability_mw_test.go b/wormchain/x/wormhole/keeper/grpc_query_ibc_composability_mw_test.go new file mode 100644 index 0000000000..c45e146cc2 --- /dev/null +++ b/wormchain/x/wormhole/keeper/grpc_query_ibc_composability_mw_test.go @@ -0,0 +1,36 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestQueryIbcComposabilityMwContract tests querying of the IbcComposabilityMwContract. +func TestQueryIbcComposabilityMwContract(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Invalid query with nil request + _, err := k.IbcComposabilityMwContract(ctx, nil) + require.Error(t, err) + + // Query when no contract is set + res, err := k.IbcComposabilityMwContract(ctx, &types.QueryIbcComposabilityMwContractRequest{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, "", res.ContractAddress) + + // Set the contract in state store + contractAddr := WormholeContractAddress1 + k.StoreIbcComposabilityMwContract(ctx, types.IbcComposabilityMwContract{ + ContractAddress: contractAddr, + }) + + // Query IbcComposabilityMwContract + res, err = k.IbcComposabilityMwContract(ctx, &types.QueryIbcComposabilityMwContractRequest{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, contractAddr, res.ContractAddress) +} diff --git a/wormchain/x/wormhole/keeper/grpc_query_latest_guardian_set_index_test.go b/wormchain/x/wormhole/keeper/grpc_query_latest_guardian_set_index_test.go new file mode 100644 index 0000000000..c58772143f --- /dev/null +++ b/wormchain/x/wormhole/keeper/grpc_query_latest_guardian_set_index_test.go @@ -0,0 +1,47 @@ +package keeper_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// TestLatestGuardianSetIndex tests the querying of the latest guardian set index. +func TestLatestGuardianSetIndex(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Invalid query with nil request + _, err := k.LatestGuardianSetIndex(ctx, nil) + require.Error(t, err) + + // Query the latest guardian set index - should be empty + res, err := k.LatestGuardianSetIndex(ctx, &types.QueryLatestGuardianSetIndexRequest{}) + require.NoError(t, err) + require.NotNil(t, res) + fmt.Println(res) + require.Equal(t, uint32(0xffffffff), res.LatestGuardianSetIndex) + + // Create guardian set + guardians, _ := createNGuardianValidator(k, ctx, 10) + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + ChainId: uint32(vaa.ChainIDWormchain), + GuardianSetExpiration: 86400, + }) + + createNewGuardianSet(k, ctx, guardians) + k.SetConsensusGuardianSetIndex(ctx, types.ConsensusGuardianSetIndex{ + Index: 0, + }) + + // Query the latest guardian set index - after population + res, err = k.LatestGuardianSetIndex(ctx, &types.QueryLatestGuardianSetIndexRequest{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, uint32(0), res.LatestGuardianSetIndex) +} diff --git a/wormchain/x/wormhole/keeper/grpc_query_wasm_instantiate_allowlist_test.go b/wormchain/x/wormhole/keeper/grpc_query_wasm_instantiate_allowlist_test.go new file mode 100644 index 0000000000..bd11bd2445 --- /dev/null +++ b/wormchain/x/wormhole/keeper/grpc_query_wasm_instantiate_allowlist_test.go @@ -0,0 +1,39 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestWasmInstantiateAllowlistAll tests the querying of the wasm instantiate allow list. +func TestWasmInstantiateAllowlistAll(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Query with nil request + _, err := k.WasmInstantiateAllowlistAll(ctx, nil) + require.Error(t, err) + + // Query with no contracts + res, err := k.WasmInstantiateAllowlistAll(ctx, &types.QueryAllWasmInstantiateAllowlist{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, 0, len(res.Allowlist)) + + // Set contract in allow list + contract := types.WasmInstantiateAllowedContractCodeId{ + ContractAddress: WormholeContractAddress1, + CodeId: 1, + } + k.SetWasmInstantiateAllowlist(ctx, contract) + + // Query all allow lists + res, err = k.WasmInstantiateAllowlistAll(ctx, &types.QueryAllWasmInstantiateAllowlist{}) + require.NoError(t, err) + require.NotNil(t, res) + require.Equal(t, 1, len(res.Allowlist)) + require.Equal(t, contract.ContractAddress, res.Allowlist[0].ContractAddress) + require.Equal(t, contract.CodeId, res.Allowlist[0].CodeId) +} diff --git a/wormchain/x/wormhole/keeper/ibc_composability_mw_test.go b/wormchain/x/wormhole/keeper/ibc_composability_mw_test.go new file mode 100644 index 0000000000..5856b3c4c7 --- /dev/null +++ b/wormchain/x/wormhole/keeper/ibc_composability_mw_test.go @@ -0,0 +1,29 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestIbcComposabilityMwContractStore tests the setting and getting of the contract. +func TestIbcComposabilityMwContractStore(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Get contract, should be nil + res := k.GetIbcComposabilityMwContract(ctx) + require.Equal(t, "", res.ContractAddress) + + // Set the contract + contract := types.IbcComposabilityMwContract{ + ContractAddress: "contractAddress", + } + k.StoreIbcComposabilityMwContract(ctx, contract) + + // Get contract from store + res = k.GetIbcComposabilityMwContract(ctx) + require.NotNil(t, res) + require.Equal(t, contract.ContractAddress, res.ContractAddress) +} diff --git a/wormchain/x/wormhole/keeper/keeper.go b/wormchain/x/wormhole/keeper/keeper.go index a3eb4652c1..eb56179ccd 100644 --- a/wormchain/x/wormhole/keeper/keeper.go +++ b/wormchain/x/wormhole/keeper/keeper.go @@ -3,9 +3,10 @@ package keeper import ( "fmt" - "github.com/tendermint/tendermint/libs/log" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" "github.com/wormhole-foundation/wormchain/x/wormhole/types" @@ -14,13 +15,15 @@ import ( type ( Keeper struct { cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey + storeKey storetypes.StoreKey + memKey storetypes.StoreKey accountKeeper types.AccountKeeper bankKeeper types.BankKeeper wasmdKeeper types.WasmdKeeper - upgradeKeeper upgradekeeper.Keeper + upgradeKeeper *upgradekeeper.Keeper + + authority string setWasmd bool setUpgrade bool @@ -30,16 +33,18 @@ type ( func NewKeeper( cdc codec.BinaryCodec, storeKey, - memKey sdk.StoreKey, - - accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + memKey storetypes.StoreKey, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, + authority string, ) *Keeper { return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - - accountKeeper: accountKeeper, bankKeeper: bankKeeper, + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + authority: authority, } } @@ -54,7 +59,7 @@ func (k *Keeper) SetWasmdKeeper(keeper types.WasmdKeeper) { k.setWasmd = true } -func (k *Keeper) SetUpgradeKeeper(keeper upgradekeeper.Keeper) { +func (k *Keeper) SetUpgradeKeeper(keeper *upgradekeeper.Keeper) { k.upgradeKeeper = keeper k.setUpgrade = true } diff --git a/wormchain/x/wormhole/keeper/msg_server_execute_gateway_governance_vaa_test.go b/wormchain/x/wormhole/keeper/msg_server_execute_gateway_governance_vaa_test.go new file mode 100644 index 0000000000..c64808e84b --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_execute_gateway_governance_vaa_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// TestExecuteGatewayGovernanceVaaUpgrades tests creating and cancelling upgrades. +func TestExecuteGatewayGovernanceVaaUpgrades(t *testing.T) { + _, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + // Create upgrade payload + payload, err := vaa.BodyGatewayScheduleUpgrade{ + Name: "v5.0.0", + Height: uint64(100), + }.Serialize() + require.NoError(t, err) + + // Generate VAA + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Submit upgrade governance VAA + res, err := msgServer.ExecuteGatewayGovernanceVaa(ctx, &types.MsgExecuteGatewayGovernanceVaa{ + Signer: signer.String(), + Vaa: vBz, + }) + require.NoError(t, err) + require.NotNil(t, res) + + // Create cancel upgrade payload + payload, err = vaa.EmptyPayloadVaa(vaa.GatewayModuleStr, vaa.ActionCancelUpgrade, vaa.ChainIDWormchain) + require.NoError(t, err) + + // Generate VAA + v = generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err = v.Marshal() + require.NoError(t, err) + + // Submit cancel upgrade governance VAA + res, err = msgServer.ExecuteGatewayGovernanceVaa(ctx, &types.MsgExecuteGatewayGovernanceVaa{ + Signer: signer.String(), + Vaa: vBz, + }) + require.NoError(t, err) + require.NotNil(t, res) +} + +// TestExecuteGatewayGovernanceVaaSetIbcComposabilityMwContract tests setting the IBC composability contract. +func TestExecuteGatewayGovernanceVaaSetIbcComposabilityMwContract(t *testing.T) { + k, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + // Get contract bytes + contractAddr := WormholeContractAddress1 + contractAddrBz, err := sdk.AccAddressFromBech32(contractAddr) + require.NoError(t, err) + + // Create payload + payload, err := vaa.BodyGatewayIbcComposabilityMwContract{ + ContractAddr: [32]byte(contractAddrBz), + }.Serialize() + require.NoError(t, err) + + // Generate VAA + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Submit governance VAA + res, err := msgServer.ExecuteGatewayGovernanceVaa(ctx, &types.MsgExecuteGatewayGovernanceVaa{ + Signer: signer.String(), + Vaa: vBz, + }) + require.NoError(t, err) + require.NotNil(t, res) + + // Validate the contract was set + contract := k.GetIbcComposabilityMwContract(ctx) + require.Equal(t, contractAddr, contract.ContractAddress) +} + +// TestExecuteGatewayGovernanceVaaUnknownAction tests submitting an unknown action. +func TestExecuteGatewayGovernanceVaaUnknownAction(t *testing.T) { + _, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + // Create payload + payload, err := vaa.EmptyPayloadVaa(vaa.GatewayModuleStr, vaa.GovernanceAction(100), vaa.ChainIDWormchain) + require.NoError(t, err) + + // Generate VAA + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Submit governance VAA + _, err = msgServer.ExecuteGatewayGovernanceVaa(ctx, &types.MsgExecuteGatewayGovernanceVaa{ + Signer: signer.String(), + Vaa: vBz, + }) + require.Error(t, err) +} + +// TestExecuteGatewayGovernanceVaaInvalidVAA tests submitting an invalid VAA. +func TestExecuteGatewayGovernanceVaaInvalidVAA(t *testing.T) { + _, ctx, msgServer, _, signer, guardianSet := setupWormholeMessageServer(t) + + // Create payload + payload, err := vaa.EmptyPayloadVaa(vaa.GatewayModuleStr, vaa.ActionCancelUpgrade, vaa.ChainIDWormchain) + require.NoError(t, err) + + // Generate VAA + v := generateVaa(guardianSet.Index, nil, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Submit governance VAA + _, err = msgServer.ExecuteGatewayGovernanceVaa(ctx, &types.MsgExecuteGatewayGovernanceVaa{ + Signer: signer.String(), + Vaa: vBz, + }) + require.Error(t, err) +} diff --git a/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal.go b/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal.go new file mode 100644 index 0000000000..5efe9e6dab --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "bytes" + "context" + "encoding/binary" + "fmt" + "io" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +func (k msgServer) GovernanceWormholeMessageProposal(goCtx context.Context, proposal *types.MsgGovernanceWormholeMessageProposal) (res *types.EmptyResponse, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Validate authority of the proposal + if k.authority != proposal.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, proposal.Authority) + } + + config, ok := k.GetConfig(ctx) + if !ok { + return res, types.ErrNoConfig + } + + // Post a wormhole governance message + message := &bytes.Buffer{} + message.Write(proposal.Module) + MustWrite(message, binary.BigEndian, uint8(proposal.Action)) + MustWrite(message, binary.BigEndian, uint16(proposal.TargetChain)) + message.Write(proposal.Payload) + + emitterAddress, err := types.EmitterAddressFromBytes32(config.GovernanceEmitter) + if err != nil { + return res, fmt.Errorf("failed to post message: %w", err) + } + + err = k.PostMessage(ctx, emitterAddress, 0, message.Bytes()) + if err != nil { + return res, fmt.Errorf("failed to post message: %w", err) + } + + return res, nil +} + +// MustWrite calls binary.Write and panics on errors +func MustWrite(w io.Writer, order binary.ByteOrder, data interface{}) { + if err := binary.Write(w, order, data); err != nil { + panic(fmt.Errorf("failed to write binary data: %v", data).Error()) + } +} diff --git a/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal_test.go b/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal_test.go new file mode 100644 index 0000000000..7b27b69fb4 --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_governance_wormhole_message_proposal_test.go @@ -0,0 +1,52 @@ +package keeper_test + +import ( + "testing" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// TestPostMessageProposal tests possible scenarios for how a governance wormhole message proposal can be handled. +func TestPostMessageProposal(t *testing.T) { + // get app & ctx + app, ctx := keepertest.SetupWormchainAndContext(t) + + // get keeper & msg server + k := app.WormholeKeeper + msgServer := keeper.NewMsgServerImpl(k) + + // create message + msg := &types.MsgGovernanceWormholeMessageProposal{ + Authority: "invalid-authority", + Action: 0, + Module: []byte{}, + TargetChain: 0, + Payload: []byte{}, + } + + // TEST: FAIL - invalid authority + _, err := msgServer.GovernanceWormholeMessageProposal(ctx, msg) + require.Error(t, err) + + // set valid authority + msg.Authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + + // TEST: FAIL - no configuration + _, err = msgServer.GovernanceWormholeMessageProposal(ctx, msg) + require.Error(t, err) + + // set config with valid emitter + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + }) + + // TEST: SUCCESS - valid authority & config + _, err = msgServer.GovernanceWormholeMessageProposal(ctx, msg) + require.NoError(t, err) +} diff --git a/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal.go b/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal.go new file mode 100644 index 0000000000..4dea3b7ff5 --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal.go @@ -0,0 +1,66 @@ +package keeper + +import ( + "bytes" + "context" + "encoding/binary" + "fmt" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// GuardianSetUpdateProposal updates the guardian set +func (k msgServer) GuardianSetUpdateProposal(goCtx context.Context, proposal *types.MsgGuardianSetUpdateProposal) (res *types.EmptyResponse, err error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Validate authority of the proposal + if k.authority != proposal.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, proposal.Authority) + } + + err = k.UpdateGuardianSet(ctx, types.GuardianSet{ + Index: proposal.NewGuardianSet.Index, + Keys: proposal.NewGuardianSet.Keys, + ExpirationTime: 0, + }) + + if err != nil { + return res, fmt.Errorf("failed to update guardian set: %w", err) + } + + config, ok := k.GetConfig(ctx) + if !ok { + return res, types.ErrNoConfig + } + + // Post a wormhole guardian set update governance message + message := &bytes.Buffer{} + + // Header + message.Write(vaa.CoreModule) + MustWrite(message, binary.BigEndian, uint8(2)) + MustWrite(message, binary.BigEndian, uint16(0)) + + // Body + MustWrite(message, binary.BigEndian, proposal.NewGuardianSet.Index) + MustWrite(message, binary.BigEndian, uint8(len(proposal.NewGuardianSet.Keys))) + for _, key := range proposal.NewGuardianSet.Keys { + message.Write(key) + } + + emitterAddress, err := types.EmitterAddressFromBytes32(config.GovernanceEmitter) + if err != nil { + return res, fmt.Errorf("failed to post message: %w", err) + } + + err = k.PostMessage(ctx, emitterAddress, 0, message.Bytes()) + if err != nil { + return res, fmt.Errorf("failed to post message: %w", err) + } + + return res, nil +} diff --git a/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal_test.go b/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal_test.go new file mode 100644 index 0000000000..49b9e8ef3f --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_guardian_set_update_proposal_test.go @@ -0,0 +1,79 @@ +package keeper_test + +import ( + "testing" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +// TestGuardianSetUpdateProposal tests possible scenarios for how a guardian set update proposal can be handled. +func TestGuardianSetUpdateProposal(t *testing.T) { + // get app & ctx + app, ctx := keepertest.SetupWormchainAndContext(t) + + // get keeper & msg server + k := app.WormholeKeeper + msgServer := keeper.NewMsgServerImpl(k) + + // create message + msg := &types.MsgGuardianSetUpdateProposal{ + Authority: "invalid-authority", + NewGuardianSet: types.GuardianSet{Index: 1}, + } + + // TEST: FAIL - invalid authority + _, err := msgServer.GuardianSetUpdateProposal(ctx, msg) + require.Error(t, err) + + // set valid authority + msg.Authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + + // TEST: FAIL - no configuration + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.Error(t, err) + + // set valid configuration + k.SetConfig(ctx, types.Config{ + ChainId: uint32(vaa.ChainIDWormchain), + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + }) + + // TEST: FAIL - guardian set not found + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.Error(t, err) + + // init keep with first guardian set + _, err = k.AppendGuardianSet(ctx, types.GuardianSet{Index: 0}) + require.NoError(t, err) + + // TEST: SUCCESS - guardian set updated to Index=1 + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.NoError(t, err) + + // TEST: FAIL - guardian set not sequential (index should be 2) + msg.NewGuardianSet.Index = 3 + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.Error(t, err) + msg.NewGuardianSet.Index = 2 + + // TEST: SUCCESS - keeper overrides expiration to 0, so the set will never expire + msg.NewGuardianSet.ExpirationTime = 1 + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.NoError(t, err) + + // TEST: FAIL - invalid governance emitter + k.SetConfig(ctx, types.Config{ + ChainId: uint32(vaa.ChainIDWormchain), + GovernanceEmitter: []byte("invalid-emitter"), + GovernanceChain: uint32(vaa.GovernanceChain), + }) + _, err = msgServer.GuardianSetUpdateProposal(ctx, msg) + require.Error(t, err) +} diff --git a/wormchain/x/wormhole/keeper/msg_server_test.go b/wormchain/x/wormhole/keeper/msg_server_test.go deleted file mode 100644 index 09fe3287d4..0000000000 --- a/wormchain/x/wormhole/keeper/msg_server_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper_test - -import ( - "context" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" - "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" - "github.com/wormhole-foundation/wormchain/x/wormhole/types" -) - -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.WormholeKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -} diff --git a/wormchain/x/wormhole/keeper/msg_server_wasm_instantiate_allowlist_test.go b/wormchain/x/wormhole/keeper/msg_server_wasm_instantiate_allowlist_test.go new file mode 100644 index 0000000000..8fb1c5ca21 --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_wasm_instantiate_allowlist_test.go @@ -0,0 +1,231 @@ +package keeper_test + +import ( + "crypto/ecdsa" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +const ( + WormholeContractAddress1 = "wormhole1466nf3zuxpya8q9emxukd7vftaf6h4psr0a07srl5zw74zh84yjq4lyjmh" + WormholeContractAddress2 = "wormhole1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3svg697z" +) + +// setupWormholeMessageServer creates a keeper, context, msg server, private keys, signer, and guardian set for +// testing the wasm allowlist msg server. +func setupWormholeMessageServer(t *testing.T) (keeper.Keeper, sdk.Context, types.MsgServer, []*ecdsa.PrivateKey, sdk.AccAddress, *types.GuardianSet) { + k, ctx := keepertest.WormholeKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) + + guardians, privateKeys := createNGuardianValidator(k, ctx, 10) + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + ChainId: uint32(vaa.ChainIDWormchain), + GuardianSetExpiration: 86400, + }) + signer_bz := [20]byte{} + signer := sdk.AccAddress(signer_bz[:]) + + guardianSet := createNewGuardianSet(k, ctx, guardians) + k.SetConsensusGuardianSetIndex(ctx, types.ConsensusGuardianSetIndex{Index: guardianSet.Index}) + + return *k, ctx, msgServer, privateKeys, signer, guardianSet +} + +// TestWasmAllowlistMsgServer tests the endpoints of the wasm allowlist msg server (happy path). +func TestWasmAllowlistMsgServer(t *testing.T) { + k, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + bech32ContractAddr := WormholeContractAddress1 + + codeId := uint64(1) + contractAddr, err := sdk.AccAddressFromBech32(bech32ContractAddr) + require.NoError(t, err) + + // copy bytes to 32 byte array + contractAddrBytes := [32]byte{} + copy(contractAddrBytes[:], contractAddr.Bytes()) + + // Create payload for the wasm instantiate allow list + payload, err := vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: codeId, + ContractAddr: contractAddrBytes, + }.Serialize(vaa.ActionAddWasmInstantiateAllowlist) + require.NoError(t, err) + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Send msg to add wasm instantiate allow list + _, err = msgServer.AddWasmInstantiateAllowlist(ctx, &types.MsgAddWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.NoError(t, err) + + // Query the allowlist + res := k.GetAllWasmInstiateAllowedAddresses(ctx) + require.Len(t, res, 1) + require.Equal(t, bech32ContractAddr, res[0].ContractAddress) + require.Equal(t, codeId, res[0].CodeId) + + // Re-generate vaa for delete wasm instantiate allow list + payload, err = vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: codeId, + ContractAddr: contractAddrBytes, + }.Serialize(vaa.ActionDeleteWasmInstantiateAllowlist) + require.NoError(t, err) + v = generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err = v.Marshal() + require.NoError(t, err) + + // Send msg to delete wasm instantiate allow list + _, err = msgServer.DeleteWasmInstantiateAllowlist(ctx, &types.MsgDeleteWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.NoError(t, err) + + // Query the allowlist + res = k.GetAllWasmInstiateAllowedAddresses(ctx) + require.Len(t, res, 0) +} + +// TestWasmAllowlistMsgServerMismatchedCodeId tests the endpoints of the wasm allowlist msg server +// with mismatched code id. +func TestWasmAllowlistMsgServerMismatchedCodeId(t *testing.T) { + _, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + bech32ContractAddr := WormholeContractAddress1 + codeId := uint64(1) + + contractAddr, err := sdk.AccAddressFromBech32(bech32ContractAddr) + require.NoError(t, err) + + // copy bytes to 32 byte array + contractAddrBytes := [32]byte{} + copy(contractAddrBytes[:], contractAddr.Bytes()) + + // Create payload with mismatched code id + payload, err := vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: uint64(2), + ContractAddr: contractAddrBytes, + }.Serialize(vaa.ActionAddWasmInstantiateAllowlist) + require.NoError(t, err) + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Send msg to add wasm instantiate allow list + _, err = msgServer.AddWasmInstantiateAllowlist(ctx, &types.MsgAddWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.Error(t, err) +} + +// TestWasmAllowlistMsgServerMismatchedContractAddr tests the endpoints of the wasm allowlist msg server +// with mismatched contract addresses. +func TestWasmAllowlistMsgServerMismatchedContractAddr(t *testing.T) { + _, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + bech32ContractAddr := WormholeContractAddress1 + codeId := uint64(1) + + contractAddr2, err := sdk.AccAddressFromBech32(WormholeContractAddress2) + require.NoError(t, err) + + // Create payload with mismatched contract address + payload, err := vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: codeId, + ContractAddr: [32]byte(contractAddr2), + }.Serialize(vaa.ActionAddWasmInstantiateAllowlist) + require.NoError(t, err) + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Send msg to add wasm instantiate allow list + _, err = msgServer.AddWasmInstantiateAllowlist(ctx, &types.MsgAddWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.Error(t, err) +} + +// TestWasmAllowlistMsgServerMismatchedVaaAction tests the endpoints of the wasm allowlist msg server +// with mismatched vaa action. +func TestWasmAllowlistMsgServerMismatchedVaaAction(t *testing.T) { + _, ctx, msgServer, privateKeys, signer, guardianSet := setupWormholeMessageServer(t) + + bech32ContractAddr := WormholeContractAddress1 + codeId := uint64(1) + + contractAddr, err := sdk.AccAddressFromBech32(bech32ContractAddr) + require.NoError(t, err) + + // Create payload with mismatched contract address + payload, err := vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: codeId, + ContractAddr: [32]byte(contractAddr), + }.Serialize(vaa.ActionAddWasmInstantiateAllowlist) + require.NoError(t, err) + v := generateVaa(guardianSet.Index, privateKeys, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Send mismatched action + _, err = msgServer.DeleteWasmInstantiateAllowlist(ctx, &types.MsgDeleteWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.Error(t, err) +} + +// TestWasmAllowlistMsgServerInvalidVAA tests the endpoints of the wasm allowlist msg server +// with invalid vaa. +func TestWasmAllowlistMsgServerInvalidVAA(t *testing.T) { + _, ctx, msgServer, _, signer, guardianSet := setupWormholeMessageServer(t) + + bech32ContractAddr := WormholeContractAddress1 + codeId := uint64(1) + + contractAddr, err := sdk.AccAddressFromBech32(bech32ContractAddr) + require.NoError(t, err) + + // Create payload with mismatched contract address + payload, err := vaa.BodyWormchainWasmAllowlistInstantiate{ + CodeId: codeId, + ContractAddr: [32]byte(contractAddr), + }.Serialize(vaa.ActionAddWasmInstantiateAllowlist) + require.NoError(t, err) + v := generateVaa(guardianSet.Index, nil, vaa.ChainID(vaa.GovernanceChain), payload) + vBz, err := v.Marshal() + require.NoError(t, err) + + // Send mismatched action + _, err = msgServer.DeleteWasmInstantiateAllowlist(ctx, &types.MsgDeleteWasmInstantiateAllowlist{ + Signer: signer.String(), + Address: bech32ContractAddr, + CodeId: codeId, + Vaa: vBz, + }) + require.Error(t, err) +} diff --git a/wormchain/x/wormhole/keeper/wasm_instantiate_allowlist_test.go b/wormchain/x/wormhole/keeper/wasm_instantiate_allowlist_test.go new file mode 100644 index 0000000000..d3f9ac3153 --- /dev/null +++ b/wormchain/x/wormhole/keeper/wasm_instantiate_allowlist_test.go @@ -0,0 +1,44 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// TestWasmInstantiateAllowlist tests the setting, getting, and removing of allowed addresses. +func TestWasmInstantiateAllowlist(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + + // Create entry + entry := types.WasmInstantiateAllowedContractCodeId{ + ContractAddress: WormholeContractAddress1, + CodeId: 1, + } + + // Add contract to allow list + k.SetWasmInstantiateAllowlist(ctx, entry) + + // Check if address exists + hasAddr := k.HasWasmInstantiateAllowlist(ctx, entry.ContractAddress, entry.CodeId) + require.True(t, hasAddr) + + // Check faulty address - does not exist + hasAddr = k.HasWasmInstantiateAllowlist(ctx, "invalid", 0) + require.False(t, hasAddr) + + // Get all allowed addresses + addrList := k.GetAllWasmInstiateAllowedAddresses(ctx) + require.Equal(t, 1, len(addrList)) + require.Equal(t, entry.ContractAddress, addrList[0].ContractAddress) + require.Equal(t, entry.CodeId, addrList[0].CodeId) + + // Remove address + k.KeeperDeleteWasmInstantiateAllowlist(ctx, entry) + + // Check if address exists + hasAddr = k.HasWasmInstantiateAllowlist(ctx, entry.ContractAddress, entry.CodeId) + require.False(t, hasAddr) +} diff --git a/wormchain/x/wormhole/module.go b/wormchain/x/wormhole/module.go index 695476da52..dd3ff6e830 100644 --- a/wormchain/x/wormhole/module.go +++ b/wormchain/x/wormhole/module.go @@ -9,7 +9,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -113,22 +113,10 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} - -// QuerierRoute returns the capability module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns the capability module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/wormchain/x/wormhole/module_simulation.go b/wormchain/x/wormhole/module_simulation.go index a7fef42afa..3c5ef8e01e 100644 --- a/wormchain/x/wormhole/module_simulation.go +++ b/wormchain/x/wormhole/module_simulation.go @@ -4,7 +4,6 @@ import ( "math/rand" "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -18,7 +17,6 @@ import ( var ( _ = sample.AccAddress _ = wormholesimulation.FindAccount - _ = simappparams.StakePerAccount _ = simulation.MsgEntryKind _ = baseapp.Paramspace ) @@ -44,16 +42,10 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { return nil } -// RandomizedParams creates randomized param changes for the simulator -func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - - return []simtypes.ParamChange{} -} - // RegisterStoreDecoder registers a decoder func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} diff --git a/wormchain/x/wormhole/types/codec.go b/wormchain/x/wormhole/types/codec.go index c245d4e081..7de018c72e 100644 --- a/wormchain/x/wormhole/types/codec.go +++ b/wormchain/x/wormhole/types/codec.go @@ -5,7 +5,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" ) func RegisterCodec(cdc *codec.LegacyAmino) { @@ -19,6 +18,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddWasmInstantiateAllowlist{}, "wormhole/AddWasmInstantiateAllowlist", nil) cdc.RegisterConcrete(&MsgDeleteWasmInstantiateAllowlist{}, "wormhole/DeleteWasmInstantiateAllowlist", nil) cdc.RegisterConcrete(&MsgExecuteGatewayGovernanceVaa{}, "wormhole/ExecuteGatewayGovernanceVaa", nil) + cdc.RegisterConcrete(&MsgGuardianSetUpdateProposal{}, "wormhole/GuardianSetUpdateProposal", nil) + cdc.RegisterConcrete(&MsgGovernanceWormholeMessageProposal{}, "wormhole/GovernanceWormholeMessageProposal", nil) // this line is used by starport scaffolding # 2 } @@ -31,11 +32,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgCreateAllowlistEntryRequest{}, &MsgDeleteAllowlistEntryRequest{}, &MsgExecuteGatewayGovernanceVaa{}, - ) - registry.RegisterImplementations((*gov.Content)(nil), - &GovernanceWormholeMessageProposal{}, - &GuardianSetUpdateProposal{}) - registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgGovernanceWormholeMessageProposal{}, + &MsgGuardianSetUpdateProposal{}, &MsgRegisterAccountAsGuardian{}, ) // this line is used by starport scaffolding # 3 diff --git a/wormchain/x/wormhole/types/config.pb.go b/wormchain/x/wormhole/types/config.pb.go index 1d4b6782b0..15335fa055 100644 --- a/wormchain/x/wormhole/types/config.pb.go +++ b/wormchain/x/wormhole/types/config.pb.go @@ -1,12 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/config.proto +// source: wormchain/wormhole/config.proto package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -34,7 +33,7 @@ func (m *Config) Reset() { *m = Config{} } func (m *Config) String() string { return proto.CompactTextString(m) } func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { - return fileDescriptor_14d08d38823c924a, []int{0} + return fileDescriptor_99c2f24f047c3bc2, []int{0} } func (m *Config) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -92,30 +91,29 @@ func (m *Config) GetChainId() uint32 { } func init() { - proto.RegisterType((*Config)(nil), "wormhole_foundation.wormchain.wormhole.Config") + proto.RegisterType((*Config)(nil), "wormchain.wormhole.Config") } -func init() { proto.RegisterFile("wormhole/config.proto", fileDescriptor_14d08d38823c924a) } +func init() { proto.RegisterFile("wormchain/wormhole/config.proto", fileDescriptor_99c2f24f047c3bc2) } -var fileDescriptor_14d08d38823c924a = []byte{ - // 272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x52, 0x83, 0x09, 0xc7, 0xa7, 0xe5, 0x97, 0xe6, 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, - 0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90, 0xac, 0x94, 0x48, 0x7a, 0x7e, 0x7a, - 0x3e, 0x58, 0x8b, 0x3e, 0x88, 0x05, 0xd1, 0xad, 0xb4, 0x95, 0x91, 0x8b, 0xcd, 0x19, 0x6c, 0x9c, - 0x90, 0x19, 0x97, 0x78, 0x7a, 0x69, 0x62, 0x51, 0x4a, 0x66, 0x62, 0x5e, 0x7c, 0x71, 0x6a, 0x49, - 0x7c, 0x6a, 0x45, 0x41, 0x66, 0x11, 0xd8, 0x38, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x51, - 0x98, 0x74, 0x70, 0x6a, 0x89, 0x2b, 0x5c, 0x52, 0x48, 0x97, 0x4b, 0x28, 0x3d, 0xbf, 0x2c, 0xb5, - 0x28, 0x2f, 0x31, 0x2f, 0x39, 0x35, 0x3e, 0x35, 0x37, 0xb3, 0xa4, 0x24, 0xb5, 0x48, 0x82, 0x49, - 0x81, 0x51, 0x83, 0x27, 0x48, 0x10, 0x21, 0xe3, 0x0a, 0x91, 0x10, 0xd2, 0xe4, 0x12, 0x40, 0x52, - 0x0e, 0x76, 0xa4, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x6f, 0x10, 0x3f, 0x42, 0xdc, 0x19, 0x24, 0x2c, - 0x24, 0xc9, 0xc5, 0x01, 0x96, 0x8f, 0xcf, 0x4c, 0x91, 0x60, 0x01, 0x2b, 0x61, 0x07, 0xf3, 0x3d, - 0x53, 0x9c, 0x82, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, - 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 0x3d, - 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe6, 0x79, 0x5d, 0x44, 0xd0, 0xe8, - 0xc3, 0x83, 0x46, 0xbf, 0x02, 0x2e, 0xaf, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, - 0x13, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xda, 0x45, 0x4d, 0x6a, 0x01, 0x00, 0x00, +var fileDescriptor_99c2f24f047c3bc2 = []byte{ + // 253 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xcf, 0x2f, 0xca, + 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x07, 0xb1, 0x32, 0xf2, 0x73, 0x52, 0xf5, 0x93, 0xf3, 0xf3, + 0xd2, 0x32, 0xd3, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0xe0, 0x0a, 0xf4, 0x60, 0x0a, + 0x94, 0xb6, 0x32, 0x72, 0xb1, 0x39, 0x83, 0x15, 0x09, 0x99, 0x71, 0x89, 0xa7, 0x97, 0x26, 0x16, + 0xa5, 0x64, 0x26, 0xe6, 0xc5, 0x17, 0xa7, 0x96, 0xc4, 0xa7, 0x56, 0x14, 0x64, 0x16, 0x25, 0x96, + 0x64, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0x89, 0xc2, 0xa4, 0x83, 0x53, 0x4b, + 0x5c, 0xe1, 0x92, 0x42, 0xba, 0x5c, 0x42, 0xe9, 0xf9, 0x65, 0xa9, 0x45, 0x79, 0x89, 0x79, 0xc9, + 0xa9, 0xf1, 0xa9, 0xb9, 0x99, 0x25, 0x25, 0xa9, 0x45, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, + 0x82, 0x08, 0x19, 0x57, 0x88, 0x84, 0x90, 0x26, 0x97, 0x00, 0x92, 0x72, 0xb0, 0x73, 0x24, 0x98, + 0x15, 0x18, 0x35, 0x78, 0x83, 0xf8, 0x11, 0xe2, 0xce, 0x20, 0x61, 0x21, 0x49, 0x2e, 0x0e, 0xb0, + 0x7c, 0x7c, 0x66, 0x8a, 0x04, 0x0b, 0x58, 0x09, 0x3b, 0x98, 0xef, 0x99, 0xe2, 0x14, 0x7c, 0xe2, + 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, + 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, + 0x7a, 0xc9, 0xf9, 0xb9, 0xf0, 0x70, 0xd0, 0x4d, 0xcb, 0x2f, 0xcd, 0x4b, 0x01, 0x3b, 0x57, 0x1f, + 0x11, 0x4a, 0x15, 0x88, 0x70, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0x93, 0x31, + 0x20, 0x00, 0x00, 0xff, 0xff, 0x80, 0xe9, 0x11, 0x88, 0x4a, 0x01, 0x00, 0x00, } func (m *Config) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/consensus_guardian_set_index.pb.go b/wormchain/x/wormhole/types/consensus_guardian_set_index.pb.go index 45cea547fd..ffd8d29835 100644 --- a/wormchain/x/wormhole/types/consensus_guardian_set_index.pb.go +++ b/wormchain/x/wormhole/types/consensus_guardian_set_index.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/consensus_guardian_set_index.proto +// source: wormchain/wormhole/consensus_guardian_set_index.proto package types import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -30,7 +30,7 @@ func (m *ConsensusGuardianSetIndex) Reset() { *m = ConsensusGuardianSetI func (m *ConsensusGuardianSetIndex) String() string { return proto.CompactTextString(m) } func (*ConsensusGuardianSetIndex) ProtoMessage() {} func (*ConsensusGuardianSetIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_18e45d0c16ad5fce, []int{0} + return fileDescriptor_e22fcf1d43fbef01, []int{0} } func (m *ConsensusGuardianSetIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -67,27 +67,27 @@ func (m *ConsensusGuardianSetIndex) GetIndex() uint32 { } func init() { - proto.RegisterType((*ConsensusGuardianSetIndex)(nil), "wormhole_foundation.wormchain.wormhole.ConsensusGuardianSetIndex") + proto.RegisterType((*ConsensusGuardianSetIndex)(nil), "wormchain.wormhole.ConsensusGuardianSetIndex") } func init() { - proto.RegisterFile("wormhole/consensus_guardian_set_index.proto", fileDescriptor_18e45d0c16ad5fce) + proto.RegisterFile("wormchain/wormhole/consensus_guardian_set_index.proto", fileDescriptor_e22fcf1d43fbef01) } -var fileDescriptor_18e45d0c16ad5fce = []byte{ - // 190 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x4f, - 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4e, 0x2d, 0x89, 0xcf, 0xcc, 0x4b, 0x49, - 0xad, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x29, 0x8e, 0x4f, 0xcb, 0x2f, 0xcd, - 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25, 0x67, 0x24, 0x66, 0x42, 0x58, 0x20, - 0x59, 0x25, 0x43, 0x2e, 0x49, 0x67, 0x98, 0x69, 0xee, 0x50, 0xc3, 0x82, 0x53, 0x4b, 0x3c, 0x41, - 0x46, 0x09, 0x89, 0x70, 0xb1, 0x82, 0xcd, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0d, 0x82, 0x70, - 0x9c, 0x82, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, - 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x66, 0x83, 0x2e, 0xc2, 0x7e, 0x7d, 0xb8, - 0xfd, 0xfa, 0x15, 0x70, 0x79, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb3, 0x8d, - 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x7c, 0x1c, 0x4e, 0xe5, 0x00, 0x00, 0x00, +var fileDescriptor_e22fcf1d43fbef01 = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x2d, 0xcf, 0x2f, 0xca, + 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x07, 0xb1, 0x32, 0xf2, 0x73, 0x52, 0xf5, 0x93, 0xf3, 0xf3, + 0x8a, 0x53, 0xf3, 0x8a, 0x4b, 0x8b, 0xe3, 0xd3, 0x4b, 0x13, 0x8b, 0x52, 0x32, 0x13, 0xf3, 0xe2, + 0x8b, 0x53, 0x4b, 0xe2, 0x33, 0xf3, 0x52, 0x52, 0x2b, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, + 0x84, 0xe0, 0xda, 0xf4, 0x60, 0xda, 0x94, 0x0c, 0xb9, 0x24, 0x9d, 0x61, 0x3a, 0xdd, 0xa1, 0x1a, + 0x83, 0x53, 0x4b, 0x3c, 0x41, 0xda, 0x84, 0x44, 0xb8, 0x58, 0xc1, 0xfa, 0x25, 0x18, 0x15, 0x18, + 0x35, 0x78, 0x83, 0x20, 0x1c, 0xa7, 0xe0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, + 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, + 0x88, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0x85, 0x3b, 0x4c, 0x37, + 0x2d, 0xbf, 0x34, 0x2f, 0x25, 0xb1, 0x24, 0x33, 0x1f, 0xe2, 0x58, 0x88, 0xb3, 0x2b, 0x10, 0x0e, + 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x3b, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x91, 0x86, 0xa3, 0x96, 0xdb, 0x00, 0x00, 0x00, } func (m *ConsensusGuardianSetIndex) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/events.pb.go b/wormchain/x/wormhole/types/events.pb.go index 567a8f531b..302ebc430c 100644 --- a/wormchain/x/wormhole/types/events.pb.go +++ b/wormchain/x/wormhole/types/events.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/events.proto +// source: wormchain/wormhole/events.proto package types import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -31,7 +31,7 @@ func (m *EventGuardianSetUpdate) Reset() { *m = EventGuardianSetUpdate{} func (m *EventGuardianSetUpdate) String() string { return proto.CompactTextString(m) } func (*EventGuardianSetUpdate) ProtoMessage() {} func (*EventGuardianSetUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_486bfc4df1202b88, []int{0} + return fileDescriptor_39522d4efd6a7475, []int{0} } func (m *EventGuardianSetUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +86,7 @@ func (m *EventPostedMessage) Reset() { *m = EventPostedMessage{} } func (m *EventPostedMessage) String() string { return proto.CompactTextString(m) } func (*EventPostedMessage) ProtoMessage() {} func (*EventPostedMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_486bfc4df1202b88, []int{1} + return fileDescriptor_39522d4efd6a7475, []int{1} } func (m *EventPostedMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -159,7 +159,7 @@ func (m *EventGuardianRegistered) Reset() { *m = EventGuardianRegistered func (m *EventGuardianRegistered) String() string { return proto.CompactTextString(m) } func (*EventGuardianRegistered) ProtoMessage() {} func (*EventGuardianRegistered) Descriptor() ([]byte, []int) { - return fileDescriptor_486bfc4df1202b88, []int{2} + return fileDescriptor_39522d4efd6a7475, []int{2} } func (m *EventGuardianRegistered) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,7 +211,7 @@ func (m *EventConsensusSetUpdate) Reset() { *m = EventConsensusSetUpdate func (m *EventConsensusSetUpdate) String() string { return proto.CompactTextString(m) } func (*EventConsensusSetUpdate) ProtoMessage() {} func (*EventConsensusSetUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_486bfc4df1202b88, []int{3} + return fileDescriptor_39522d4efd6a7475, []int{3} } func (m *EventConsensusSetUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -255,39 +255,38 @@ func (m *EventConsensusSetUpdate) GetNewIndex() uint32 { } func init() { - proto.RegisterType((*EventGuardianSetUpdate)(nil), "wormhole_foundation.wormchain.wormhole.EventGuardianSetUpdate") - proto.RegisterType((*EventPostedMessage)(nil), "wormhole_foundation.wormchain.wormhole.EventPostedMessage") - proto.RegisterType((*EventGuardianRegistered)(nil), "wormhole_foundation.wormchain.wormhole.EventGuardianRegistered") - proto.RegisterType((*EventConsensusSetUpdate)(nil), "wormhole_foundation.wormchain.wormhole.EventConsensusSetUpdate") + proto.RegisterType((*EventGuardianSetUpdate)(nil), "wormchain.wormhole.EventGuardianSetUpdate") + proto.RegisterType((*EventPostedMessage)(nil), "wormchain.wormhole.EventPostedMessage") + proto.RegisterType((*EventGuardianRegistered)(nil), "wormchain.wormhole.EventGuardianRegistered") + proto.RegisterType((*EventConsensusSetUpdate)(nil), "wormchain.wormhole.EventConsensusSetUpdate") } -func init() { proto.RegisterFile("wormhole/events.proto", fileDescriptor_486bfc4df1202b88) } +func init() { proto.RegisterFile("wormchain/wormhole/events.proto", fileDescriptor_39522d4efd6a7475) } -var fileDescriptor_486bfc4df1202b88 = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbf, 0x4e, 0xc3, 0x30, - 0x10, 0xc6, 0x9b, 0xd2, 0x42, 0x31, 0xed, 0x62, 0xf1, 0x27, 0x02, 0x29, 0x82, 0x20, 0x21, 0x16, - 0x9a, 0x81, 0x89, 0x15, 0x84, 0x10, 0xaa, 0x90, 0x50, 0x2a, 0x16, 0x96, 0xca, 0xad, 0x8f, 0xd4, - 0x22, 0xf1, 0x85, 0xd8, 0x69, 0x9b, 0x97, 0x40, 0x3c, 0x16, 0x63, 0x47, 0x46, 0xd4, 0xbe, 0x08, - 0x8a, 0xf3, 0x07, 0xb1, 0xb3, 0xdd, 0xf7, 0xfd, 0x2e, 0xdf, 0xc5, 0x3e, 0x93, 0xbd, 0x39, 0x26, - 0xd1, 0x14, 0x43, 0xf0, 0x60, 0x06, 0x52, 0xab, 0x7e, 0x9c, 0xa0, 0x46, 0x7a, 0x56, 0xd9, 0xa3, - 0x17, 0x4c, 0x25, 0x67, 0x5a, 0xa0, 0xec, 0xe7, 0xde, 0x64, 0xca, 0x44, 0x51, 0xe5, 0xd4, 0xf5, - 0xc9, 0xfe, 0x6d, 0xfe, 0xdd, 0x5d, 0xca, 0x12, 0x2e, 0x98, 0x1c, 0x82, 0x7e, 0x8a, 0x39, 0xd3, - 0x40, 0x8f, 0xc8, 0x36, 0x86, 0x7c, 0x24, 0x24, 0x87, 0x85, 0x6d, 0x1d, 0x5b, 0xe7, 0x3d, 0xbf, - 0x83, 0x21, 0xbf, 0xcf, 0x75, 0x0e, 0x25, 0xcc, 0x4b, 0xd8, 0x2c, 0xa0, 0x84, 0xb9, 0x81, 0xee, - 0xbb, 0x45, 0xa8, 0x09, 0x7d, 0x44, 0xa5, 0x81, 0x3f, 0x80, 0x52, 0x2c, 0x00, 0x6a, 0x93, 0x2d, - 0x88, 0x84, 0xd6, 0x90, 0x98, 0xb8, 0xae, 0x5f, 0x49, 0x7a, 0x48, 0x3a, 0x0a, 0xde, 0x52, 0x90, - 0x13, 0x30, 0x61, 0x2d, 0xbf, 0xd6, 0x74, 0x97, 0xb4, 0x25, 0xe6, 0x60, 0xc3, 0x4c, 0x29, 0x04, - 0xa5, 0xa4, 0xa5, 0x45, 0x04, 0x76, 0xcb, 0x74, 0x9b, 0x3a, 0xcf, 0x8f, 0x59, 0x16, 0x22, 0xe3, - 0x76, 0xbb, 0xc8, 0x2f, 0xa5, 0xcb, 0xc8, 0xc1, 0x9f, 0x43, 0xfa, 0x10, 0x08, 0xa5, 0x21, 0x01, - 0x4e, 0x4f, 0x48, 0x37, 0x28, 0xdd, 0xd1, 0x2b, 0x64, 0xe5, 0x9f, 0xed, 0x54, 0xde, 0x00, 0x32, - 0x7a, 0x4a, 0x7a, 0x33, 0x16, 0x0a, 0xce, 0x34, 0x26, 0xa6, 0xa7, 0x69, 0x7a, 0xba, 0xb5, 0x39, - 0x80, 0xcc, 0x1d, 0x96, 0x23, 0x6e, 0x50, 0x2a, 0x90, 0x2a, 0x55, 0xff, 0x70, 0x91, 0xd7, 0xc3, - 0xcf, 0x95, 0x63, 0x2d, 0x57, 0x8e, 0xf5, 0xbd, 0x72, 0xac, 0x8f, 0xb5, 0xd3, 0x58, 0xae, 0x9d, - 0xc6, 0xd7, 0xda, 0x69, 0x3c, 0x5f, 0x05, 0x42, 0x4f, 0xd3, 0x71, 0x7f, 0x82, 0x91, 0x57, 0xed, - 0xf2, 0xe2, 0x77, 0xd3, 0x5e, 0xbd, 0x69, 0x6f, 0x51, 0x73, 0x4f, 0x67, 0x31, 0xa8, 0xf1, 0xa6, - 0x79, 0x20, 0x97, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xe4, 0xc3, 0xee, 0x39, 0x02, 0x00, - 0x00, +var fileDescriptor_39522d4efd6a7475 = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xbd, 0x4e, 0xe3, 0x40, + 0x10, 0x8e, 0x73, 0xc9, 0x5d, 0x6e, 0x2f, 0x69, 0x56, 0x27, 0xb0, 0x40, 0x32, 0x60, 0x1a, 0x1a, + 0x92, 0x82, 0x8a, 0x16, 0x84, 0x10, 0x8a, 0x90, 0x90, 0x23, 0x1a, 0x9a, 0x68, 0x93, 0x1d, 0x9c, + 0x15, 0xf6, 0x8e, 0xf1, 0x8e, 0x93, 0xf8, 0x25, 0x10, 0x8f, 0x45, 0x99, 0x92, 0x12, 0x25, 0x2f, + 0x82, 0xbc, 0x76, 0x8c, 0xe8, 0xe9, 0xe6, 0xfb, 0xd1, 0x37, 0xfb, 0xf3, 0xb1, 0x83, 0x05, 0xa6, + 0xf1, 0x74, 0x26, 0x94, 0x1e, 0x14, 0xd3, 0x0c, 0x23, 0x18, 0xc0, 0x1c, 0x34, 0x99, 0x7e, 0x92, + 0x22, 0x21, 0xe7, 0xb5, 0xa1, 0xbf, 0x35, 0xf8, 0x01, 0xdb, 0xb9, 0x2a, 0x3c, 0xd7, 0x99, 0x48, + 0xa5, 0x12, 0x7a, 0x04, 0x74, 0x9f, 0x48, 0x41, 0xc0, 0xf7, 0xd9, 0x5f, 0x8c, 0xe4, 0x58, 0x69, + 0x09, 0x4b, 0xd7, 0x39, 0x74, 0x4e, 0x7a, 0x41, 0x07, 0x23, 0x79, 0x53, 0xe0, 0x42, 0xd4, 0xb0, + 0xa8, 0xc4, 0x66, 0x29, 0x6a, 0x58, 0x58, 0xd1, 0x7f, 0x71, 0x18, 0xb7, 0xa1, 0x77, 0x68, 0x08, + 0xe4, 0x2d, 0x18, 0x23, 0x42, 0xe0, 0x2e, 0xfb, 0x03, 0xb1, 0x22, 0x82, 0xd4, 0xc6, 0x75, 0x83, + 0x2d, 0xe4, 0x7b, 0xac, 0x63, 0xe0, 0x39, 0x03, 0x3d, 0x05, 0x1b, 0xd6, 0x0a, 0x6a, 0xcc, 0xff, + 0xb3, 0xb6, 0xc6, 0x42, 0xf8, 0x65, 0xb7, 0x94, 0x80, 0x73, 0xd6, 0x22, 0x15, 0x83, 0xdb, 0xb2, + 0x6e, 0x3b, 0x17, 0xf9, 0x89, 0xc8, 0x23, 0x14, 0xd2, 0x6d, 0x97, 0xf9, 0x15, 0xf4, 0x05, 0xdb, + 0xfd, 0x76, 0xc9, 0x00, 0x42, 0x65, 0x08, 0x52, 0x90, 0xfc, 0x88, 0x75, 0xc3, 0x8a, 0x1d, 0x3f, + 0x41, 0x5e, 0x9d, 0xec, 0xdf, 0x96, 0x1b, 0x42, 0xce, 0x8f, 0x59, 0x6f, 0x2e, 0x22, 0x25, 0x05, + 0x61, 0x6a, 0x3d, 0x4d, 0xeb, 0xe9, 0xd6, 0xe4, 0x10, 0x72, 0x7f, 0x54, 0xad, 0xb8, 0x44, 0x6d, + 0x40, 0x9b, 0xcc, 0xfc, 0xc0, 0x43, 0x5e, 0x8c, 0xde, 0xd6, 0x9e, 0xb3, 0x5a, 0x7b, 0xce, 0xc7, + 0xda, 0x73, 0x5e, 0x37, 0x5e, 0x63, 0xb5, 0xf1, 0x1a, 0xef, 0x1b, 0xaf, 0xf1, 0x70, 0x1e, 0x2a, + 0x9a, 0x65, 0x93, 0xfe, 0x14, 0xe3, 0xfa, 0xb3, 0x4f, 0x1f, 0x31, 0xd3, 0x52, 0x90, 0xc2, 0xb2, + 0x00, 0x65, 0x15, 0x96, 0x5f, 0x65, 0xa0, 0x3c, 0x01, 0x33, 0xf9, 0x6d, 0xcb, 0x70, 0xf6, 0x19, + 0x00, 0x00, 0xff, 0xff, 0x1c, 0x51, 0xdd, 0xa0, 0x2f, 0x02, 0x00, 0x00, } func (m *EventGuardianSetUpdate) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/genesis.pb.go b/wormchain/x/wormhole/types/genesis.pb.go index 705c08c08b..4c993e348e 100644 --- a/wormchain/x/wormhole/types/genesis.pb.go +++ b/wormchain/x/wormhole/types/genesis.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/genesis.proto +// source: wormchain/wormhole/genesis.proto package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -40,7 +40,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_9a7ced3fe0304831, []int{0} + return fileDescriptor_26b31f0061e456c6, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,46 +133,46 @@ func (m *GenesisState) GetIbcComposabilityMwContract() IbcComposabilityMwContrac } func init() { - proto.RegisterType((*GenesisState)(nil), "wormhole_foundation.wormchain.wormhole.GenesisState") + proto.RegisterType((*GenesisState)(nil), "wormchain.wormhole.GenesisState") } -func init() { proto.RegisterFile("wormhole/genesis.proto", fileDescriptor_9a7ced3fe0304831) } +func init() { proto.RegisterFile("wormchain/wormhole/genesis.proto", fileDescriptor_26b31f0061e456c6) } -var fileDescriptor_9a7ced3fe0304831 = []byte{ - // 528 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0xb6, 0xc6, 0x3a, 0x15, 0x94, 0xb1, 0xd5, 0x35, 0x87, 0x6d, 0xf0, 0x20, 0x05, - 0x71, 0x17, 0xda, 0x83, 0xf6, 0x24, 0x49, 0xc0, 0x12, 0xa8, 0x20, 0x09, 0x28, 0x78, 0x59, 0x26, - 0x3b, 0xaf, 0x9b, 0x81, 0xcd, 0x4c, 0xba, 0x33, 0x4b, 0x9a, 0x93, 0x57, 0x4f, 0xe2, 0xb7, 0xf0, - 0xab, 0xf4, 0xd8, 0xa3, 0x27, 0x91, 0xe4, 0x8b, 0xc8, 0xce, 0xce, 0x4e, 0xda, 0xba, 0x29, 0xdb, - 0xdb, 0xf0, 0x66, 0xde, 0xef, 0xff, 0x7f, 0xff, 0xb7, 0x2c, 0x7a, 0x36, 0x13, 0xe9, 0x64, 0x2c, - 0x12, 0x08, 0x62, 0xe0, 0x20, 0x99, 0xf4, 0xa7, 0xa9, 0x50, 0x02, 0xbf, 0x2a, 0xeb, 0xe1, 0xa9, - 0xc8, 0x38, 0x25, 0x8a, 0x09, 0xee, 0xe7, 0xb5, 0x68, 0x4c, 0x58, 0x71, 0xca, 0x6f, 0x5b, 0xcf, - 0x57, 0xfd, 0x19, 0x49, 0x29, 0x23, 0xbc, 0x00, 0xb4, 0x76, 0xed, 0x45, 0x24, 0xf8, 0x29, 0x8b, - 0x4d, 0xb9, 0x6d, 0xcb, 0x29, 0x4c, 0x13, 0x32, 0x0f, 0xf3, 0x32, 0x44, 0x1a, 0x5f, 0xbc, 0xd8, - 0xb3, 0x2f, 0x24, 0x9c, 0x65, 0xc0, 0x23, 0x08, 0x23, 0x91, 0x71, 0x05, 0xa9, 0x79, 0xf0, 0xfa, - 0x2a, 0x59, 0x02, 0x97, 0x99, 0x0c, 0x4b, 0xf1, 0x50, 0x82, 0x0a, 0x19, 0xa7, 0x70, 0x6e, 0x1e, - 0xef, 0xc4, 0x22, 0x16, 0xfa, 0x18, 0xe4, 0xa7, 0xa2, 0xfa, 0xf2, 0xd7, 0x16, 0x7a, 0x74, 0x5c, - 0xcc, 0x3b, 0x54, 0x44, 0x01, 0x8e, 0xd0, 0xe3, 0x12, 0x31, 0x04, 0x75, 0xc2, 0xa4, 0x72, 0x9d, - 0xf6, 0xc6, 0xfe, 0xf6, 0xc1, 0xa1, 0x5f, 0x2f, 0x08, 0xff, 0x78, 0xd5, 0xde, 0xdd, 0xbc, 0xf8, - 0xb3, 0xd7, 0x18, 0xdc, 0x24, 0xe2, 0x0f, 0xa8, 0x59, 0x64, 0xe1, 0xde, 0x6b, 0x3b, 0xfb, 0xdb, - 0x07, 0x7e, 0x5d, 0x76, 0x4f, 0x77, 0x0d, 0x4c, 0x37, 0x4e, 0xd1, 0x4e, 0x11, 0xde, 0x27, 0x9b, - 0x9d, 0x76, 0xbc, 0xa1, 0x1d, 0xbf, 0xab, 0x4b, 0x1d, 0xdc, 0x60, 0x18, 0xdb, 0x95, 0x6c, 0x2c, - 0xd0, 0xd3, 0x72, 0x1d, 0xbd, 0x62, 0x1b, 0x5a, 0x72, 0x53, 0x4b, 0xbe, 0xad, 0x2b, 0x39, 0xbc, - 0x8e, 0x30, 0x8a, 0x55, 0x64, 0xfc, 0x0d, 0xbd, 0xb0, 0xeb, 0xbd, 0x92, 0x6d, 0x3f, 0xdf, 0xad, - 0x7b, 0x5f, 0xe7, 0xd7, 0xb9, 0x43, 0x7e, 0xd5, 0xa0, 0xc1, 0x7a, 0x0d, 0x9c, 0xa1, 0xdd, 0x72, - 0x81, 0x9f, 0x49, 0xc2, 0x28, 0x51, 0xa2, 0x98, 0xb9, 0xa9, 0x67, 0x3e, 0xba, 0xeb, 0x87, 0x61, - 0x21, 0x66, 0xea, 0x6a, 0x3a, 0x3e, 0x43, 0x4f, 0x48, 0x92, 0x88, 0x19, 0xd0, 0x0e, 0xa5, 0x29, - 0x48, 0x09, 0xd2, 0x7d, 0xa0, 0x15, 0xdf, 0xd7, 0x55, 0xb4, 0xc0, 0xce, 0x35, 0x90, 0xd1, 0xfd, - 0x0f, 0x8f, 0x7f, 0x38, 0xc8, 0x9d, 0x11, 0x39, 0xe9, 0x73, 0xa9, 0x08, 0x57, 0x8c, 0x28, 0xd0, - 0x9d, 0x49, 0x3e, 0xed, 0x96, 0xd6, 0x3e, 0xa9, 0xab, 0xfd, 0xa5, 0x82, 0x03, 0xb4, 0x27, 0xb8, - 0x4a, 0x49, 0xa4, 0x7a, 0x82, 0x42, 0x9f, 0x1a, 0x23, 0x6b, 0x35, 0xf1, 0x77, 0x07, 0xb5, 0xd8, - 0x28, 0xea, 0x89, 0xc9, 0x54, 0x48, 0x32, 0x62, 0x09, 0x53, 0xf3, 0x8f, 0xb3, 0x12, 0xe2, 0x3e, - 0xd4, 0xdb, 0xef, 0xd6, 0xb5, 0xd4, 0x5f, 0x4b, 0x32, 0x46, 0x6e, 0xd1, 0xea, 0x0e, 0x2f, 0x16, - 0x9e, 0x73, 0xb9, 0xf0, 0x9c, 0xbf, 0x0b, 0xcf, 0xf9, 0xb9, 0xf4, 0x1a, 0x97, 0x4b, 0xaf, 0xf1, - 0x7b, 0xe9, 0x35, 0xbe, 0x1e, 0xc5, 0x4c, 0x8d, 0xb3, 0x91, 0x1f, 0x89, 0x49, 0x50, 0x6a, 0xbd, - 0x59, 0x39, 0x09, 0xac, 0x93, 0xe0, 0xdc, 0xde, 0x07, 0x6a, 0x3e, 0x05, 0x39, 0x6a, 0xea, 0xbf, - 0xd0, 0xe1, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xa6, 0x7e, 0xa5, 0x7d, 0x05, 0x00, 0x00, +var fileDescriptor_26b31f0061e456c6 = []byte{ + // 516 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x5f, 0x6b, 0x13, 0x4d, + 0x14, 0xc6, 0x93, 0xb7, 0x7d, 0xa3, 0x4e, 0x05, 0x65, 0xac, 0xb0, 0xe6, 0x62, 0x13, 0xff, 0x41, + 0x55, 0xba, 0x81, 0x88, 0xa0, 0x97, 0xed, 0x5e, 0x94, 0x80, 0xa2, 0x24, 0xa0, 0xa0, 0xe8, 0x32, + 0xd9, 0x39, 0xdd, 0x0c, 0x6e, 0x66, 0xe2, 0xce, 0x59, 0xd2, 0xf8, 0x29, 0xfc, 0x58, 0xbd, 0xec, + 0xa5, 0x57, 0x22, 0xc9, 0x27, 0xf0, 0x1b, 0xc8, 0xce, 0xce, 0x6e, 0x6c, 0x3b, 0xe9, 0xdd, 0xb0, + 0x3c, 0xcf, 0xef, 0x9c, 0xf3, 0x9c, 0x3d, 0xa4, 0x3b, 0x57, 0xd9, 0x34, 0x9e, 0x30, 0x21, 0x7b, + 0xc5, 0x6b, 0xa2, 0x52, 0xe8, 0x25, 0x20, 0x41, 0x0b, 0x1d, 0xcc, 0x32, 0x85, 0x8a, 0xd2, 0x5a, + 0x11, 0x54, 0x8a, 0xf6, 0x7d, 0x97, 0x2b, 0x67, 0x19, 0x17, 0x4c, 0x96, 0xb6, 0x76, 0xc7, 0x21, + 0x89, 0x95, 0x3c, 0x16, 0x89, 0x15, 0x3c, 0x75, 0x08, 0x32, 0x98, 0xa5, 0x6c, 0x11, 0x15, 0x02, + 0x88, 0x51, 0xa8, 0x0a, 0xf6, 0xc4, 0xa1, 0xd5, 0xf0, 0x2d, 0x07, 0x19, 0x43, 0x14, 0xab, 0x5c, + 0x22, 0x64, 0x56, 0xfa, 0xc2, 0x5d, 0x57, 0x83, 0xd4, 0xb9, 0x8e, 0xaa, 0x26, 0x23, 0x0d, 0x18, + 0x09, 0xc9, 0xe1, 0xc4, 0xda, 0x76, 0x13, 0x95, 0x28, 0xf3, 0xec, 0x15, 0xaf, 0xf2, 0xeb, 0x83, + 0x3f, 0x2d, 0x72, 0xf3, 0xa8, 0x4c, 0x63, 0x84, 0x0c, 0x81, 0xbe, 0x25, 0xb7, 0x2a, 0xc4, 0x08, + 0xf0, 0xb5, 0xd0, 0xe8, 0x35, 0xbb, 0x5b, 0x7b, 0x3b, 0xfd, 0x4e, 0x70, 0x39, 0xa6, 0xe0, 0x68, + 0x2d, 0x3d, 0xdc, 0x3e, 0xfd, 0xd5, 0x69, 0x0c, 0x2f, 0xba, 0x69, 0x9f, 0xb4, 0xca, 0x54, 0xbc, + 0xff, 0xba, 0xcd, 0xbd, 0x9d, 0x7e, 0xdb, 0xc5, 0x09, 0x8d, 0x62, 0x68, 0x95, 0xf4, 0x0b, 0xd9, + 0x2d, 0x83, 0x7a, 0x57, 0xe7, 0x64, 0x3a, 0xd9, 0x32, 0x9d, 0x3c, 0x72, 0x11, 0x86, 0x17, 0xf4, + 0xb6, 0x1d, 0x27, 0x87, 0x7e, 0x22, 0x77, 0xaa, 0x70, 0xc3, 0x32, 0x5b, 0x83, 0xdf, 0x36, 0xf8, + 0x87, 0x2e, 0xfc, 0xe8, 0xbc, 0xdc, 0xd2, 0x5d, 0x14, 0xfa, 0x95, 0xdc, 0xab, 0xd7, 0xf1, 0x4f, + 0x3e, 0x83, 0x62, 0x17, 0xde, 0xff, 0x26, 0x83, 0xfd, 0x0d, 0x19, 0xb8, 0x4d, 0xc3, 0xcd, 0x3c, + 0xca, 0xc8, 0xdd, 0x2a, 0xf0, 0xf7, 0x2c, 0x15, 0x9c, 0xa1, 0x2a, 0x67, 0x69, 0x99, 0x59, 0x1e, + 0x5f, 0xb5, 0xb4, 0xda, 0x60, 0xa7, 0x71, 0x93, 0xe8, 0x67, 0x72, 0x9b, 0xa5, 0xa9, 0x9a, 0x03, + 0x3f, 0xe0, 0x3c, 0x03, 0xad, 0x41, 0x7b, 0xd7, 0x0c, 0xfd, 0x99, 0x8b, 0x5e, 0x9b, 0x0f, 0xce, + 0x99, 0x6c, 0x8d, 0x4b, 0x28, 0xfa, 0x9d, 0x78, 0x73, 0xa6, 0xa7, 0x03, 0xa9, 0x91, 0x49, 0x14, + 0x0c, 0xc1, 0x18, 0xd3, 0x62, 0x88, 0xeb, 0xa6, 0xcc, 0x4b, 0x57, 0x99, 0x0f, 0x0e, 0x0f, 0xf0, + 0x50, 0x49, 0xcc, 0x58, 0x8c, 0xa1, 0xe2, 0x30, 0xe0, 0xb6, 0xe6, 0x46, 0x3e, 0x45, 0xd2, 0x16, + 0xe3, 0x38, 0x54, 0xd3, 0x99, 0xd2, 0x6c, 0x2c, 0x52, 0x81, 0x8b, 0x37, 0xf3, 0x8a, 0xe1, 0xdd, + 0x30, 0xbb, 0x0a, 0x5c, 0xd5, 0x07, 0x1b, 0x5d, 0xb6, 0xe6, 0x15, 0xdc, 0xc3, 0xd1, 0xe9, 0xd2, + 0x6f, 0x9e, 0x2d, 0xfd, 0xe6, 0xef, 0xa5, 0xdf, 0xfc, 0xb1, 0xf2, 0x1b, 0x67, 0x2b, 0xbf, 0xf1, + 0x73, 0xe5, 0x37, 0x3e, 0xbe, 0x4a, 0x04, 0x4e, 0xf2, 0x71, 0x10, 0xab, 0x69, 0x7d, 0xdb, 0xfb, + 0xc7, 0x2a, 0x97, 0x9c, 0x15, 0xff, 0x6e, 0x6f, 0x7d, 0xf9, 0x27, 0xeb, 0xdb, 0xc7, 0xc5, 0x0c, + 0xf4, 0xb8, 0x65, 0xee, 0xf9, 0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0xcd, 0x59, 0xad, + 0xef, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/governance.pb.go b/wormchain/x/wormhole/types/governance.pb.go deleted file mode 100644 index 7fb4bb612f..0000000000 --- a/wormchain/x/wormhole/types/governance.pb.go +++ /dev/null @@ -1,900 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/governance.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GuardianSetUpdateProposal defines a guardian set update governance proposal -type GuardianSetUpdateProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - NewGuardianSet GuardianSet `protobuf:"bytes,3,opt,name=newGuardianSet,proto3" json:"newGuardianSet"` -} - -func (m *GuardianSetUpdateProposal) Reset() { *m = GuardianSetUpdateProposal{} } -func (*GuardianSetUpdateProposal) ProtoMessage() {} -func (*GuardianSetUpdateProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ceebda8f8c3f5f74, []int{0} -} -func (m *GuardianSetUpdateProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GuardianSetUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GuardianSetUpdateProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GuardianSetUpdateProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_GuardianSetUpdateProposal.Merge(m, src) -} -func (m *GuardianSetUpdateProposal) XXX_Size() int { - return m.Size() -} -func (m *GuardianSetUpdateProposal) XXX_DiscardUnknown() { - xxx_messageInfo_GuardianSetUpdateProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_GuardianSetUpdateProposal proto.InternalMessageInfo - -func (m *GuardianSetUpdateProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *GuardianSetUpdateProposal) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *GuardianSetUpdateProposal) GetNewGuardianSet() GuardianSet { - if m != nil { - return m.NewGuardianSet - } - return GuardianSet{} -} - -// GovernanceWormholeMessageProposal defines a governance proposal to emit a generic message in the governance message -// format. -type GovernanceWormholeMessageProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Action uint32 `protobuf:"varint,3,opt,name=action,proto3" json:"action,omitempty"` - Module []byte `protobuf:"bytes,4,opt,name=module,proto3" json:"module,omitempty"` - TargetChain uint32 `protobuf:"varint,5,opt,name=targetChain,proto3" json:"targetChain,omitempty"` - Payload []byte `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *GovernanceWormholeMessageProposal) Reset() { *m = GovernanceWormholeMessageProposal{} } -func (*GovernanceWormholeMessageProposal) ProtoMessage() {} -func (*GovernanceWormholeMessageProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ceebda8f8c3f5f74, []int{1} -} -func (m *GovernanceWormholeMessageProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GovernanceWormholeMessageProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GovernanceWormholeMessageProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GovernanceWormholeMessageProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_GovernanceWormholeMessageProposal.Merge(m, src) -} -func (m *GovernanceWormholeMessageProposal) XXX_Size() int { - return m.Size() -} -func (m *GovernanceWormholeMessageProposal) XXX_DiscardUnknown() { - xxx_messageInfo_GovernanceWormholeMessageProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_GovernanceWormholeMessageProposal proto.InternalMessageInfo - -func (m *GovernanceWormholeMessageProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *GovernanceWormholeMessageProposal) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *GovernanceWormholeMessageProposal) GetAction() uint32 { - if m != nil { - return m.Action - } - return 0 -} - -func (m *GovernanceWormholeMessageProposal) GetModule() []byte { - if m != nil { - return m.Module - } - return nil -} - -func (m *GovernanceWormholeMessageProposal) GetTargetChain() uint32 { - if m != nil { - return m.TargetChain - } - return 0 -} - -func (m *GovernanceWormholeMessageProposal) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*GuardianSetUpdateProposal)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSetUpdateProposal") - proto.RegisterType((*GovernanceWormholeMessageProposal)(nil), "wormhole_foundation.wormchain.wormhole.GovernanceWormholeMessageProposal") -} - -func init() { proto.RegisterFile("wormhole/governance.proto", fileDescriptor_ceebda8f8c3f5f74) } - -var fileDescriptor_ceebda8f8c3f5f74 = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x51, 0x31, 0x4f, 0xc2, 0x40, - 0x18, 0xed, 0x29, 0xa0, 0x1e, 0xea, 0xd0, 0x10, 0x2d, 0x0c, 0xa5, 0x32, 0x18, 0x16, 0xdb, 0x44, - 0x26, 0x1d, 0x71, 0x60, 0x32, 0x31, 0x25, 0xc6, 0xc4, 0xc5, 0x7c, 0xb4, 0x67, 0x69, 0x52, 0xfa, - 0x35, 0xd7, 0xab, 0xc8, 0xbf, 0x70, 0x74, 0xe4, 0xa7, 0x38, 0x32, 0xe2, 0xe6, 0x64, 0x0c, 0x2c, - 0xfe, 0x0c, 0x73, 0x6d, 0x81, 0xc6, 0xc9, 0xc4, 0xed, 0x7b, 0xef, 0xf5, 0xbd, 0xf4, 0xbd, 0xa3, - 0xf5, 0x31, 0xf2, 0xd1, 0x10, 0x03, 0x66, 0x79, 0xf8, 0xc4, 0x78, 0x08, 0xa1, 0xc3, 0xcc, 0x88, - 0xa3, 0x40, 0xf5, 0x74, 0x25, 0x3d, 0x3c, 0x62, 0x12, 0xba, 0x20, 0x7c, 0x0c, 0x4d, 0xc9, 0x39, - 0x43, 0xf0, 0xb3, 0x4b, 0xaa, 0x8d, 0xe3, 0x4d, 0x44, 0x02, 0xdc, 0xf5, 0x21, 0xcc, 0x02, 0x1a, - 0x35, 0x0f, 0x3d, 0x4c, 0x4f, 0x4b, 0x5e, 0x19, 0xdb, 0x7a, 0x23, 0xb4, 0xde, 0xcb, 0x3f, 0xec, - 0x33, 0x71, 0x1b, 0xb9, 0x20, 0xd8, 0x0d, 0xc7, 0x08, 0x63, 0x08, 0xd4, 0x1a, 0x2d, 0x0b, 0x5f, - 0x04, 0x4c, 0x23, 0x06, 0x69, 0xef, 0xd9, 0x19, 0x50, 0x0d, 0x5a, 0x75, 0x59, 0xec, 0x70, 0x3f, - 0x92, 0x3f, 0xa1, 0x6d, 0xa5, 0x5a, 0x91, 0x52, 0x81, 0x1e, 0x86, 0x6c, 0x5c, 0xc8, 0xd5, 0xb6, - 0x0d, 0xd2, 0xae, 0x9e, 0x77, 0xcc, 0xbf, 0xb5, 0x30, 0x0b, 0xd6, 0x6e, 0x69, 0xf6, 0xd9, 0x54, - 0xec, 0x5f, 0x81, 0x97, 0xbb, 0xaf, 0xd3, 0xa6, 0xf2, 0x3d, 0x6d, 0x92, 0xd6, 0x3b, 0xa1, 0x27, - 0xbd, 0xf5, 0x5c, 0x77, 0x79, 0xc4, 0x35, 0x8b, 0x63, 0xf0, 0xfe, 0x5f, 0xe5, 0x88, 0x56, 0xc0, - 0x49, 0x45, 0x59, 0xe1, 0xc0, 0xce, 0x91, 0xe4, 0x47, 0xe8, 0x26, 0x01, 0xd3, 0x4a, 0x06, 0x69, - 0xef, 0xdb, 0x39, 0x92, 0x89, 0x02, 0xb8, 0xc7, 0xc4, 0x95, 0x6c, 0xa4, 0x95, 0x53, 0x53, 0x91, - 0x52, 0x35, 0xba, 0x13, 0xc1, 0x24, 0x40, 0x70, 0xb5, 0x4a, 0x6a, 0x5d, 0xc1, 0x4d, 0xa7, 0x6e, - 0x7f, 0xb6, 0xd0, 0xc9, 0x7c, 0xa1, 0x93, 0xaf, 0x85, 0x4e, 0x5e, 0x96, 0xba, 0x32, 0x5f, 0xea, - 0xca, 0xc7, 0x52, 0x57, 0xee, 0x2f, 0x3c, 0x5f, 0x0c, 0x93, 0x81, 0xe9, 0xe0, 0xc8, 0x5a, 0xcd, - 0x75, 0xb6, 0x19, 0xd3, 0x5a, 0x8f, 0x69, 0x3d, 0xaf, 0x75, 0x4b, 0x4c, 0x22, 0x16, 0x0f, 0x2a, - 0xe9, 0x93, 0x77, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x76, 0x11, 0xd3, 0x39, 0x66, 0x02, 0x00, - 0x00, -} - -func (this *GuardianSetUpdateProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GuardianSetUpdateProposal) - if !ok { - that2, ok := that.(GuardianSetUpdateProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if !this.NewGuardianSet.Equal(&that1.NewGuardianSet) { - return false - } - return true -} -func (this *GovernanceWormholeMessageProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GovernanceWormholeMessageProposal) - if !ok { - that2, ok := that.(GovernanceWormholeMessageProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.Action != that1.Action { - return false - } - if !bytes.Equal(this.Module, that1.Module) { - return false - } - if this.TargetChain != that1.TargetChain { - return false - } - if !bytes.Equal(this.Payload, that1.Payload) { - return false - } - return true -} -func (m *GuardianSetUpdateProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GuardianSetUpdateProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GuardianSetUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.NewGuardianSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGovernance(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GovernanceWormholeMessageProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GovernanceWormholeMessageProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GovernanceWormholeMessageProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0x32 - } - if m.TargetChain != 0 { - i = encodeVarintGovernance(dAtA, i, uint64(m.TargetChain)) - i-- - dAtA[i] = 0x28 - } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0x22 - } - if m.Action != 0 { - i = encodeVarintGovernance(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x18 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGovernance(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGovernance(dAtA []byte, offset int, v uint64) int { - offset -= sovGovernance(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GuardianSetUpdateProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - l = m.NewGuardianSet.Size() - n += 1 + l + sovGovernance(uint64(l)) - return n -} - -func (m *GovernanceWormholeMessageProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - if m.Action != 0 { - n += 1 + sovGovernance(uint64(m.Action)) - } - l = len(m.Module) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - if m.TargetChain != 0 { - n += 1 + sovGovernance(uint64(m.TargetChain)) - } - l = len(m.Payload) - if l > 0 { - n += 1 + l + sovGovernance(uint64(l)) - } - return n -} - -func sovGovernance(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGovernance(x uint64) (n int) { - return sovGovernance(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GuardianSetUpdateProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GuardianSetUpdateProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GuardianSetUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewGuardianSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NewGuardianSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGovernance(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGovernance - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GovernanceWormholeMessageProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GovernanceWormholeMessageProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GovernanceWormholeMessageProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Module = append(m.Module[:0], dAtA[iNdEx:postIndex]...) - if m.Module == nil { - m.Module = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetChain", wireType) - } - m.TargetChain = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetChain |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGovernance - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGovernance - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGovernance - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGovernance(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGovernance - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGovernance(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGovernance - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGovernance - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGovernance - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGovernance - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGovernance - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGovernance - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGovernance = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGovernance = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGovernance = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wormchain/x/wormhole/types/guardian.pb.go b/wormchain/x/wormhole/types/guardian.pb.go index 3a63fefbf7..e82f3c049b 100644 --- a/wormchain/x/wormhole/types/guardian.pb.go +++ b/wormchain/x/wormhole/types/guardian.pb.go @@ -1,13 +1,13 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/guardian.proto +// source: wormchain/wormhole/guardian.proto package types import ( bytes "bytes" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -32,7 +32,7 @@ func (m *GuardianKey) Reset() { *m = GuardianKey{} } func (m *GuardianKey) String() string { return proto.CompactTextString(m) } func (*GuardianKey) ProtoMessage() {} func (*GuardianKey) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{0} + return fileDescriptor_c5444791bb152a86, []int{0} } func (m *GuardianKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +77,7 @@ func (m *GuardianValidator) Reset() { *m = GuardianValidator{} } func (m *GuardianValidator) String() string { return proto.CompactTextString(m) } func (*GuardianValidator) ProtoMessage() {} func (*GuardianValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{1} + return fileDescriptor_c5444791bb152a86, []int{1} } func (m *GuardianValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -130,7 +130,7 @@ func (m *GuardianSet) Reset() { *m = GuardianSet{} } func (m *GuardianSet) String() string { return proto.CompactTextString(m) } func (*GuardianSet) ProtoMessage() {} func (*GuardianSet) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{2} + return fileDescriptor_c5444791bb152a86, []int{2} } func (m *GuardianSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -193,7 +193,7 @@ func (m *ValidatorAllowedAddress) Reset() { *m = ValidatorAllowedAddress func (m *ValidatorAllowedAddress) String() string { return proto.CompactTextString(m) } func (*ValidatorAllowedAddress) ProtoMessage() {} func (*ValidatorAllowedAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{3} + return fileDescriptor_c5444791bb152a86, []int{3} } func (m *ValidatorAllowedAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +254,7 @@ func (m *WasmInstantiateAllowedContractCodeId) Reset() { *m = WasmInstan func (m *WasmInstantiateAllowedContractCodeId) String() string { return proto.CompactTextString(m) } func (*WasmInstantiateAllowedContractCodeId) ProtoMessage() {} func (*WasmInstantiateAllowedContractCodeId) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{4} + return fileDescriptor_c5444791bb152a86, []int{4} } func (m *WasmInstantiateAllowedContractCodeId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,7 +298,8 @@ func (m *WasmInstantiateAllowedContractCodeId) GetCodeId() uint64 { } type IbcComposabilityMwContract struct { - // bech32 address of the contract that is used by the ibc composability middleware + // bech32 address of the contract that is used by the ibc composability + // middleware ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` } @@ -306,7 +307,7 @@ func (m *IbcComposabilityMwContract) Reset() { *m = IbcComposabilityMwCo func (m *IbcComposabilityMwContract) String() string { return proto.CompactTextString(m) } func (*IbcComposabilityMwContract) ProtoMessage() {} func (*IbcComposabilityMwContract) Descriptor() ([]byte, []int) { - return fileDescriptor_95afcf26fc23dcb3, []int{5} + return fileDescriptor_c5444791bb152a86, []int{5} } func (m *IbcComposabilityMwContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -343,45 +344,45 @@ func (m *IbcComposabilityMwContract) GetContractAddress() string { } func init() { - proto.RegisterType((*GuardianKey)(nil), "wormhole_foundation.wormchain.wormhole.GuardianKey") - proto.RegisterType((*GuardianValidator)(nil), "wormhole_foundation.wormchain.wormhole.GuardianValidator") - proto.RegisterType((*GuardianSet)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSet") - proto.RegisterType((*ValidatorAllowedAddress)(nil), "wormhole_foundation.wormchain.wormhole.ValidatorAllowedAddress") - proto.RegisterType((*WasmInstantiateAllowedContractCodeId)(nil), "wormhole_foundation.wormchain.wormhole.WasmInstantiateAllowedContractCodeId") - proto.RegisterType((*IbcComposabilityMwContract)(nil), "wormhole_foundation.wormchain.wormhole.IbcComposabilityMwContract") -} - -func init() { proto.RegisterFile("wormhole/guardian.proto", fileDescriptor_95afcf26fc23dcb3) } - -var fileDescriptor_95afcf26fc23dcb3 = []byte{ - // 432 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4d, 0x6f, 0xd3, 0x40, - 0x14, 0xcc, 0x26, 0xa6, 0xa8, 0xaf, 0x5f, 0xe9, 0xaa, 0x52, 0xa2, 0x1e, 0x5c, 0xcb, 0xaa, 0x4a, - 0x10, 0x22, 0x3e, 0x70, 0x82, 0x5b, 0xc9, 0xa1, 0x8a, 0x10, 0x17, 0x17, 0x81, 0x04, 0x87, 0x68, - 0xed, 0x5d, 0x9c, 0xa5, 0xf6, 0x3e, 0xcb, 0xde, 0x90, 0xf8, 0xcc, 0x1f, 0xe0, 0x27, 0xf0, 0x73, - 0x38, 0xf6, 0xc8, 0x11, 0x25, 0x17, 0x7e, 0x06, 0xf2, 0xfa, 0x23, 0xa4, 0x37, 0x6e, 0xb3, 0xf3, - 0xe6, 0xbd, 0x99, 0x95, 0x06, 0x06, 0x4b, 0xcc, 0x92, 0x39, 0xc6, 0xc2, 0x8b, 0x16, 0x2c, 0xe3, - 0x92, 0xa9, 0x71, 0x9a, 0xa1, 0x46, 0x7a, 0xd5, 0x0c, 0x66, 0x9f, 0x71, 0xa1, 0x38, 0xd3, 0x12, - 0xd5, 0xb8, 0xe4, 0xc2, 0x39, 0x93, 0x15, 0x2a, 0xa7, 0xe7, 0x67, 0x11, 0x46, 0x68, 0x56, 0xbc, - 0x12, 0x55, 0xdb, 0xee, 0x05, 0x1c, 0xdc, 0xd4, 0xf7, 0xde, 0x88, 0x82, 0xf6, 0xa1, 0x77, 0x27, - 0x8a, 0x21, 0x71, 0xc8, 0xe8, 0xd0, 0x2f, 0xa1, 0xfb, 0x09, 0x4e, 0x1b, 0xc1, 0x7b, 0x16, 0x4b, - 0xce, 0x34, 0x66, 0xd4, 0x81, 0x83, 0x68, 0xbb, 0x55, 0xcb, 0xff, 0xa5, 0xe8, 0x25, 0x1c, 0x7d, - 0x6d, 0xe4, 0xd7, 0x9c, 0x67, 0xc3, 0xae, 0xd1, 0xec, 0x92, 0xae, 0xd8, 0xba, 0xdf, 0x0a, 0x4d, - 0xcf, 0xe0, 0x91, 0x54, 0x5c, 0xac, 0xcc, 0xc1, 0x23, 0xbf, 0x7a, 0x50, 0x0a, 0xd6, 0x9d, 0x28, - 0xf2, 0x61, 0xd7, 0xe9, 0x8d, 0x0e, 0x7d, 0x83, 0xe9, 0x15, 0x1c, 0x8b, 0x55, 0x2a, 0x33, 0xf3, - 0xdb, 0x77, 0x32, 0x11, 0xc3, 0x9e, 0x43, 0x46, 0x96, 0xff, 0x80, 0x7d, 0x65, 0xfd, 0xf9, 0x71, - 0x41, 0xdc, 0x6f, 0x04, 0x06, 0x6d, 0xf8, 0xeb, 0x38, 0xc6, 0xa5, 0xe0, 0xa5, 0xbf, 0xc8, 0x73, - 0xfa, 0x0c, 0x4e, 0xdb, 0x4c, 0x33, 0x56, 0x91, 0xc6, 0x7f, 0xdf, 0xef, 0xef, 0x84, 0x2d, 0xc5, - 0x4f, 0xe0, 0x84, 0x55, 0xeb, 0xad, 0xb4, 0x6b, 0xa4, 0xc7, 0x6c, 0xf7, 0x2a, 0x05, 0x4b, 0xb1, - 0x3a, 0xd5, 0xbe, 0x6f, 0xb0, 0xfb, 0x05, 0x2e, 0x3f, 0xb0, 0x3c, 0x99, 0xaa, 0x5c, 0x33, 0xa5, - 0x25, 0xd3, 0xa2, 0x8e, 0x32, 0x41, 0xa5, 0x33, 0x16, 0xea, 0x09, 0x72, 0x31, 0xe5, 0xf4, 0x29, - 0xf4, 0xc3, 0x9a, 0x79, 0x10, 0xe8, 0xa4, 0xe1, 0x1b, 0x9b, 0x01, 0x3c, 0x0e, 0x91, 0x8b, 0x99, - 0xe4, 0x26, 0x87, 0xe5, 0xef, 0x85, 0xe6, 0x86, 0x7b, 0x03, 0xe7, 0xd3, 0x20, 0x9c, 0x60, 0x92, - 0x62, 0xce, 0x02, 0x19, 0x4b, 0x5d, 0xbc, 0x5d, 0x36, 0x3e, 0xff, 0xe1, 0xf0, 0xfa, 0xf6, 0xe7, - 0xda, 0x26, 0xf7, 0x6b, 0x9b, 0xfc, 0x5e, 0xdb, 0xe4, 0xfb, 0xc6, 0xee, 0xdc, 0x6f, 0xec, 0xce, - 0xaf, 0x8d, 0xdd, 0xf9, 0xf8, 0x32, 0x92, 0x7a, 0xbe, 0x08, 0xc6, 0x21, 0x26, 0x5e, 0x53, 0xb2, - 0xe7, 0xdb, 0x0a, 0x7a, 0x6d, 0x05, 0xbd, 0x55, 0x3b, 0xf7, 0x74, 0x91, 0x8a, 0x3c, 0xd8, 0x33, - 0xdd, 0x7b, 0xf1, 0x37, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x97, 0xbd, 0x09, 0xd4, 0x02, 0x00, 0x00, + proto.RegisterType((*GuardianKey)(nil), "wormchain.wormhole.GuardianKey") + proto.RegisterType((*GuardianValidator)(nil), "wormchain.wormhole.GuardianValidator") + proto.RegisterType((*GuardianSet)(nil), "wormchain.wormhole.GuardianSet") + proto.RegisterType((*ValidatorAllowedAddress)(nil), "wormchain.wormhole.ValidatorAllowedAddress") + proto.RegisterType((*WasmInstantiateAllowedContractCodeId)(nil), "wormchain.wormhole.WasmInstantiateAllowedContractCodeId") + proto.RegisterType((*IbcComposabilityMwContract)(nil), "wormchain.wormhole.IbcComposabilityMwContract") +} + +func init() { proto.RegisterFile("wormchain/wormhole/guardian.proto", fileDescriptor_c5444791bb152a86) } + +var fileDescriptor_c5444791bb152a86 = []byte{ + // 427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0x6e, 0xd3, 0x40, + 0x14, 0x85, 0x33, 0x89, 0x29, 0xea, 0xed, 0x5f, 0x3a, 0xaa, 0xd4, 0xa8, 0x0b, 0xd7, 0x58, 0x15, + 0x04, 0x21, 0xe2, 0x05, 0x2b, 0xd8, 0x95, 0x2c, 0xaa, 0x08, 0xb1, 0x71, 0x11, 0x48, 0xb0, 0xa8, + 0xc6, 0x9e, 0xc1, 0x19, 0x6a, 0xcf, 0xb5, 0xec, 0x09, 0x89, 0xd7, 0xbc, 0x00, 0x8f, 0xc0, 0xe3, + 0xb0, 0xec, 0x92, 0x25, 0x4a, 0x36, 0x3c, 0x06, 0xf2, 0xf8, 0x8f, 0x74, 0xc7, 0xee, 0xf8, 0xf8, + 0xbb, 0xf7, 0x1c, 0x8d, 0x2e, 0x3c, 0x5a, 0x62, 0x96, 0x84, 0x73, 0x26, 0x95, 0x57, 0xaa, 0x39, + 0xc6, 0xc2, 0x8b, 0x16, 0x2c, 0xe3, 0x92, 0xa9, 0x49, 0x9a, 0xa1, 0x46, 0x4a, 0x5b, 0x64, 0xd2, + 0x20, 0x67, 0x27, 0x11, 0x46, 0x68, 0x7e, 0x7b, 0xa5, 0xaa, 0x48, 0xf7, 0x1c, 0xf6, 0xae, 0xea, + 0xd9, 0x37, 0xa2, 0xa0, 0x43, 0x18, 0xdc, 0x8a, 0x62, 0x44, 0x1c, 0x32, 0xde, 0xf7, 0x4b, 0xe9, + 0x7e, 0x82, 0xe3, 0x06, 0x78, 0xcf, 0x62, 0xc9, 0x99, 0xc6, 0x8c, 0x3a, 0xb0, 0x17, 0x75, 0x53, + 0x35, 0xfe, 0xaf, 0x45, 0x2f, 0xe0, 0xe0, 0x6b, 0x83, 0x5f, 0x72, 0x9e, 0x8d, 0xfa, 0x86, 0xd9, + 0x36, 0x5d, 0xd1, 0xa5, 0x5f, 0x0b, 0x4d, 0x4f, 0xe0, 0x81, 0x54, 0x5c, 0xac, 0xcc, 0xc2, 0x03, + 0xbf, 0xfa, 0xa0, 0x14, 0xac, 0x5b, 0x51, 0xe4, 0xa3, 0xbe, 0x33, 0x18, 0xef, 0xfb, 0x46, 0xd3, + 0xc7, 0x70, 0x28, 0x56, 0xa9, 0xcc, 0x98, 0x96, 0xa8, 0xde, 0xc9, 0x44, 0x8c, 0x06, 0x0e, 0x19, + 0x5b, 0xfe, 0x3d, 0xf7, 0x95, 0xf5, 0xe7, 0xc7, 0x39, 0x71, 0xbf, 0x11, 0x38, 0x6d, 0xcb, 0x5f, + 0xc6, 0x31, 0x2e, 0x05, 0x2f, 0xf3, 0x45, 0x9e, 0xd3, 0x67, 0x70, 0xdc, 0x76, 0xba, 0x61, 0x95, + 0x69, 0xf2, 0x77, 0xfd, 0xe1, 0x56, 0xd9, 0x12, 0x7e, 0x02, 0x47, 0xac, 0x1a, 0x6f, 0xd1, 0xbe, + 0x41, 0x0f, 0xd9, 0xf6, 0x56, 0x0a, 0x96, 0x62, 0x75, 0xab, 0x5d, 0xdf, 0x68, 0xf7, 0x0b, 0x5c, + 0x7c, 0x60, 0x79, 0x32, 0x53, 0xb9, 0x66, 0x4a, 0x4b, 0xa6, 0x45, 0x5d, 0x65, 0x8a, 0x4a, 0x67, + 0x2c, 0xd4, 0x53, 0xe4, 0x62, 0xc6, 0xe9, 0x53, 0x18, 0x86, 0xb5, 0x73, 0xaf, 0xd0, 0x51, 0xe3, + 0x37, 0x31, 0xa7, 0xf0, 0x30, 0x44, 0x2e, 0x6e, 0x24, 0x37, 0x3d, 0x2c, 0x7f, 0x27, 0x34, 0x3b, + 0xdc, 0x2b, 0x38, 0x9b, 0x05, 0xe1, 0x14, 0x93, 0x14, 0x73, 0x16, 0xc8, 0x58, 0xea, 0xe2, 0xed, + 0xb2, 0xc9, 0xf9, 0x8f, 0x84, 0xd7, 0xd7, 0x3f, 0xd7, 0x36, 0xb9, 0x5b, 0xdb, 0xe4, 0xf7, 0xda, + 0x26, 0xdf, 0x37, 0x76, 0xef, 0x6e, 0x63, 0xf7, 0x7e, 0x6d, 0xec, 0xde, 0xc7, 0x97, 0x91, 0xd4, + 0xf3, 0x45, 0x30, 0x09, 0x31, 0x69, 0xef, 0xf0, 0xf9, 0x67, 0x5c, 0x28, 0x6e, 0x9e, 0xdf, 0xeb, + 0xae, 0x74, 0xd5, 0xdd, 0xa9, 0x2e, 0x52, 0x91, 0x07, 0x3b, 0xe6, 0xf6, 0x5e, 0xfc, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0xd5, 0x3d, 0x91, 0xce, 0xca, 0x02, 0x00, 0x00, } func (this *GuardianSet) Equal(that interface{}) bool { diff --git a/wormchain/x/wormhole/types/keys.go b/wormchain/x/wormhole/types/keys.go index 60e2f79ad7..94b0d32216 100644 --- a/wormchain/x/wormhole/types/keys.go +++ b/wormchain/x/wormhole/types/keys.go @@ -10,9 +10,6 @@ const ( // RouterKey is the message route for slashing RouterKey = ModuleName - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - // MemStoreKey defines the in-memory store key MemStoreKey = "mem_wormhole" ) diff --git a/wormchain/x/wormhole/types/message_governance_wormhole_message_proposal.go b/wormchain/x/wormhole/types/message_governance_wormhole_message_proposal.go new file mode 100644 index 0000000000..05c877e2c6 --- /dev/null +++ b/wormchain/x/wormhole/types/message_governance_wormhole_message_proposal.go @@ -0,0 +1,32 @@ +package types + +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgGovernanceWormholeMessageProposal{} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgGovernanceWormholeMessageProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgGovernanceWormholeMessageProposal) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgGovernanceWormholeMessageProposal) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return sdkerrors.Wrap(err, "invalid authority address") + } + if len(m.Module) != 32 { + return fmt.Errorf("invalid module length: %d != 32", len(m.Module)) + } + return nil +} diff --git a/wormchain/x/wormhole/types/message_guardian_set_update_proposal.go b/wormchain/x/wormhole/types/message_guardian_set_update_proposal.go new file mode 100644 index 0000000000..4b4ee9e22a --- /dev/null +++ b/wormchain/x/wormhole/types/message_guardian_set_update_proposal.go @@ -0,0 +1,30 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgGuardianSetUpdateProposal{} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgGuardianSetUpdateProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgGuardianSetUpdateProposal) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgGuardianSetUpdateProposal) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return sdkerrors.Wrap(err, "invalid authority address") + } + if err := m.NewGuardianSet.ValidateBasic(); err != nil { + return err + } + return nil +} diff --git a/wormchain/x/wormhole/types/proposal.go b/wormchain/x/wormhole/types/proposal.go deleted file mode 100644 index cd74e454d6..0000000000 --- a/wormchain/x/wormhole/types/proposal.go +++ /dev/null @@ -1,74 +0,0 @@ -package types - -import ( - "fmt" - - gov "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -const ( - ProposalTypeGuardianSetUpdate string = "GuardianSetUpdate" - ProposalTypeGovernanceWormholeMessage string = "GovernanceWormholeMessage" -) - -func init() { - gov.RegisterProposalType(ProposalTypeGuardianSetUpdate) - gov.RegisterProposalTypeCodec(&GuardianSetUpdateProposal{}, "wormhole/GuardianSetUpdate") - gov.RegisterProposalType(ProposalTypeGovernanceWormholeMessage) - gov.RegisterProposalTypeCodec(&GovernanceWormholeMessageProposal{}, "wormhole/GovernanceWormholeMessage") -} - -func NewGuardianSetUpdateProposal(title, description string, guardianSet GuardianSet) *GuardianSetUpdateProposal { - return &GuardianSetUpdateProposal{ - Title: title, - Description: description, - NewGuardianSet: guardianSet, - } -} - -func (sup *GuardianSetUpdateProposal) ProposalRoute() string { return RouterKey } -func (sup *GuardianSetUpdateProposal) ProposalType() string { return ProposalTypeGuardianSetUpdate } -func (sup *GuardianSetUpdateProposal) ValidateBasic() error { - if err := sup.NewGuardianSet.ValidateBasic(); err != nil { - return err - } - return gov.ValidateAbstract(sup) -} - -func (sup *GuardianSetUpdateProposal) String() string { - return fmt.Sprintf(`Guardian Set Upgrade Proposal: - Title: %s - Description: %s - GuardianSet: %s`, sup.Title, sup.Description, sup.NewGuardianSet.String()) -} - -func NewGovernanceWormholeMessageProposal(title, description string, action uint8, targetChain uint16, module []byte, payload []byte) *GovernanceWormholeMessageProposal { - return &GovernanceWormholeMessageProposal{ - Title: title, - Description: description, - Module: module, - Action: uint32(action), - TargetChain: uint32(targetChain), - Payload: payload, - } -} - -func (sup *GovernanceWormholeMessageProposal) ProposalRoute() string { return RouterKey } -func (sup *GovernanceWormholeMessageProposal) ProposalType() string { - return ProposalTypeGovernanceWormholeMessage -} -func (sup *GovernanceWormholeMessageProposal) ValidateBasic() error { - if len(sup.Module) != 32 { - return fmt.Errorf("invalid module length: %d != 32", len(sup.Module)) - } - return gov.ValidateAbstract(sup) -} - -func (sup *GovernanceWormholeMessageProposal) String() string { - return fmt.Sprintf(`Governance Wormhole Message Proposal: - Title: %s - Description: %s - Module: %x - TargetChain: %d - Payload: %x`, sup.Title, sup.Description, sup.Module, sup.TargetChain, sup.Payload) -} diff --git a/wormchain/x/wormhole/types/query.pb.go b/wormchain/x/wormhole/types/query.pb.go index 362d20448c..c32b2b65c6 100644 --- a/wormchain/x/wormhole/types/query.pb.go +++ b/wormchain/x/wormhole/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/query.proto +// source: wormchain/wormhole/query.proto package types @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -38,7 +38,7 @@ func (m *QueryAllValidatorAllowlist) Reset() { *m = QueryAllValidatorAll func (m *QueryAllValidatorAllowlist) String() string { return proto.CompactTextString(m) } func (*QueryAllValidatorAllowlist) ProtoMessage() {} func (*QueryAllValidatorAllowlist) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{0} + return fileDescriptor_c2761ec9c734bff1, []int{0} } func (m *QueryAllValidatorAllowlist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -84,7 +84,7 @@ func (m *QueryAllValidatorAllowlistResponse) Reset() { *m = QueryAllVali func (m *QueryAllValidatorAllowlistResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllValidatorAllowlistResponse) ProtoMessage() {} func (*QueryAllValidatorAllowlistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{1} + return fileDescriptor_c2761ec9c734bff1, []int{1} } func (m *QueryAllValidatorAllowlistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +136,7 @@ func (m *QueryValidatorAllowlist) Reset() { *m = QueryValidatorAllowlist func (m *QueryValidatorAllowlist) String() string { return proto.CompactTextString(m) } func (*QueryValidatorAllowlist) ProtoMessage() {} func (*QueryValidatorAllowlist) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{2} + return fileDescriptor_c2761ec9c734bff1, []int{2} } func (m *QueryValidatorAllowlist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -190,7 +190,7 @@ func (m *QueryValidatorAllowlistResponse) Reset() { *m = QueryValidatorA func (m *QueryValidatorAllowlistResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorAllowlistResponse) ProtoMessage() {} func (*QueryValidatorAllowlistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{3} + return fileDescriptor_c2761ec9c734bff1, []int{3} } func (m *QueryValidatorAllowlistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,7 +248,7 @@ func (m *QueryGetGuardianSetRequest) Reset() { *m = QueryGetGuardianSetR func (m *QueryGetGuardianSetRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianSetRequest) ProtoMessage() {} func (*QueryGetGuardianSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{4} + return fileDescriptor_c2761ec9c734bff1, []int{4} } func (m *QueryGetGuardianSetRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -292,7 +292,7 @@ func (m *QueryGetGuardianSetResponse) Reset() { *m = QueryGetGuardianSet func (m *QueryGetGuardianSetResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianSetResponse) ProtoMessage() {} func (*QueryGetGuardianSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{5} + return fileDescriptor_c2761ec9c734bff1, []int{5} } func (m *QueryGetGuardianSetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,7 +336,7 @@ func (m *QueryAllGuardianSetRequest) Reset() { *m = QueryAllGuardianSetR func (m *QueryAllGuardianSetRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianSetRequest) ProtoMessage() {} func (*QueryAllGuardianSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{6} + return fileDescriptor_c2761ec9c734bff1, []int{6} } func (m *QueryAllGuardianSetRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -381,7 +381,7 @@ func (m *QueryAllGuardianSetResponse) Reset() { *m = QueryAllGuardianSet func (m *QueryAllGuardianSetResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianSetResponse) ProtoMessage() {} func (*QueryAllGuardianSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{7} + return fileDescriptor_c2761ec9c734bff1, []int{7} } func (m *QueryAllGuardianSetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -431,7 +431,7 @@ func (m *QueryGetConfigRequest) Reset() { *m = QueryGetConfigRequest{} } func (m *QueryGetConfigRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetConfigRequest) ProtoMessage() {} func (*QueryGetConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{8} + return fileDescriptor_c2761ec9c734bff1, []int{8} } func (m *QueryGetConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -468,7 +468,7 @@ func (m *QueryGetConfigResponse) Reset() { *m = QueryGetConfigResponse{} func (m *QueryGetConfigResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetConfigResponse) ProtoMessage() {} func (*QueryGetConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{9} + return fileDescriptor_c2761ec9c734bff1, []int{9} } func (m *QueryGetConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +512,7 @@ func (m *QueryGetReplayProtectionRequest) Reset() { *m = QueryGetReplayP func (m *QueryGetReplayProtectionRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetReplayProtectionRequest) ProtoMessage() {} func (*QueryGetReplayProtectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{10} + return fileDescriptor_c2761ec9c734bff1, []int{10} } func (m *QueryGetReplayProtectionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -556,7 +556,7 @@ func (m *QueryGetReplayProtectionResponse) Reset() { *m = QueryGetReplay func (m *QueryGetReplayProtectionResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetReplayProtectionResponse) ProtoMessage() {} func (*QueryGetReplayProtectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{11} + return fileDescriptor_c2761ec9c734bff1, []int{11} } func (m *QueryGetReplayProtectionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -600,7 +600,7 @@ func (m *QueryAllReplayProtectionRequest) Reset() { *m = QueryAllReplayP func (m *QueryAllReplayProtectionRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllReplayProtectionRequest) ProtoMessage() {} func (*QueryAllReplayProtectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{12} + return fileDescriptor_c2761ec9c734bff1, []int{12} } func (m *QueryAllReplayProtectionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -645,7 +645,7 @@ func (m *QueryAllReplayProtectionResponse) Reset() { *m = QueryAllReplay func (m *QueryAllReplayProtectionResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllReplayProtectionResponse) ProtoMessage() {} func (*QueryAllReplayProtectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{13} + return fileDescriptor_c2761ec9c734bff1, []int{13} } func (m *QueryAllReplayProtectionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,7 +696,7 @@ func (m *QueryGetSequenceCounterRequest) Reset() { *m = QueryGetSequence func (m *QueryGetSequenceCounterRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequenceCounterRequest) ProtoMessage() {} func (*QueryGetSequenceCounterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{14} + return fileDescriptor_c2761ec9c734bff1, []int{14} } func (m *QueryGetSequenceCounterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -740,7 +740,7 @@ func (m *QueryGetSequenceCounterResponse) Reset() { *m = QueryGetSequenc func (m *QueryGetSequenceCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequenceCounterResponse) ProtoMessage() {} func (*QueryGetSequenceCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{15} + return fileDescriptor_c2761ec9c734bff1, []int{15} } func (m *QueryGetSequenceCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -784,7 +784,7 @@ func (m *QueryAllSequenceCounterRequest) Reset() { *m = QueryAllSequence func (m *QueryAllSequenceCounterRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllSequenceCounterRequest) ProtoMessage() {} func (*QueryAllSequenceCounterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{16} + return fileDescriptor_c2761ec9c734bff1, []int{16} } func (m *QueryAllSequenceCounterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -829,7 +829,7 @@ func (m *QueryAllSequenceCounterResponse) Reset() { *m = QueryAllSequenc func (m *QueryAllSequenceCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllSequenceCounterResponse) ProtoMessage() {} func (*QueryAllSequenceCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{17} + return fileDescriptor_c2761ec9c734bff1, []int{17} } func (m *QueryAllSequenceCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -881,7 +881,7 @@ func (m *QueryGetConsensusGuardianSetIndexRequest) Reset() { func (m *QueryGetConsensusGuardianSetIndexRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetConsensusGuardianSetIndexRequest) ProtoMessage() {} func (*QueryGetConsensusGuardianSetIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{18} + return fileDescriptor_c2761ec9c734bff1, []int{18} } func (m *QueryGetConsensusGuardianSetIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -922,7 +922,7 @@ func (m *QueryGetConsensusGuardianSetIndexResponse) String() string { } func (*QueryGetConsensusGuardianSetIndexResponse) ProtoMessage() {} func (*QueryGetConsensusGuardianSetIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{19} + return fileDescriptor_c2761ec9c734bff1, []int{19} } func (m *QueryGetConsensusGuardianSetIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -966,7 +966,7 @@ func (m *QueryGetGuardianValidatorRequest) Reset() { *m = QueryGetGuardi func (m *QueryGetGuardianValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianValidatorRequest) ProtoMessage() {} func (*QueryGetGuardianValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{20} + return fileDescriptor_c2761ec9c734bff1, []int{20} } func (m *QueryGetGuardianValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1010,7 +1010,7 @@ func (m *QueryGetGuardianValidatorResponse) Reset() { *m = QueryGetGuard func (m *QueryGetGuardianValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianValidatorResponse) ProtoMessage() {} func (*QueryGetGuardianValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{21} + return fileDescriptor_c2761ec9c734bff1, []int{21} } func (m *QueryGetGuardianValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1054,7 +1054,7 @@ func (m *QueryAllGuardianValidatorRequest) Reset() { *m = QueryAllGuardi func (m *QueryAllGuardianValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianValidatorRequest) ProtoMessage() {} func (*QueryAllGuardianValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{22} + return fileDescriptor_c2761ec9c734bff1, []int{22} } func (m *QueryAllGuardianValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1099,7 +1099,7 @@ func (m *QueryAllGuardianValidatorResponse) Reset() { *m = QueryAllGuard func (m *QueryAllGuardianValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianValidatorResponse) ProtoMessage() {} func (*QueryAllGuardianValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{23} + return fileDescriptor_c2761ec9c734bff1, []int{23} } func (m *QueryAllGuardianValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1149,7 +1149,7 @@ func (m *QueryLatestGuardianSetIndexRequest) Reset() { *m = QueryLatestG func (m *QueryLatestGuardianSetIndexRequest) String() string { return proto.CompactTextString(m) } func (*QueryLatestGuardianSetIndexRequest) ProtoMessage() {} func (*QueryLatestGuardianSetIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{24} + return fileDescriptor_c2761ec9c734bff1, []int{24} } func (m *QueryLatestGuardianSetIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1186,7 +1186,7 @@ func (m *QueryLatestGuardianSetIndexResponse) Reset() { *m = QueryLatest func (m *QueryLatestGuardianSetIndexResponse) String() string { return proto.CompactTextString(m) } func (*QueryLatestGuardianSetIndexResponse) ProtoMessage() {} func (*QueryLatestGuardianSetIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{25} + return fileDescriptor_c2761ec9c734bff1, []int{25} } func (m *QueryLatestGuardianSetIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1231,7 +1231,7 @@ func (m *QueryIbcComposabilityMwContractRequest) Reset() { func (m *QueryIbcComposabilityMwContractRequest) String() string { return proto.CompactTextString(m) } func (*QueryIbcComposabilityMwContractRequest) ProtoMessage() {} func (*QueryIbcComposabilityMwContractRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{26} + return fileDescriptor_c2761ec9c734bff1, []int{26} } func (m *QueryIbcComposabilityMwContractRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1270,7 +1270,7 @@ func (m *QueryIbcComposabilityMwContractResponse) Reset() { func (m *QueryIbcComposabilityMwContractResponse) String() string { return proto.CompactTextString(m) } func (*QueryIbcComposabilityMwContractResponse) ProtoMessage() {} func (*QueryIbcComposabilityMwContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{27} + return fileDescriptor_c2761ec9c734bff1, []int{27} } func (m *QueryIbcComposabilityMwContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1314,7 +1314,7 @@ func (m *QueryAllWasmInstantiateAllowlist) Reset() { *m = QueryAllWasmIn func (m *QueryAllWasmInstantiateAllowlist) String() string { return proto.CompactTextString(m) } func (*QueryAllWasmInstantiateAllowlist) ProtoMessage() {} func (*QueryAllWasmInstantiateAllowlist) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{28} + return fileDescriptor_c2761ec9c734bff1, []int{28} } func (m *QueryAllWasmInstantiateAllowlist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1362,7 +1362,7 @@ func (m *QueryAllWasmInstantiateAllowlistResponse) Reset() { func (m *QueryAllWasmInstantiateAllowlistResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllWasmInstantiateAllowlistResponse) ProtoMessage() {} func (*QueryAllWasmInstantiateAllowlistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{29} + return fileDescriptor_c2761ec9c734bff1, []int{29} } func (m *QueryAllWasmInstantiateAllowlistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1406,133 +1406,132 @@ func (m *QueryAllWasmInstantiateAllowlistResponse) GetPagination() *query.PageRe } func init() { - proto.RegisterType((*QueryAllValidatorAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllValidatorAllowlist") - proto.RegisterType((*QueryAllValidatorAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllValidatorAllowlistResponse") - proto.RegisterType((*QueryValidatorAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.QueryValidatorAllowlist") - proto.RegisterType((*QueryValidatorAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryValidatorAllowlistResponse") - proto.RegisterType((*QueryGetGuardianSetRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianSetRequest") - proto.RegisterType((*QueryGetGuardianSetResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianSetResponse") - proto.RegisterType((*QueryAllGuardianSetRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllGuardianSetRequest") - proto.RegisterType((*QueryAllGuardianSetResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllGuardianSetResponse") - proto.RegisterType((*QueryGetConfigRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetConfigRequest") - proto.RegisterType((*QueryGetConfigResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetConfigResponse") - proto.RegisterType((*QueryGetReplayProtectionRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetReplayProtectionRequest") - proto.RegisterType((*QueryGetReplayProtectionResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetReplayProtectionResponse") - proto.RegisterType((*QueryAllReplayProtectionRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllReplayProtectionRequest") - proto.RegisterType((*QueryAllReplayProtectionResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllReplayProtectionResponse") - proto.RegisterType((*QueryGetSequenceCounterRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetSequenceCounterRequest") - proto.RegisterType((*QueryGetSequenceCounterResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetSequenceCounterResponse") - proto.RegisterType((*QueryAllSequenceCounterRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllSequenceCounterRequest") - proto.RegisterType((*QueryAllSequenceCounterResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllSequenceCounterResponse") - proto.RegisterType((*QueryGetConsensusGuardianSetIndexRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetConsensusGuardianSetIndexRequest") - proto.RegisterType((*QueryGetConsensusGuardianSetIndexResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetConsensusGuardianSetIndexResponse") - proto.RegisterType((*QueryGetGuardianValidatorRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianValidatorRequest") - proto.RegisterType((*QueryGetGuardianValidatorResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianValidatorResponse") - proto.RegisterType((*QueryAllGuardianValidatorRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllGuardianValidatorRequest") - proto.RegisterType((*QueryAllGuardianValidatorResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllGuardianValidatorResponse") - proto.RegisterType((*QueryLatestGuardianSetIndexRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryLatestGuardianSetIndexRequest") - proto.RegisterType((*QueryLatestGuardianSetIndexResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryLatestGuardianSetIndexResponse") - proto.RegisterType((*QueryIbcComposabilityMwContractRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryIbcComposabilityMwContractRequest") - proto.RegisterType((*QueryIbcComposabilityMwContractResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryIbcComposabilityMwContractResponse") - proto.RegisterType((*QueryAllWasmInstantiateAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllWasmInstantiateAllowlist") - proto.RegisterType((*QueryAllWasmInstantiateAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllWasmInstantiateAllowlistResponse") -} - -func init() { proto.RegisterFile("wormhole/query.proto", fileDescriptor_273185ecc792fa38) } - -var fileDescriptor_273185ecc792fa38 = []byte{ - // 1448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x99, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0x33, 0xbb, 0xb4, 0x52, 0x26, 0x85, 0xb6, 0x43, 0xfa, 0x03, 0xb7, 0xda, 0x06, 0x83, - 0xda, 0xd0, 0x8a, 0x35, 0x4d, 0x44, 0xd3, 0xb4, 0x94, 0x74, 0x77, 0x43, 0x36, 0x9b, 0xa6, 0x90, - 0x6e, 0x24, 0x90, 0x40, 0x95, 0xe5, 0xf5, 0x4e, 0x36, 0xae, 0xbc, 0xf6, 0x76, 0xed, 0x6d, 0x1a, - 0xa2, 0x5c, 0x90, 0x7a, 0x41, 0x28, 0x20, 0xf8, 0x53, 0xf8, 0x03, 0x38, 0x70, 0xe9, 0x81, 0x43, - 0xa5, 0x4a, 0xfc, 0x50, 0x25, 0x84, 0x92, 0xc2, 0x01, 0x0e, 0xdc, 0x38, 0x20, 0x0e, 0xc8, 0xe3, - 0x67, 0xaf, 0xd7, 0x6b, 0x6f, 0x6c, 0xaf, 0x73, 0xdb, 0xcc, 0x8c, 0xbf, 0xf3, 0x3e, 0xdf, 0x79, - 0x9e, 0x79, 0xe3, 0xe0, 0xf1, 0x0d, 0xbd, 0xdd, 0x5c, 0xd7, 0x55, 0x2a, 0xdc, 0xef, 0xd0, 0xf6, - 0x66, 0xbe, 0xd5, 0xd6, 0x4d, 0x9d, 0x9c, 0x77, 0x5a, 0xc5, 0x35, 0xbd, 0xa3, 0xd5, 0x25, 0x53, - 0xd1, 0xb5, 0xbc, 0xd5, 0x26, 0xaf, 0x4b, 0x8a, 0xfd, 0xcb, 0xea, 0xe5, 0xce, 0x36, 0x74, 0xbd, - 0xa1, 0x52, 0x41, 0x6a, 0x29, 0x82, 0xa4, 0x69, 0xba, 0xc9, 0x46, 0x1a, 0xb6, 0x0a, 0x77, 0x51, - 0xd6, 0x8d, 0xa6, 0x6e, 0x08, 0x35, 0xc9, 0x00, 0x79, 0xe1, 0xc1, 0xe5, 0x1a, 0x35, 0xa5, 0xcb, - 0x42, 0x4b, 0x6a, 0x28, 0x9a, 0x2d, 0x6b, 0x8f, 0x3d, 0xe5, 0xc6, 0xd1, 0xe8, 0x48, 0xed, 0xba, - 0x22, 0x39, 0x1d, 0x27, 0xdc, 0x0e, 0x59, 0xd7, 0xd6, 0x94, 0x06, 0x34, 0x4f, 0xb8, 0xcd, 0x6d, - 0xda, 0x52, 0xa5, 0x4d, 0xd1, 0x6a, 0xa6, 0xb2, 0x47, 0xf1, 0x9c, 0x3b, 0xc2, 0xa0, 0xf7, 0x3b, - 0x54, 0x93, 0xa9, 0x28, 0xeb, 0x1d, 0xcd, 0xa4, 0x6d, 0x18, 0x70, 0xc9, 0xab, 0x6c, 0x50, 0xcd, - 0xe8, 0x18, 0xa2, 0x33, 0xb9, 0x68, 0x50, 0x53, 0x54, 0xb4, 0x3a, 0x7d, 0x08, 0x83, 0xc7, 0x1b, - 0x7a, 0x43, 0x67, 0x3f, 0x05, 0xeb, 0x97, 0xdd, 0xca, 0xd7, 0x31, 0x77, 0xc7, 0xe2, 0x2a, 0xa8, - 0xea, 0x87, 0x92, 0xaa, 0xd4, 0x25, 0x53, 0x6f, 0x17, 0x54, 0x55, 0xdf, 0x50, 0x15, 0xc3, 0x24, - 0x0b, 0x18, 0x77, 0x39, 0x4f, 0xa3, 0x09, 0x34, 0x39, 0x36, 0x75, 0x3e, 0x6f, 0x9b, 0x92, 0xb7, - 0x4c, 0xc9, 0xdb, 0x9e, 0x83, 0x29, 0xf9, 0x15, 0xa9, 0x41, 0xab, 0x56, 0xac, 0x86, 0x59, 0xf5, - 0x3c, 0xc9, 0xff, 0x80, 0x30, 0x1f, 0x3e, 0x4d, 0x95, 0x1a, 0x2d, 0x2b, 0x7e, 0x72, 0x17, 0x8f, - 0x4a, 0x4e, 0xe3, 0x69, 0x34, 0x91, 0x9d, 0x1c, 0x9b, 0x9a, 0xcb, 0x47, 0x5b, 0xc8, 0x7c, 0xaf, - 0x2c, 0xad, 0x17, 0xea, 0xf5, 0x36, 0x35, 0x8c, 0x6a, 0x57, 0x91, 0x94, 0x7b, 0x68, 0x32, 0x8c, - 0xe6, 0xc2, 0xbe, 0x34, 0x76, 0x6c, 0x3d, 0x38, 0x3b, 0x08, 0x9f, 0x62, 0x38, 0x01, 0x96, 0x5d, - 0xc2, 0xc7, 0x1f, 0x38, 0xad, 0xa2, 0x64, 0x07, 0xc1, 0x9c, 0x1b, 0xad, 0x1e, 0x73, 0x3b, 0x20, - 0x38, 0x9f, 0xbf, 0x99, 0xc4, 0xfe, 0xfe, 0x83, 0xf0, 0xb9, 0x90, 0x80, 0x5c, 0x73, 0x63, 0x05, - 0xd6, 0xb3, 0x12, 0x99, 0x03, 0x5e, 0x89, 0x6c, 0xf2, 0x95, 0x98, 0x82, 0xf4, 0x2d, 0x53, 0xb3, - 0x0c, 0x89, 0xbf, 0x4a, 0x4d, 0xb0, 0x88, 0x8c, 0xe3, 0x43, 0xec, 0x0d, 0x60, 0x98, 0x2f, 0x56, - 0xed, 0x3f, 0xf8, 0x4f, 0xf1, 0x99, 0xc0, 0x67, 0xc0, 0xa7, 0x4f, 0xf0, 0x98, 0xa7, 0x19, 0x92, - 0x7e, 0x3a, 0x2a, 0xbc, 0xe7, 0xd1, 0xe2, 0x0b, 0x8f, 0x7f, 0x3d, 0x37, 0x52, 0xf5, 0xaa, 0x79, - 0x5f, 0xb7, 0x80, 0x78, 0xd3, 0x7a, 0xdd, 0xbe, 0x47, 0x80, 0xe8, 0x9f, 0x26, 0x0c, 0x31, 0x9b, - 0x1e, 0x62, 0x7a, 0x6f, 0xd9, 0x29, 0x7c, 0xc2, 0x59, 0xa7, 0x12, 0xdb, 0x38, 0x01, 0x95, 0x5f, - 0xc3, 0x27, 0xfd, 0x1d, 0x00, 0xb6, 0x8c, 0x0f, 0xdb, 0x2d, 0x60, 0x5e, 0x3e, 0x2a, 0x93, 0xfd, - 0x14, 0xe0, 0x80, 0x06, 0x3f, 0x03, 0x2f, 0x55, 0xd9, 0xb2, 0xce, 0xda, 0xa2, 0x57, 0xdc, 0x1d, - 0x3a, 0x30, 0xc3, 0x46, 0x9d, 0x0c, 0xdb, 0x41, 0x78, 0x22, 0xfc, 0x49, 0x88, 0xf5, 0x1e, 0x3e, - 0xd6, 0xf6, 0xf5, 0x41, 0xd4, 0x57, 0xa3, 0x46, 0xed, 0xd7, 0x86, 0xf8, 0xfb, 0x74, 0x79, 0x05, - 0x48, 0x0a, 0xaa, 0x1a, 0x46, 0x92, 0x56, 0xee, 0xfd, 0xe4, 0xb0, 0x07, 0xce, 0x35, 0x90, 0x3d, - 0x7b, 0x10, 0xec, 0xe9, 0xe5, 0xe3, 0x15, 0x9c, 0x73, 0x16, 0x75, 0x15, 0xce, 0xe3, 0x92, 0x7d, - 0x1c, 0x0f, 0xce, 0x86, 0xcf, 0x51, 0x37, 0x8f, 0xfa, 0x1e, 0x04, 0x43, 0x1a, 0xf8, 0xa8, 0xd1, - 0xdb, 0x05, 0x4b, 0x30, 0x13, 0xd5, 0x0f, 0x9f, 0x32, 0xd8, 0xe1, 0x57, 0xe5, 0xd7, 0x01, 0xa2, - 0xa0, 0xaa, 0x21, 0x10, 0x69, 0x25, 0xc2, 0x53, 0xd4, 0x4d, 0xba, 0x58, 0xd8, 0xd9, 0xf4, 0xb1, - 0xd3, 0x4b, 0x82, 0x8b, 0x78, 0xd2, 0xb3, 0xf7, 0xd8, 0x35, 0x97, 0x67, 0xf7, 0xab, 0x58, 0x2b, - 0xee, 0xec, 0x53, 0xdf, 0x22, 0xfc, 0x46, 0x84, 0xc1, 0xe0, 0xc5, 0x23, 0x84, 0x5f, 0x09, 0x1d, - 0x05, 0xeb, 0x50, 0x88, 0xb1, 0x9f, 0x05, 0x0b, 0x81, 0x41, 0xe1, 0x33, 0xf1, 0xf3, 0xdd, 0xbd, - 0xcb, 0xe9, 0x73, 0x4f, 0x74, 0x27, 0x47, 0x26, 0xf0, 0x98, 0x53, 0x67, 0xde, 0xa2, 0x9b, 0x2c, - 0xb8, 0x23, 0x55, 0x6f, 0x13, 0xff, 0x35, 0xc2, 0xaf, 0x0e, 0x90, 0x01, 0xe6, 0x26, 0x3e, 0xde, - 0xf0, 0x77, 0x02, 0xea, 0x6c, 0xdc, 0xe3, 0xc8, 0x15, 0x00, 0xc4, 0x7e, 0x65, 0xfe, 0x5e, 0x77, - 0x6b, 0x0a, 0x45, 0x4b, 0x2b, 0xfd, 0x9f, 0x39, 0x06, 0x04, 0x4f, 0x36, 0xd8, 0x80, 0xec, 0xc1, - 0x18, 0x90, 0xde, 0x6b, 0xf0, 0x3a, 0xd4, 0xf3, 0xcb, 0x92, 0x49, 0x0d, 0x33, 0xec, 0x05, 0xb8, - 0x8b, 0x5f, 0x1b, 0x38, 0x0a, 0x4c, 0xb8, 0x82, 0x4f, 0xaa, 0x81, 0x23, 0xa0, 0x6e, 0x0b, 0xe9, - 0xe5, 0x27, 0xf1, 0x79, 0x26, 0x5f, 0xa9, 0xc9, 0x25, 0xbd, 0xd9, 0xd2, 0x0d, 0xa9, 0xa6, 0xa8, - 0x8a, 0xb9, 0x79, 0x7b, 0xa3, 0xa4, 0x6b, 0x66, 0x5b, 0x92, 0x9d, 0xc2, 0x8a, 0x5f, 0xc5, 0x17, - 0xf6, 0x1d, 0x09, 0xc1, 0x4c, 0xe2, 0xa3, 0x32, 0xb4, 0x15, 0x7a, 0x8a, 0x64, 0x7f, 0xb3, 0x37, - 0x9b, 0x3e, 0x92, 0x8c, 0x66, 0x45, 0x33, 0x4c, 0x49, 0x33, 0x15, 0xc9, 0xa4, 0xe9, 0x5f, 0xa0, - 0x7e, 0x47, 0xb0, 0xef, 0x0c, 0x98, 0xcc, 0x45, 0x68, 0xf5, 0x5f, 0xa3, 0x96, 0xa3, 0x26, 0x53, - 0x90, 0x38, 0xad, 0x3b, 0x2e, 0x95, 0xf4, 0x3a, 0xad, 0xd4, 0x21, 0xbf, 0x0e, 0xe0, 0x66, 0x35, - 0xf5, 0xe5, 0x59, 0x7c, 0x88, 0x71, 0x92, 0x67, 0xa8, 0xa7, 0x48, 0x25, 0xc5, 0xa8, 0x04, 0xe1, - 0xf7, 0x01, 0xae, 0x34, 0x94, 0x86, 0x1d, 0x2e, 0x5f, 0xfa, 0xec, 0xe9, 0xf3, 0x6f, 0x32, 0x37, - 0xc8, 0x75, 0x21, 0x40, 0x4c, 0x70, 0xc5, 0x84, 0xbe, 0xcf, 0x01, 0xab, 0xd4, 0x14, 0xb6, 0x58, - 0x49, 0xb0, 0x4d, 0x7e, 0x44, 0xf8, 0x25, 0x8f, 0x78, 0x41, 0x55, 0x63, 0x02, 0x06, 0x5e, 0x20, - 0x62, 0x02, 0x06, 0xdf, 0x0e, 0xf8, 0xeb, 0x0c, 0xf0, 0x6d, 0x32, 0x9d, 0x00, 0x90, 0x7c, 0x87, - 0x9c, 0x12, 0x9c, 0xdc, 0x88, 0xeb, 0x76, 0x4f, 0x95, 0xcf, 0xbd, 0x9b, 0xf4, 0x71, 0xc0, 0xb8, - 0xc2, 0x30, 0xde, 0x22, 0xf9, 0xa8, 0x18, 0xf6, 0xd7, 0x19, 0xf2, 0x37, 0xc2, 0xc7, 0xaa, 0x7d, - 0x45, 0x64, 0xdc, 0x60, 0x42, 0xca, 0x6c, 0x6e, 0x71, 0x78, 0x21, 0xe0, 0x5b, 0x64, 0x7c, 0x45, - 0x72, 0x33, 0x2a, 0x9f, 0xbf, 0x32, 0x76, 0x93, 0xf1, 0x4f, 0x84, 0x5f, 0xf6, 0x4f, 0x63, 0x65, - 0x64, 0x39, 0x6e, 0x36, 0xa5, 0x03, 0x3d, 0xe0, 0xe2, 0xc0, 0xdf, 0x64, 0xd0, 0xd7, 0xc8, 0xd5, - 0xa4, 0xd0, 0xe4, 0x2f, 0x84, 0x8f, 0xfa, 0x8a, 0x46, 0xb2, 0x10, 0x77, 0x51, 0x82, 0x4b, 0x67, - 0xae, 0x3c, 0xb4, 0x0e, 0x60, 0x96, 0x19, 0x66, 0x81, 0xcc, 0x45, 0xc5, 0xf4, 0xd5, 0xbb, 0xee, - 0xd2, 0xfe, 0x81, 0x30, 0xf1, 0x4d, 0x62, 0xad, 0xec, 0x42, 0xdc, 0x05, 0x49, 0x05, 0x38, 0xfc, - 0x22, 0xc0, 0xcf, 0x31, 0xe0, 0x59, 0x32, 0x93, 0x10, 0x98, 0xec, 0x64, 0x06, 0x54, 0xcf, 0x64, - 0x25, 0xc1, 0x5e, 0x32, 0xb0, 0xb6, 0xe7, 0xee, 0xa4, 0xa8, 0x08, 0x1e, 0x2c, 0x33, 0x0f, 0x16, - 0xc8, 0x7c, 0x8c, 0x0d, 0x2b, 0xf4, 0xa3, 0x2f, 0xf9, 0x17, 0xe1, 0xe3, 0x7d, 0x95, 0x21, 0x59, - 0x4c, 0x7a, 0x02, 0xfa, 0xeb, 0x64, 0xae, 0x92, 0x82, 0x12, 0x80, 0xaf, 0x30, 0xf0, 0x25, 0xb2, - 0x18, 0xf7, 0xc0, 0x11, 0xdd, 0xef, 0x96, 0xc2, 0x96, 0xe7, 0xf2, 0xb1, 0x6d, 0xed, 0xe1, 0xe3, - 0x7d, 0xf3, 0x59, 0x89, 0xbf, 0x98, 0xf4, 0x80, 0x1c, 0x92, 0x7f, 0xd0, 0x25, 0x80, 0x2f, 0x32, - 0xfe, 0x77, 0xc8, 0xb5, 0xe4, 0xfc, 0xe4, 0x3f, 0x84, 0x4f, 0x06, 0x97, 0xd9, 0x64, 0x29, 0x56, - 0xa4, 0x03, 0x2b, 0x7a, 0xee, 0x56, 0x2a, 0x5a, 0xc0, 0x5d, 0x61, 0xdc, 0x25, 0x52, 0x88, 0xca, - 0x6d, 0xdf, 0x03, 0x82, 0xb2, 0xfd, 0x17, 0x84, 0x8f, 0xb8, 0x85, 0x70, 0xa2, 0x6a, 0xaa, 0xff, - 0xcb, 0x39, 0xb7, 0x34, 0xbc, 0x86, 0xcb, 0x3a, 0xcb, 0x58, 0xa7, 0xc9, 0xe5, 0xa8, 0xac, 0xdd, - 0xe2, 0xfa, 0x39, 0xc2, 0xa3, 0xdd, 0x1b, 0xc5, 0x5c, 0xac, 0xa0, 0x02, 0xa8, 0xca, 0x43, 0x0a, - 0xb8, 0x48, 0xb7, 0x19, 0x52, 0x99, 0xbc, 0x17, 0x1b, 0x49, 0xd8, 0xea, 0xfb, 0x4f, 0xc4, 0x36, - 0xf9, 0x22, 0x83, 0xb9, 0xf0, 0xfb, 0x19, 0x79, 0x3f, 0x56, 0xd8, 0xfb, 0x5e, 0x09, 0xb9, 0x0f, - 0x52, 0xd3, 0x4b, 0x6a, 0x87, 0x52, 0x93, 0x45, 0xd9, 0x2b, 0x2a, 0x36, 0x37, 0x44, 0xe7, 0x92, - 0x49, 0x1e, 0x65, 0xf0, 0x99, 0xb0, 0x9b, 0x5e, 0xa2, 0x9d, 0x2c, 0x4c, 0x8c, 0x5b, 0x49, 0x4b, - 0xc9, 0xb5, 0x62, 0x89, 0x59, 0x31, 0x4f, 0x8a, 0x51, 0xad, 0xd8, 0x90, 0x8c, 0xa6, 0xa8, 0x74, - 0x25, 0x45, 0x37, 0x55, 0x8a, 0xab, 0x8f, 0x77, 0x73, 0xe8, 0xc9, 0x6e, 0x0e, 0xfd, 0xb6, 0x9b, - 0x43, 0x5f, 0xed, 0xe5, 0x46, 0x9e, 0xec, 0xe5, 0x46, 0x7e, 0xde, 0xcb, 0x8d, 0x7c, 0x3c, 0xdb, - 0x50, 0xcc, 0xf5, 0x4e, 0x2d, 0x2f, 0xeb, 0x4d, 0x57, 0xe9, 0xcd, 0xc0, 0x79, 0x1e, 0x76, 0x67, - 0x32, 0x37, 0x5b, 0xd4, 0xa8, 0x1d, 0x66, 0xff, 0xfc, 0x9c, 0xfe, 0x3f, 0x00, 0x00, 0xff, 0xff, - 0x1d, 0xa1, 0x1f, 0x18, 0x3c, 0x1e, 0x00, 0x00, + proto.RegisterType((*QueryAllValidatorAllowlist)(nil), "wormchain.wormhole.QueryAllValidatorAllowlist") + proto.RegisterType((*QueryAllValidatorAllowlistResponse)(nil), "wormchain.wormhole.QueryAllValidatorAllowlistResponse") + proto.RegisterType((*QueryValidatorAllowlist)(nil), "wormchain.wormhole.QueryValidatorAllowlist") + proto.RegisterType((*QueryValidatorAllowlistResponse)(nil), "wormchain.wormhole.QueryValidatorAllowlistResponse") + proto.RegisterType((*QueryGetGuardianSetRequest)(nil), "wormchain.wormhole.QueryGetGuardianSetRequest") + proto.RegisterType((*QueryGetGuardianSetResponse)(nil), "wormchain.wormhole.QueryGetGuardianSetResponse") + proto.RegisterType((*QueryAllGuardianSetRequest)(nil), "wormchain.wormhole.QueryAllGuardianSetRequest") + proto.RegisterType((*QueryAllGuardianSetResponse)(nil), "wormchain.wormhole.QueryAllGuardianSetResponse") + proto.RegisterType((*QueryGetConfigRequest)(nil), "wormchain.wormhole.QueryGetConfigRequest") + proto.RegisterType((*QueryGetConfigResponse)(nil), "wormchain.wormhole.QueryGetConfigResponse") + proto.RegisterType((*QueryGetReplayProtectionRequest)(nil), "wormchain.wormhole.QueryGetReplayProtectionRequest") + proto.RegisterType((*QueryGetReplayProtectionResponse)(nil), "wormchain.wormhole.QueryGetReplayProtectionResponse") + proto.RegisterType((*QueryAllReplayProtectionRequest)(nil), "wormchain.wormhole.QueryAllReplayProtectionRequest") + proto.RegisterType((*QueryAllReplayProtectionResponse)(nil), "wormchain.wormhole.QueryAllReplayProtectionResponse") + proto.RegisterType((*QueryGetSequenceCounterRequest)(nil), "wormchain.wormhole.QueryGetSequenceCounterRequest") + proto.RegisterType((*QueryGetSequenceCounterResponse)(nil), "wormchain.wormhole.QueryGetSequenceCounterResponse") + proto.RegisterType((*QueryAllSequenceCounterRequest)(nil), "wormchain.wormhole.QueryAllSequenceCounterRequest") + proto.RegisterType((*QueryAllSequenceCounterResponse)(nil), "wormchain.wormhole.QueryAllSequenceCounterResponse") + proto.RegisterType((*QueryGetConsensusGuardianSetIndexRequest)(nil), "wormchain.wormhole.QueryGetConsensusGuardianSetIndexRequest") + proto.RegisterType((*QueryGetConsensusGuardianSetIndexResponse)(nil), "wormchain.wormhole.QueryGetConsensusGuardianSetIndexResponse") + proto.RegisterType((*QueryGetGuardianValidatorRequest)(nil), "wormchain.wormhole.QueryGetGuardianValidatorRequest") + proto.RegisterType((*QueryGetGuardianValidatorResponse)(nil), "wormchain.wormhole.QueryGetGuardianValidatorResponse") + proto.RegisterType((*QueryAllGuardianValidatorRequest)(nil), "wormchain.wormhole.QueryAllGuardianValidatorRequest") + proto.RegisterType((*QueryAllGuardianValidatorResponse)(nil), "wormchain.wormhole.QueryAllGuardianValidatorResponse") + proto.RegisterType((*QueryLatestGuardianSetIndexRequest)(nil), "wormchain.wormhole.QueryLatestGuardianSetIndexRequest") + proto.RegisterType((*QueryLatestGuardianSetIndexResponse)(nil), "wormchain.wormhole.QueryLatestGuardianSetIndexResponse") + proto.RegisterType((*QueryIbcComposabilityMwContractRequest)(nil), "wormchain.wormhole.QueryIbcComposabilityMwContractRequest") + proto.RegisterType((*QueryIbcComposabilityMwContractResponse)(nil), "wormchain.wormhole.QueryIbcComposabilityMwContractResponse") + proto.RegisterType((*QueryAllWasmInstantiateAllowlist)(nil), "wormchain.wormhole.QueryAllWasmInstantiateAllowlist") + proto.RegisterType((*QueryAllWasmInstantiateAllowlistResponse)(nil), "wormchain.wormhole.QueryAllWasmInstantiateAllowlistResponse") +} + +func init() { proto.RegisterFile("wormchain/wormhole/query.proto", fileDescriptor_c2761ec9c734bff1) } + +var fileDescriptor_c2761ec9c734bff1 = []byte{ + // 1429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x5d, 0x6f, 0xdb, 0xd4, + 0x1b, 0xef, 0x69, 0xfe, 0x9b, 0xd4, 0xd3, 0xfd, 0xd9, 0x76, 0x18, 0xdb, 0xf0, 0x50, 0xda, 0x79, + 0x63, 0xeb, 0x36, 0x2d, 0x66, 0xc9, 0xd6, 0xf5, 0x6d, 0xda, 0xd2, 0x94, 0x65, 0x19, 0x9b, 0x54, + 0x12, 0x69, 0x08, 0x04, 0xb2, 0x1c, 0xe7, 0x34, 0x35, 0x72, 0xec, 0x34, 0x76, 0xda, 0x95, 0xaa, + 0x5c, 0xf0, 0x01, 0x10, 0x12, 0x17, 0xdc, 0xf1, 0x11, 0x40, 0x88, 0x0b, 0xb8, 0x40, 0x20, 0xb1, + 0x8b, 0xed, 0x72, 0xbc, 0x5c, 0x70, 0x03, 0x42, 0xed, 0xc4, 0xe7, 0x40, 0x3e, 0x7e, 0xec, 0x38, + 0xce, 0xb1, 0x13, 0xa7, 0xe1, 0x2e, 0x3d, 0xe7, 0x79, 0xf9, 0xfd, 0x9e, 0xf3, 0xf8, 0xf1, 0xcf, + 0xa7, 0x38, 0xbd, 0x65, 0xb6, 0x1a, 0xea, 0xba, 0xa2, 0x19, 0x92, 0xf3, 0x6b, 0xdd, 0xd4, 0xa9, + 0xb4, 0xd1, 0xa6, 0xad, 0xed, 0x4c, 0xb3, 0x65, 0xda, 0x26, 0x21, 0xfe, 0x7e, 0xc6, 0xdb, 0x17, + 0x5e, 0xab, 0x9b, 0x66, 0x5d, 0xa7, 0x92, 0xd2, 0xd4, 0x24, 0xc5, 0x30, 0x4c, 0x5b, 0xb1, 0x35, + 0xd3, 0xb0, 0x5c, 0x0f, 0xe1, 0xb2, 0x6a, 0x5a, 0x0d, 0xd3, 0x92, 0xaa, 0x8a, 0x05, 0xa1, 0xa4, + 0xcd, 0x6b, 0x55, 0x6a, 0x2b, 0xd7, 0xa4, 0xa6, 0x52, 0xd7, 0x0c, 0x66, 0x0c, 0xb6, 0x67, 0x39, + 0xd9, 0xeb, 0x6d, 0xa5, 0x55, 0xd3, 0x14, 0xcf, 0x64, 0x8a, 0x63, 0xa2, 0x9a, 0xc6, 0x9a, 0x56, + 0xf7, 0xf2, 0x71, 0x0c, 0x5a, 0xb4, 0xa9, 0x2b, 0xdb, 0xb2, 0x63, 0x40, 0xd5, 0x40, 0xbe, 0x4b, + 0x1c, 0x5b, 0x8b, 0x6e, 0xb4, 0xa9, 0xa1, 0x52, 0x59, 0x35, 0xdb, 0x86, 0x4d, 0x5b, 0x60, 0x7a, + 0x83, 0x9f, 0xd7, 0xa2, 0x86, 0xd5, 0xb6, 0x64, 0x0f, 0xa4, 0x6c, 0x51, 0x5b, 0xd6, 0x8c, 0x1a, + 0x7d, 0x0c, 0x6e, 0x27, 0xea, 0x66, 0xdd, 0x64, 0x3f, 0x25, 0xe7, 0x97, 0xbb, 0x2a, 0xd6, 0xb0, + 0xf0, 0xb6, 0x53, 0x89, 0xbc, 0xae, 0x3f, 0x52, 0x74, 0xad, 0xa6, 0xd8, 0x66, 0x2b, 0xaf, 0xeb, + 0xe6, 0x96, 0xae, 0x59, 0x36, 0xb9, 0x8b, 0x71, 0xa7, 0x32, 0xa7, 0xd1, 0x34, 0x9a, 0x99, 0xcc, + 0x5e, 0xc8, 0xb8, 0x65, 0xcc, 0x38, 0x65, 0xcc, 0xb8, 0x27, 0x02, 0x65, 0xcc, 0xac, 0x2a, 0x75, + 0x5a, 0x76, 0x50, 0x5b, 0x76, 0x39, 0xe0, 0x29, 0x7e, 0x8f, 0xb0, 0x18, 0x9d, 0xa6, 0x4c, 0xad, + 0xa6, 0x83, 0x9f, 0x94, 0xf0, 0x84, 0xe2, 0x2d, 0x9e, 0x46, 0xd3, 0xa9, 0x99, 0xc9, 0xec, 0x95, + 0x4c, 0xef, 0x31, 0x67, 0xba, 0x43, 0xd0, 0x5a, 0xbe, 0x56, 0x6b, 0x51, 0xcb, 0x2a, 0x77, 0xbc, + 0x49, 0xb1, 0x0b, 0xf9, 0x38, 0x43, 0x7e, 0xb1, 0x2f, 0x72, 0x17, 0x47, 0x17, 0xf4, 0x4f, 0x11, + 0x3e, 0xc5, 0xa0, 0x73, 0xca, 0x73, 0x05, 0x1f, 0xdf, 0xf4, 0x56, 0x65, 0xc5, 0x05, 0xc1, 0xaa, + 0x34, 0x51, 0x3e, 0xe6, 0x6f, 0x00, 0xb8, 0x50, 0x2d, 0xc7, 0x87, 0xae, 0xe5, 0x1e, 0xc2, 0x53, + 0x11, 0x80, 0xfc, 0x42, 0x26, 0x02, 0xd6, 0x55, 0xf5, 0xf1, 0x11, 0x56, 0x3d, 0x35, 0x7c, 0xd5, + 0xb3, 0xd0, 0x96, 0x45, 0x6a, 0x17, 0xa1, 0xa1, 0x2b, 0xd4, 0x86, 0x72, 0x90, 0x13, 0xf8, 0x10, + 0xeb, 0x6c, 0x46, 0xe9, 0xff, 0x65, 0xf7, 0x0f, 0x71, 0x0d, 0x9f, 0xe1, 0xfa, 0x40, 0x4d, 0x8a, + 0x78, 0x32, 0xb0, 0x0c, 0xcd, 0x3c, 0xc5, 0x23, 0x1a, 0x30, 0x5b, 0xfe, 0xdf, 0xb3, 0xbf, 0xa6, + 0xc6, 0xca, 0x41, 0xcf, 0xe0, 0x23, 0xc3, 0xc1, 0x36, 0xaa, 0x47, 0xe6, 0x6b, 0x04, 0x74, 0xc2, + 0x69, 0xa2, 0xe8, 0xa4, 0x86, 0xa3, 0x33, 0xba, 0x27, 0xe5, 0x14, 0x7e, 0xc5, 0xab, 0x7f, 0x81, + 0x8d, 0x41, 0xa0, 0x25, 0x96, 0xf1, 0xc9, 0xf0, 0x06, 0x90, 0x98, 0xc3, 0x87, 0xdd, 0x15, 0x28, + 0x94, 0xc0, 0xc3, 0xef, 0x5a, 0x00, 0x74, 0xb0, 0x17, 0x6f, 0xc2, 0x43, 0x50, 0x74, 0x4a, 0xe2, + 0x8c, 0xd4, 0x55, 0x7f, 0xa2, 0x72, 0xbb, 0x64, 0xc2, 0xeb, 0x92, 0x8f, 0xf0, 0x74, 0xb4, 0x23, + 0xc0, 0x7a, 0x84, 0x8f, 0xb5, 0x42, 0x7b, 0x00, 0xf0, 0x3c, 0x0f, 0x60, 0x38, 0x0e, 0x40, 0xed, + 0x89, 0x21, 0x6a, 0x00, 0x3a, 0xaf, 0xeb, 0x51, 0xa0, 0x47, 0xd5, 0x3e, 0x4f, 0x10, 0xf0, 0xe4, + 0xe6, 0x8a, 0xe5, 0x99, 0x3a, 0x28, 0xcf, 0xd1, 0xb5, 0xd4, 0x2c, 0x4e, 0x7b, 0x87, 0x55, 0x81, + 0x97, 0x61, 0xc1, 0x7d, 0x17, 0xc6, 0x1f, 0xf2, 0x66, 0xa7, 0x3b, 0x7a, 0xfc, 0x80, 0x7b, 0x05, + 0x1f, 0xb5, 0xba, 0xb7, 0xa0, 0xda, 0xe7, 0x78, 0xd4, 0x43, 0x51, 0x80, 0x79, 0x38, 0x82, 0xb8, + 0x0e, 0x78, 0xf3, 0xba, 0x1e, 0x81, 0x77, 0x54, 0xe7, 0xfb, 0x13, 0xea, 0xf4, 0x52, 0x22, 0x8a, + 0xa9, 0x83, 0x51, 0x1c, 0xdd, 0xd9, 0x5e, 0xc6, 0x33, 0x81, 0xa9, 0xe0, 0xaa, 0x97, 0xc0, 0x5c, + 0x2a, 0x39, 0x07, 0xe9, 0x4d, 0x90, 0x2f, 0x11, 0xbe, 0x34, 0x80, 0x31, 0xf0, 0xde, 0xc0, 0xaf, + 0x46, 0x1a, 0x41, 0xc9, 0xaf, 0x46, 0x0c, 0x1a, 0xbe, 0x13, 0xd4, 0x22, 0x3a, 0xaa, 0xb8, 0xd2, + 0x99, 0x2a, 0xde, 0x9e, 0xff, 0xba, 0xf4, 0x8e, 0x7e, 0x1a, 0x4f, 0x7a, 0xe2, 0xec, 0x2d, 0xba, + 0xcd, 0x80, 0x1c, 0x29, 0x07, 0x97, 0xc4, 0x8f, 0xf1, 0xd9, 0x98, 0x28, 0xc0, 0xee, 0x5d, 0x7c, + 0xbc, 0x1e, 0xde, 0x04, 0x56, 0xaf, 0xc7, 0x8d, 0x7f, 0xdf, 0x18, 0xd8, 0xf4, 0x46, 0x11, 0x3f, + 0xec, 0xcc, 0x8c, 0x48, 0x16, 0xa3, 0x6a, 0xe0, 0xa7, 0x08, 0xc8, 0xf2, 0x93, 0xc5, 0x93, 0x4d, + 0x1d, 0x9c, 0xec, 0xe8, 0x1a, 0xf9, 0x3c, 0x68, 0xdb, 0x07, 0x8a, 0x4d, 0x2d, 0x3b, 0xaa, 0x85, + 0x3f, 0xc0, 0xe7, 0x62, 0xad, 0x80, 0xf0, 0x2c, 0x3e, 0xa9, 0x73, 0x2d, 0x40, 0xeb, 0x44, 0xec, + 0x8a, 0x33, 0xf8, 0x02, 0x0b, 0x5f, 0xaa, 0xaa, 0x05, 0xb3, 0xd1, 0x34, 0x2d, 0xa5, 0xaa, 0xe9, + 0x9a, 0xbd, 0xfd, 0x70, 0xab, 0x60, 0x1a, 0x76, 0x4b, 0x51, 0x3d, 0x81, 0x22, 0x56, 0xf0, 0xc5, + 0xbe, 0x96, 0x00, 0x66, 0x06, 0x1f, 0x55, 0x61, 0x2d, 0xdf, 0x25, 0x22, 0xc3, 0xcb, 0xc1, 0xce, + 0x79, 0x47, 0xb1, 0x1a, 0x25, 0xc3, 0xb2, 0x15, 0xc3, 0xd6, 0x14, 0x9b, 0x8e, 0xfe, 0x63, 0xe2, + 0x17, 0x04, 0x93, 0x23, 0x26, 0x99, 0x4f, 0xe1, 0xfd, 0xde, 0x4f, 0x8a, 0x39, 0x5e, 0xe3, 0xf0, + 0x02, 0xd1, 0x9a, 0x57, 0x91, 0x82, 0x59, 0xa3, 0xa5, 0x1a, 0xf4, 0xd2, 0x7f, 0xf0, 0x95, 0x91, + 0xfd, 0xee, 0x14, 0x3e, 0xc4, 0x38, 0x91, 0x6f, 0x51, 0x97, 0xb0, 0x23, 0x19, 0x1e, 0xda, 0x68, + 0x6d, 0x2c, 0x48, 0x03, 0xdb, 0xbb, 0x30, 0xc4, 0xc2, 0x27, 0xbf, 0xbd, 0xf8, 0x7c, 0xfc, 0x16, + 0x59, 0xf4, 0xbf, 0x26, 0xe5, 0x35, 0xb3, 0x6d, 0xd4, 0x18, 0x30, 0x29, 0xe6, 0x33, 0xb8, 0x42, + 0x6d, 0x69, 0x87, 0xbd, 0x6f, 0x77, 0xc9, 0x57, 0x08, 0xbf, 0x14, 0x08, 0x9e, 0xd7, 0xf5, 0x18, + 0xe0, 0x5c, 0xe1, 0x1c, 0x03, 0x9c, 0xaf, 0x80, 0xc5, 0x45, 0x06, 0xfc, 0x06, 0xc9, 0x0d, 0x01, + 0x9c, 0x7c, 0x81, 0x3c, 0xe9, 0x49, 0x2e, 0xc5, 0x55, 0xac, 0x4b, 0xc9, 0x0a, 0x97, 0x07, 0x31, + 0x05, 0x78, 0xb3, 0x0c, 0xde, 0x1b, 0x24, 0x33, 0x28, 0x3c, 0xf7, 0xee, 0x80, 0x3c, 0x45, 0xf8, + 0x58, 0x58, 0x69, 0x91, 0x5c, 0x5c, 0xe2, 0x08, 0x2d, 0x29, 0x5c, 0x4f, 0xe6, 0x04, 0xb8, 0xef, + 0x31, 0xdc, 0xcb, 0xe4, 0xce, 0xa0, 0xb8, 0xc3, 0xf2, 0xcf, 0x6f, 0x8a, 0x9f, 0x11, 0x7e, 0x39, + 0x9c, 0xc6, 0xe9, 0x8c, 0x5c, 0xdc, 0x49, 0x27, 0x27, 0x13, 0xa3, 0x70, 0xc5, 0x3b, 0x8c, 0xcc, + 0x02, 0x99, 0x1b, 0x96, 0x0c, 0x79, 0x82, 0xf0, 0xd1, 0x90, 0x34, 0x22, 0xd9, 0xb8, 0xc2, 0xf2, + 0x85, 0x9f, 0x90, 0x4b, 0xe4, 0x03, 0xf0, 0x8b, 0x0c, 0x7e, 0x9e, 0xdc, 0x1e, 0x14, 0x7e, 0x48, + 0xad, 0xf9, 0x47, 0xf1, 0x23, 0xc2, 0x24, 0x94, 0xc4, 0x39, 0x89, 0x6c, 0x5c, 0x51, 0x13, 0x13, + 0x89, 0x96, 0xa2, 0xe2, 0x6d, 0x46, 0x64, 0x9e, 0xdc, 0x1c, 0x92, 0x08, 0xf9, 0x07, 0xc5, 0x88, + 0x3a, 0xb2, 0xd4, 0xe7, 0xb9, 0x8c, 0x55, 0x97, 0xc2, 0xad, 0x21, 0xbd, 0x81, 0xdb, 0x03, 0xc6, + 0xed, 0x2e, 0x59, 0x49, 0xf0, 0xa0, 0x47, 0x5e, 0xd6, 0x91, 0x5f, 0x11, 0x3e, 0xde, 0xa3, 0x62, + 0xc8, 0xf5, 0x41, 0xa6, 0x7a, 0x58, 0xab, 0x09, 0x37, 0x12, 0x7a, 0x01, 0xa1, 0x55, 0x46, 0xe8, + 0x3e, 0xb9, 0x97, 0x74, 0xb0, 0xca, 0xfe, 0xdd, 0x92, 0xb4, 0x13, 0xd0, 0xb5, 0xbb, 0xce, 0x4c, + 0x3b, 0xd1, 0x93, 0xcf, 0x69, 0xc0, 0xeb, 0x83, 0x0c, 0xfd, 0x04, 0xbc, 0xe2, 0xc4, 0xa4, 0xb8, + 0xcc, 0x78, 0x2d, 0x91, 0x85, 0xe1, 0x79, 0x91, 0xdf, 0x11, 0x3e, 0xc9, 0x97, 0x70, 0x64, 0x36, + 0x12, 0x55, 0xac, 0x32, 0x14, 0x6e, 0x26, 0xf6, 0x03, 0x3e, 0x25, 0xc6, 0xa7, 0x40, 0xf2, 0x83, + 0xf2, 0x71, 0xb5, 0x23, 0xaf, 0xeb, 0xbe, 0x41, 0xf8, 0x88, 0x2f, 0x9e, 0xfa, 0xbe, 0xbd, 0x7b, + 0x6f, 0x1e, 0x85, 0xd9, 0x64, 0xf6, 0x3e, 0x87, 0x79, 0xc6, 0x21, 0x47, 0xae, 0x0d, 0xca, 0xa1, + 0x23, 0xbe, 0x7e, 0x40, 0x78, 0x22, 0x70, 0x17, 0x1b, 0x09, 0x80, 0x83, 0x36, 0x97, 0xc0, 0xd8, + 0x87, 0xfa, 0x90, 0x41, 0x2d, 0x92, 0x37, 0x13, 0x43, 0x95, 0x76, 0x7a, 0x6e, 0x63, 0x77, 0xc9, + 0x0b, 0x84, 0x85, 0x68, 0x0d, 0x4e, 0x16, 0x22, 0x21, 0xf6, 0x95, 0xf8, 0xc2, 0xe2, 0x50, 0xbe, + 0xc3, 0xd2, 0xd4, 0xaa, 0xaa, 0xac, 0x06, 0x83, 0xca, 0x8d, 0x2d, 0xd9, 0xfb, 0x40, 0x20, 0x7f, + 0x22, 0x7c, 0x26, 0x4a, 0xa5, 0xf7, 0x9d, 0x00, 0x51, 0x8e, 0xc2, 0xd2, 0x30, 0x5e, 0x3e, 0xc5, + 0xfb, 0x8c, 0xe2, 0x0a, 0x59, 0x1e, 0x94, 0xe2, 0x96, 0x62, 0x35, 0x64, 0xad, 0x13, 0x52, 0xf6, + 0x8f, 0x76, 0xb9, 0xf2, 0x6c, 0x2f, 0x8d, 0x9e, 0xef, 0xa5, 0xd1, 0xdf, 0x7b, 0x69, 0xf4, 0xd9, + 0x7e, 0x7a, 0xec, 0xf9, 0x7e, 0x7a, 0xec, 0x8f, 0xfd, 0xf4, 0xd8, 0x7b, 0xf3, 0x75, 0xcd, 0x5e, + 0x6f, 0x57, 0x33, 0xaa, 0xd9, 0xf0, 0x23, 0x5d, 0xe5, 0xe6, 0x79, 0xdc, 0xc9, 0x64, 0x6f, 0x37, + 0xa9, 0x55, 0x3d, 0xcc, 0xfe, 0x39, 0x93, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xac, 0xc6, + 0x64, 0x04, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1585,7 +1584,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) GuardianSet(ctx context.Context, in *QueryGetGuardianSetRequest, opts ...grpc.CallOption) (*QueryGetGuardianSetResponse, error) { out := new(QueryGetGuardianSetResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/GuardianSet", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/GuardianSet", in, out, opts...) if err != nil { return nil, err } @@ -1594,7 +1593,7 @@ func (c *queryClient) GuardianSet(ctx context.Context, in *QueryGetGuardianSetRe func (c *queryClient) GuardianSetAll(ctx context.Context, in *QueryAllGuardianSetRequest, opts ...grpc.CallOption) (*QueryAllGuardianSetResponse, error) { out := new(QueryAllGuardianSetResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/GuardianSetAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/GuardianSetAll", in, out, opts...) if err != nil { return nil, err } @@ -1603,7 +1602,7 @@ func (c *queryClient) GuardianSetAll(ctx context.Context, in *QueryAllGuardianSe func (c *queryClient) Config(ctx context.Context, in *QueryGetConfigRequest, opts ...grpc.CallOption) (*QueryGetConfigResponse, error) { out := new(QueryGetConfigResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/Config", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/Config", in, out, opts...) if err != nil { return nil, err } @@ -1612,7 +1611,7 @@ func (c *queryClient) Config(ctx context.Context, in *QueryGetConfigRequest, opt func (c *queryClient) ReplayProtection(ctx context.Context, in *QueryGetReplayProtectionRequest, opts ...grpc.CallOption) (*QueryGetReplayProtectionResponse, error) { out := new(QueryGetReplayProtectionResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/ReplayProtection", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/ReplayProtection", in, out, opts...) if err != nil { return nil, err } @@ -1621,7 +1620,7 @@ func (c *queryClient) ReplayProtection(ctx context.Context, in *QueryGetReplayPr func (c *queryClient) ReplayProtectionAll(ctx context.Context, in *QueryAllReplayProtectionRequest, opts ...grpc.CallOption) (*QueryAllReplayProtectionResponse, error) { out := new(QueryAllReplayProtectionResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/ReplayProtectionAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/ReplayProtectionAll", in, out, opts...) if err != nil { return nil, err } @@ -1630,7 +1629,7 @@ func (c *queryClient) ReplayProtectionAll(ctx context.Context, in *QueryAllRepla func (c *queryClient) SequenceCounter(ctx context.Context, in *QueryGetSequenceCounterRequest, opts ...grpc.CallOption) (*QueryGetSequenceCounterResponse, error) { out := new(QueryGetSequenceCounterResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/SequenceCounter", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/SequenceCounter", in, out, opts...) if err != nil { return nil, err } @@ -1639,7 +1638,7 @@ func (c *queryClient) SequenceCounter(ctx context.Context, in *QueryGetSequenceC func (c *queryClient) SequenceCounterAll(ctx context.Context, in *QueryAllSequenceCounterRequest, opts ...grpc.CallOption) (*QueryAllSequenceCounterResponse, error) { out := new(QueryAllSequenceCounterResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/SequenceCounterAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/SequenceCounterAll", in, out, opts...) if err != nil { return nil, err } @@ -1648,7 +1647,7 @@ func (c *queryClient) SequenceCounterAll(ctx context.Context, in *QueryAllSequen func (c *queryClient) ConsensusGuardianSetIndex(ctx context.Context, in *QueryGetConsensusGuardianSetIndexRequest, opts ...grpc.CallOption) (*QueryGetConsensusGuardianSetIndexResponse, error) { out := new(QueryGetConsensusGuardianSetIndexResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/ConsensusGuardianSetIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/ConsensusGuardianSetIndex", in, out, opts...) if err != nil { return nil, err } @@ -1657,7 +1656,7 @@ func (c *queryClient) ConsensusGuardianSetIndex(ctx context.Context, in *QueryGe func (c *queryClient) GuardianValidator(ctx context.Context, in *QueryGetGuardianValidatorRequest, opts ...grpc.CallOption) (*QueryGetGuardianValidatorResponse, error) { out := new(QueryGetGuardianValidatorResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/GuardianValidator", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/GuardianValidator", in, out, opts...) if err != nil { return nil, err } @@ -1666,7 +1665,7 @@ func (c *queryClient) GuardianValidator(ctx context.Context, in *QueryGetGuardia func (c *queryClient) GuardianValidatorAll(ctx context.Context, in *QueryAllGuardianValidatorRequest, opts ...grpc.CallOption) (*QueryAllGuardianValidatorResponse, error) { out := new(QueryAllGuardianValidatorResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/GuardianValidatorAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/GuardianValidatorAll", in, out, opts...) if err != nil { return nil, err } @@ -1675,7 +1674,7 @@ func (c *queryClient) GuardianValidatorAll(ctx context.Context, in *QueryAllGuar func (c *queryClient) LatestGuardianSetIndex(ctx context.Context, in *QueryLatestGuardianSetIndexRequest, opts ...grpc.CallOption) (*QueryLatestGuardianSetIndexResponse, error) { out := new(QueryLatestGuardianSetIndexResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/LatestGuardianSetIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/LatestGuardianSetIndex", in, out, opts...) if err != nil { return nil, err } @@ -1684,7 +1683,7 @@ func (c *queryClient) LatestGuardianSetIndex(ctx context.Context, in *QueryLates func (c *queryClient) AllowlistAll(ctx context.Context, in *QueryAllValidatorAllowlist, opts ...grpc.CallOption) (*QueryAllValidatorAllowlistResponse, error) { out := new(QueryAllValidatorAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/AllowlistAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/AllowlistAll", in, out, opts...) if err != nil { return nil, err } @@ -1693,7 +1692,7 @@ func (c *queryClient) AllowlistAll(ctx context.Context, in *QueryAllValidatorAll func (c *queryClient) Allowlist(ctx context.Context, in *QueryValidatorAllowlist, opts ...grpc.CallOption) (*QueryValidatorAllowlistResponse, error) { out := new(QueryValidatorAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/Allowlist", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/Allowlist", in, out, opts...) if err != nil { return nil, err } @@ -1702,7 +1701,7 @@ func (c *queryClient) Allowlist(ctx context.Context, in *QueryValidatorAllowlist func (c *queryClient) IbcComposabilityMwContract(ctx context.Context, in *QueryIbcComposabilityMwContractRequest, opts ...grpc.CallOption) (*QueryIbcComposabilityMwContractResponse, error) { out := new(QueryIbcComposabilityMwContractResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/IbcComposabilityMwContract", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/IbcComposabilityMwContract", in, out, opts...) if err != nil { return nil, err } @@ -1711,7 +1710,7 @@ func (c *queryClient) IbcComposabilityMwContract(ctx context.Context, in *QueryI func (c *queryClient) WasmInstantiateAllowlistAll(ctx context.Context, in *QueryAllWasmInstantiateAllowlist, opts ...grpc.CallOption) (*QueryAllWasmInstantiateAllowlistResponse, error) { out := new(QueryAllWasmInstantiateAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/WasmInstantiateAllowlistAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Query/WasmInstantiateAllowlistAll", in, out, opts...) if err != nil { return nil, err } @@ -1812,7 +1811,7 @@ func _Query_GuardianSet_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/GuardianSet", + FullMethod: "/wormchain.wormhole.Query/GuardianSet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).GuardianSet(ctx, req.(*QueryGetGuardianSetRequest)) @@ -1830,7 +1829,7 @@ func _Query_GuardianSetAll_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/GuardianSetAll", + FullMethod: "/wormchain.wormhole.Query/GuardianSetAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).GuardianSetAll(ctx, req.(*QueryAllGuardianSetRequest)) @@ -1848,7 +1847,7 @@ func _Query_Config_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/Config", + FullMethod: "/wormchain.wormhole.Query/Config", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Config(ctx, req.(*QueryGetConfigRequest)) @@ -1866,7 +1865,7 @@ func _Query_ReplayProtection_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/ReplayProtection", + FullMethod: "/wormchain.wormhole.Query/ReplayProtection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ReplayProtection(ctx, req.(*QueryGetReplayProtectionRequest)) @@ -1884,7 +1883,7 @@ func _Query_ReplayProtectionAll_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/ReplayProtectionAll", + FullMethod: "/wormchain.wormhole.Query/ReplayProtectionAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ReplayProtectionAll(ctx, req.(*QueryAllReplayProtectionRequest)) @@ -1902,7 +1901,7 @@ func _Query_SequenceCounter_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/SequenceCounter", + FullMethod: "/wormchain.wormhole.Query/SequenceCounter", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).SequenceCounter(ctx, req.(*QueryGetSequenceCounterRequest)) @@ -1920,7 +1919,7 @@ func _Query_SequenceCounterAll_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/SequenceCounterAll", + FullMethod: "/wormchain.wormhole.Query/SequenceCounterAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).SequenceCounterAll(ctx, req.(*QueryAllSequenceCounterRequest)) @@ -1938,7 +1937,7 @@ func _Query_ConsensusGuardianSetIndex_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/ConsensusGuardianSetIndex", + FullMethod: "/wormchain.wormhole.Query/ConsensusGuardianSetIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ConsensusGuardianSetIndex(ctx, req.(*QueryGetConsensusGuardianSetIndexRequest)) @@ -1956,7 +1955,7 @@ func _Query_GuardianValidator_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/GuardianValidator", + FullMethod: "/wormchain.wormhole.Query/GuardianValidator", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).GuardianValidator(ctx, req.(*QueryGetGuardianValidatorRequest)) @@ -1974,7 +1973,7 @@ func _Query_GuardianValidatorAll_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/GuardianValidatorAll", + FullMethod: "/wormchain.wormhole.Query/GuardianValidatorAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).GuardianValidatorAll(ctx, req.(*QueryAllGuardianValidatorRequest)) @@ -1992,7 +1991,7 @@ func _Query_LatestGuardianSetIndex_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/LatestGuardianSetIndex", + FullMethod: "/wormchain.wormhole.Query/LatestGuardianSetIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).LatestGuardianSetIndex(ctx, req.(*QueryLatestGuardianSetIndexRequest)) @@ -2010,7 +2009,7 @@ func _Query_AllowlistAll_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/AllowlistAll", + FullMethod: "/wormchain.wormhole.Query/AllowlistAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AllowlistAll(ctx, req.(*QueryAllValidatorAllowlist)) @@ -2028,7 +2027,7 @@ func _Query_Allowlist_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/Allowlist", + FullMethod: "/wormchain.wormhole.Query/Allowlist", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Allowlist(ctx, req.(*QueryValidatorAllowlist)) @@ -2046,7 +2045,7 @@ func _Query_IbcComposabilityMwContract_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/IbcComposabilityMwContract", + FullMethod: "/wormchain.wormhole.Query/IbcComposabilityMwContract", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).IbcComposabilityMwContract(ctx, req.(*QueryIbcComposabilityMwContractRequest)) @@ -2064,7 +2063,7 @@ func _Query_WasmInstantiateAllowlistAll_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/WasmInstantiateAllowlistAll", + FullMethod: "/wormchain.wormhole.Query/WasmInstantiateAllowlistAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).WasmInstantiateAllowlistAll(ctx, req.(*QueryAllWasmInstantiateAllowlist)) @@ -2072,8 +2071,9 @@ func _Query_WasmInstantiateAllowlistAll_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wormhole_foundation.wormchain.wormhole.Query", + ServiceName: "wormchain.wormhole.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -2138,7 +2138,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "wormhole/query.proto", + Metadata: "wormchain/wormhole/query.proto", } func (m *QueryAllValidatorAllowlist) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/query.pb.gw.go b/wormchain/x/wormhole/types/query.pb.gw.go index 6fae71d882..ca38c2391b 100644 --- a/wormchain/x/wormhole/types/query.pb.gw.go +++ b/wormchain/x/wormhole/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: wormhole/query.proto +// source: wormchain/wormhole/query.proto /* Package types is a reverse proxy. diff --git a/wormchain/x/wormhole/types/replay_protection.pb.go b/wormchain/x/wormhole/types/replay_protection.pb.go index 04cbe81852..643c6bb7e1 100644 --- a/wormchain/x/wormhole/types/replay_protection.pb.go +++ b/wormchain/x/wormhole/types/replay_protection.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/replay_protection.proto +// source: wormchain/wormhole/replay_protection.proto package types import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -30,7 +30,7 @@ func (m *ReplayProtection) Reset() { *m = ReplayProtection{} } func (m *ReplayProtection) String() string { return proto.CompactTextString(m) } func (*ReplayProtection) ProtoMessage() {} func (*ReplayProtection) Descriptor() ([]byte, []int) { - return fileDescriptor_da495f697a0fb01c, []int{0} + return fileDescriptor_579847062c7cef9e, []int{0} } func (m *ReplayProtection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -67,24 +67,26 @@ func (m *ReplayProtection) GetIndex() string { } func init() { - proto.RegisterType((*ReplayProtection)(nil), "wormhole_foundation.wormchain.wormhole.ReplayProtection") + proto.RegisterType((*ReplayProtection)(nil), "wormchain.wormhole.ReplayProtection") } -func init() { proto.RegisterFile("wormhole/replay_protection.proto", fileDescriptor_da495f697a0fb01c) } +func init() { + proto.RegisterFile("wormchain/wormhole/replay_protection.proto", fileDescriptor_579847062c7cef9e) +} -var fileDescriptor_da495f697a0fb01c = []byte{ - // 170 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x2f, 0x4a, 0x2d, 0xc8, 0x49, 0xac, 0x8c, 0x2f, 0x28, 0xca, 0x2f, - 0x49, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x31, 0xf3, 0x85, 0xd4, 0x60, 0x2a, 0xe2, 0xd3, - 0xf2, 0x4b, 0xf3, 0x52, 0x12, 0xc1, 0x52, 0x20, 0xb1, 0xe4, 0x8c, 0xc4, 0x4c, 0x08, 0x0b, 0x24, - 0xab, 0xa4, 0xc1, 0x25, 0x10, 0x04, 0x36, 0x22, 0x00, 0x6e, 0x82, 0x90, 0x08, 0x17, 0x6b, 0x66, - 0x5e, 0x4a, 0x6a, 0x85, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x84, 0xe3, 0x14, 0x7c, 0xe2, - 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, - 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x30, 0x83, 0x75, 0x11, 0xd6, 0xea, 0xc3, 0xad, 0xd5, 0xaf, 0x80, - 0xcb, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x5d, 0x6b, 0x0c, 0x08, 0x00, 0x00, - 0xff, 0xff, 0xca, 0x3f, 0x36, 0x04, 0xd1, 0x00, 0x00, 0x00, +var fileDescriptor_579847062c7cef9e = []byte{ + // 166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2a, 0xcf, 0x2f, 0xca, + 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x07, 0xb1, 0x32, 0xf2, 0x73, 0x52, 0xf5, 0x8b, 0x52, 0x0b, + 0x72, 0x12, 0x2b, 0xe3, 0x0b, 0x8a, 0xf2, 0x4b, 0x52, 0x93, 0x4b, 0x32, 0xf3, 0xf3, 0xf4, 0x40, + 0xcc, 0x7c, 0x21, 0x21, 0xb8, 0x5a, 0x3d, 0x98, 0x5a, 0x25, 0x0d, 0x2e, 0x81, 0x20, 0xb0, 0xf2, + 0x00, 0xb8, 0x6a, 0x21, 0x11, 0x2e, 0xd6, 0xcc, 0xbc, 0x94, 0xd4, 0x0a, 0x09, 0x46, 0x05, 0x46, + 0x0d, 0xce, 0x20, 0x08, 0xc7, 0x29, 0xf8, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, + 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, + 0xa2, 0x2c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xe1, 0x8e, 0xd0, 0x4d, + 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x04, 0x99, 0xa7, 0x8f, 0x70, 0x62, 0x05, 0xc2, 0x91, 0x25, 0x95, + 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x97, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xe0, + 0x39, 0xef, 0xc7, 0x00, 0x00, 0x00, } func (m *ReplayProtection) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/sequence_counter.pb.go b/wormchain/x/wormhole/types/sequence_counter.pb.go index 7b9b34ff9b..f4071dffe9 100644 --- a/wormchain/x/wormhole/types/sequence_counter.pb.go +++ b/wormchain/x/wormhole/types/sequence_counter.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/sequence_counter.proto +// source: wormchain/wormhole/sequence_counter.proto package types import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" @@ -31,7 +31,7 @@ func (m *SequenceCounter) Reset() { *m = SequenceCounter{} } func (m *SequenceCounter) String() string { return proto.CompactTextString(m) } func (*SequenceCounter) ProtoMessage() {} func (*SequenceCounter) Descriptor() ([]byte, []int) { - return fileDescriptor_adec725923edb1a5, []int{0} + return fileDescriptor_ebba1d08bd6de1aa, []int{0} } func (m *SequenceCounter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,25 +75,27 @@ func (m *SequenceCounter) GetSequence() uint64 { } func init() { - proto.RegisterType((*SequenceCounter)(nil), "wormhole_foundation.wormchain.wormhole.SequenceCounter") + proto.RegisterType((*SequenceCounter)(nil), "wormchain.wormhole.SequenceCounter") } -func init() { proto.RegisterFile("wormhole/sequence_counter.proto", fileDescriptor_adec725923edb1a5) } +func init() { + proto.RegisterFile("wormchain/wormhole/sequence_counter.proto", fileDescriptor_ebba1d08bd6de1aa) +} -var fileDescriptor_adec725923edb1a5 = []byte{ - // 190 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x8d, 0x4f, 0xce, - 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x29, 0x88, - 0x4f, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25, 0x67, 0x24, - 0x66, 0x42, 0x58, 0x20, 0x59, 0x25, 0x67, 0x2e, 0xfe, 0x60, 0xa8, 0x09, 0xce, 0x10, 0x03, 0x84, - 0x44, 0xb8, 0x58, 0x33, 0xf3, 0x52, 0x52, 0x2b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x20, - 0x1c, 0x21, 0x29, 0x2e, 0x0e, 0x98, 0x55, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x70, 0xbe, - 0x53, 0xf0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, - 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa6, 0x67, 0x96, - 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xec, 0xd4, 0x45, 0xb8, 0x48, 0x1f, 0xee, - 0x22, 0xfd, 0x0a, 0xb8, 0xbc, 0x7e, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x23, 0xc6, - 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x9e, 0xfe, 0x1f, 0xeb, 0x00, 0x00, 0x00, +var fileDescriptor_ebba1d08bd6de1aa = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2c, 0xcf, 0x2f, 0xca, + 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x07, 0xb1, 0x32, 0xf2, 0x73, 0x52, 0xf5, 0x8b, 0x53, 0x0b, + 0x4b, 0x53, 0xf3, 0x92, 0x53, 0xe3, 0x93, 0xf3, 0x4b, 0xf3, 0x4a, 0x52, 0x8b, 0xf4, 0x0a, 0x8a, + 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0xe0, 0x4a, 0xf5, 0x60, 0x4a, 0x95, 0x9c, 0xb9, 0xf8, 0x83, 0xa1, + 0xaa, 0x9d, 0x21, 0x8a, 0x85, 0x44, 0xb8, 0x58, 0x33, 0xf3, 0x52, 0x52, 0x2b, 0x24, 0x18, 0x15, + 0x18, 0x35, 0x38, 0x83, 0x20, 0x1c, 0x21, 0x29, 0x2e, 0x0e, 0x98, 0xb1, 0x12, 0x4c, 0x0a, 0x8c, + 0x1a, 0x2c, 0x41, 0x70, 0xbe, 0x53, 0xf0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, + 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, + 0x44, 0x59, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xc2, 0x9d, 0xa7, 0x9b, + 0x96, 0x5f, 0x9a, 0x97, 0x92, 0x58, 0x92, 0x99, 0x0f, 0x71, 0x32, 0xc4, 0xf1, 0x15, 0x08, 0xe7, + 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0xd5, 0x7a, 0xa7, 0x65, 0xe1, 0x00, 0x00, 0x00, } func (m *SequenceCounter) Marshal() (dAtA []byte, err error) { diff --git a/wormchain/x/wormhole/types/tx.pb.go b/wormchain/x/wormhole/types/tx.pb.go index 692ae7bfa3..4cd7433e39 100644 --- a/wormchain/x/wormhole/types/tx.pb.go +++ b/wormchain/x/wormhole/types/tx.pb.go @@ -1,14 +1,16 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/tx.proto +// source: wormchain/wormhole/tx.proto package types import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -35,7 +37,7 @@ func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } func (*EmptyResponse) ProtoMessage() {} func (*EmptyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{0} + return fileDescriptor_7262ffc699166207, []int{0} } func (m *EmptyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +79,7 @@ func (m *MsgCreateAllowlistEntryRequest) Reset() { *m = MsgCreateAllowli func (m *MsgCreateAllowlistEntryRequest) String() string { return proto.CompactTextString(m) } func (*MsgCreateAllowlistEntryRequest) ProtoMessage() {} func (*MsgCreateAllowlistEntryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{1} + return fileDescriptor_7262ffc699166207, []int{1} } func (m *MsgCreateAllowlistEntryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -138,7 +140,7 @@ func (m *MsgDeleteAllowlistEntryRequest) Reset() { *m = MsgDeleteAllowli func (m *MsgDeleteAllowlistEntryRequest) String() string { return proto.CompactTextString(m) } func (*MsgDeleteAllowlistEntryRequest) ProtoMessage() {} func (*MsgDeleteAllowlistEntryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{2} + return fileDescriptor_7262ffc699166207, []int{2} } func (m *MsgDeleteAllowlistEntryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,7 +190,7 @@ func (m *MsgAllowlistResponse) Reset() { *m = MsgAllowlistResponse{} } func (m *MsgAllowlistResponse) String() string { return proto.CompactTextString(m) } func (*MsgAllowlistResponse) ProtoMessage() {} func (*MsgAllowlistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{3} + return fileDescriptor_7262ffc699166207, []int{3} } func (m *MsgAllowlistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -226,7 +228,7 @@ func (m *MsgExecuteGovernanceVAA) Reset() { *m = MsgExecuteGovernanceVAA func (m *MsgExecuteGovernanceVAA) String() string { return proto.CompactTextString(m) } func (*MsgExecuteGovernanceVAA) ProtoMessage() {} func (*MsgExecuteGovernanceVAA) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{4} + return fileDescriptor_7262ffc699166207, []int{4} } func (m *MsgExecuteGovernanceVAA) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,7 +278,7 @@ func (m *MsgExecuteGovernanceVAAResponse) Reset() { *m = MsgExecuteGover func (m *MsgExecuteGovernanceVAAResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteGovernanceVAAResponse) ProtoMessage() {} func (*MsgExecuteGovernanceVAAResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{5} + return fileDescriptor_7262ffc699166207, []int{5} } func (m *MsgExecuteGovernanceVAAResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -314,7 +316,7 @@ func (m *MsgRegisterAccountAsGuardian) Reset() { *m = MsgRegisterAccount func (m *MsgRegisterAccountAsGuardian) String() string { return proto.CompactTextString(m) } func (*MsgRegisterAccountAsGuardian) ProtoMessage() {} func (*MsgRegisterAccountAsGuardian) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{6} + return fileDescriptor_7262ffc699166207, []int{6} } func (m *MsgRegisterAccountAsGuardian) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -364,7 +366,7 @@ func (m *MsgRegisterAccountAsGuardianResponse) Reset() { *m = MsgRegiste func (m *MsgRegisterAccountAsGuardianResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterAccountAsGuardianResponse) ProtoMessage() {} func (*MsgRegisterAccountAsGuardianResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{7} + return fileDescriptor_7262ffc699166207, []int{7} } func (m *MsgRegisterAccountAsGuardianResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +401,8 @@ type MsgStoreCode struct { Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // WASMByteCode can be raw or gzip compressed WASMByteCode []byte `protobuf:"bytes,2,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` - // vaa must be governance msg with payload containing sha3 256 hash of `wasm_byte_code` + // vaa must be governance msg with payload containing sha3 256 hash of + // `wasm_byte_code` Vaa []byte `protobuf:"bytes,3,opt,name=vaa,proto3" json:"vaa,omitempty"` } @@ -407,7 +410,7 @@ func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} } func (m *MsgStoreCode) String() string { return proto.CompactTextString(m) } func (*MsgStoreCode) ProtoMessage() {} func (*MsgStoreCode) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{8} + return fileDescriptor_7262ffc699166207, []int{8} } func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -468,7 +471,7 @@ func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } func (m *MsgStoreCodeResponse) String() string { return proto.CompactTextString(m) } func (*MsgStoreCodeResponse) ProtoMessage() {} func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{9} + return fileDescriptor_7262ffc699166207, []int{9} } func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -521,7 +524,8 @@ type MsgInstantiateContract struct { Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // Msg json encoded message to be passed to the contract on instantiation Msg []byte `protobuf:"bytes,5,opt,name=msg,proto3" json:"msg,omitempty"` - // vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Label), Msg) + // vaa must be governance msg with payload containing keccak256 + // hash(hash(hash(BigEndian(CodeID)), Label), Msg) Vaa []byte `protobuf:"bytes,6,opt,name=vaa,proto3" json:"vaa,omitempty"` } @@ -529,7 +533,7 @@ func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} func (m *MsgInstantiateContract) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContract) ProtoMessage() {} func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{10} + return fileDescriptor_7262ffc699166207, []int{10} } func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -604,7 +608,7 @@ func (m *MsgInstantiateContractResponse) Reset() { *m = MsgInstantiateCo func (m *MsgInstantiateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContractResponse) ProtoMessage() {} func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{11} + return fileDescriptor_7262ffc699166207, []int{11} } func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -650,7 +654,8 @@ func (m *MsgInstantiateContractResponse) GetData() []byte { type MsgAddWasmInstantiateAllowlist struct { // Signer is the actor that signed the messages Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - // Address is the bech32 address of the contract that can call wasm instantiate without a VAA + // Address is the bech32 address of the contract that can call wasm + // instantiate without a VAA Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // CodeID is the reference to the stored WASM code that can be instantiated CodeId uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` @@ -662,7 +667,7 @@ func (m *MsgAddWasmInstantiateAllowlist) Reset() { *m = MsgAddWasmInstan func (m *MsgAddWasmInstantiateAllowlist) String() string { return proto.CompactTextString(m) } func (*MsgAddWasmInstantiateAllowlist) ProtoMessage() {} func (*MsgAddWasmInstantiateAllowlist) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{12} + return fileDescriptor_7262ffc699166207, []int{12} } func (m *MsgAddWasmInstantiateAllowlist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -733,7 +738,7 @@ func (m *MsgDeleteWasmInstantiateAllowlist) Reset() { *m = MsgDeleteWasm func (m *MsgDeleteWasmInstantiateAllowlist) String() string { return proto.CompactTextString(m) } func (*MsgDeleteWasmInstantiateAllowlist) ProtoMessage() {} func (*MsgDeleteWasmInstantiateAllowlist) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{13} + return fileDescriptor_7262ffc699166207, []int{13} } func (m *MsgDeleteWasmInstantiateAllowlist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -797,7 +802,7 @@ func (m *MsgWasmInstantiateAllowlistResponse) Reset() { *m = MsgWasmInst func (m *MsgWasmInstantiateAllowlistResponse) String() string { return proto.CompactTextString(m) } func (*MsgWasmInstantiateAllowlistResponse) ProtoMessage() {} func (*MsgWasmInstantiateAllowlistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{14} + return fileDescriptor_7262ffc699166207, []int{14} } func (m *MsgWasmInstantiateAllowlistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +841,8 @@ type MsgMigrateContract struct { CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` // Msg json encoded message to be passed to the contract on migration Msg []byte `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` - // vaa must be governance msg with payload containing keccak256 hash(hash(hash(BigEndian(CodeID)), Contract), Msg) + // vaa must be governance msg with payload containing keccak256 + // hash(hash(hash(BigEndian(CodeID)), Contract), Msg) Vaa []byte `protobuf:"bytes,6,opt,name=vaa,proto3" json:"vaa,omitempty"` } @@ -844,7 +850,7 @@ func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } func (m *MsgMigrateContract) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContract) ProtoMessage() {} func (*MsgMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{15} + return fileDescriptor_7262ffc699166207, []int{15} } func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -919,7 +925,7 @@ func (m *MsgMigrateContractResponse) Reset() { *m = MsgMigrateContractRe func (m *MsgMigrateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContractResponse) ProtoMessage() {} func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{16} + return fileDescriptor_7262ffc699166207, []int{16} } func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -966,7 +972,7 @@ func (m *MsgExecuteGatewayGovernanceVaa) Reset() { *m = MsgExecuteGatewa func (m *MsgExecuteGatewayGovernanceVaa) String() string { return proto.CompactTextString(m) } func (*MsgExecuteGatewayGovernanceVaa) ProtoMessage() {} func (*MsgExecuteGatewayGovernanceVaa) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{17} + return fileDescriptor_7262ffc699166207, []int{17} } func (m *MsgExecuteGatewayGovernanceVaa) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1009,84 +1015,232 @@ func (m *MsgExecuteGatewayGovernanceVaa) GetVaa() []byte { return nil } +// GuardianSetUpdateProposal defines a guardian set update governance proposal +type MsgGuardianSetUpdateProposal struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + NewGuardianSet GuardianSet `protobuf:"bytes,2,opt,name=newGuardianSet,proto3" json:"newGuardianSet"` +} + +func (m *MsgGuardianSetUpdateProposal) Reset() { *m = MsgGuardianSetUpdateProposal{} } +func (m *MsgGuardianSetUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*MsgGuardianSetUpdateProposal) ProtoMessage() {} +func (*MsgGuardianSetUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_7262ffc699166207, []int{18} +} +func (m *MsgGuardianSetUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGuardianSetUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGuardianSetUpdateProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGuardianSetUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGuardianSetUpdateProposal.Merge(m, src) +} +func (m *MsgGuardianSetUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgGuardianSetUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGuardianSetUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGuardianSetUpdateProposal proto.InternalMessageInfo + +func (m *MsgGuardianSetUpdateProposal) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgGuardianSetUpdateProposal) GetNewGuardianSet() GuardianSet { + if m != nil { + return m.NewGuardianSet + } + return GuardianSet{} +} + +// GovernanceWormholeMessageProposal defines a governance proposal to emit a +// generic message in the governance message format. +type MsgGovernanceWormholeMessageProposal struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Action uint32 `protobuf:"varint,2,opt,name=action,proto3" json:"action,omitempty"` + Module []byte `protobuf:"bytes,3,opt,name=module,proto3" json:"module,omitempty"` + TargetChain uint32 `protobuf:"varint,4,opt,name=targetChain,proto3" json:"targetChain,omitempty"` + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *MsgGovernanceWormholeMessageProposal) Reset() { *m = MsgGovernanceWormholeMessageProposal{} } +func (m *MsgGovernanceWormholeMessageProposal) String() string { return proto.CompactTextString(m) } +func (*MsgGovernanceWormholeMessageProposal) ProtoMessage() {} +func (*MsgGovernanceWormholeMessageProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_7262ffc699166207, []int{19} +} +func (m *MsgGovernanceWormholeMessageProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovernanceWormholeMessageProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovernanceWormholeMessageProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGovernanceWormholeMessageProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovernanceWormholeMessageProposal.Merge(m, src) +} +func (m *MsgGovernanceWormholeMessageProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgGovernanceWormholeMessageProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovernanceWormholeMessageProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovernanceWormholeMessageProposal proto.InternalMessageInfo + +func (m *MsgGovernanceWormholeMessageProposal) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgGovernanceWormholeMessageProposal) GetAction() uint32 { + if m != nil { + return m.Action + } + return 0 +} + +func (m *MsgGovernanceWormholeMessageProposal) GetModule() []byte { + if m != nil { + return m.Module + } + return nil +} + +func (m *MsgGovernanceWormholeMessageProposal) GetTargetChain() uint32 { + if m != nil { + return m.TargetChain + } + return 0 +} + +func (m *MsgGovernanceWormholeMessageProposal) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + func init() { - proto.RegisterType((*EmptyResponse)(nil), "wormhole_foundation.wormchain.wormhole.EmptyResponse") - proto.RegisterType((*MsgCreateAllowlistEntryRequest)(nil), "wormhole_foundation.wormchain.wormhole.MsgCreateAllowlistEntryRequest") - proto.RegisterType((*MsgDeleteAllowlistEntryRequest)(nil), "wormhole_foundation.wormchain.wormhole.MsgDeleteAllowlistEntryRequest") - proto.RegisterType((*MsgAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgAllowlistResponse") - proto.RegisterType((*MsgExecuteGovernanceVAA)(nil), "wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAA") - proto.RegisterType((*MsgExecuteGovernanceVAAResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAAResponse") - proto.RegisterType((*MsgRegisterAccountAsGuardian)(nil), "wormhole_foundation.wormchain.wormhole.MsgRegisterAccountAsGuardian") - proto.RegisterType((*MsgRegisterAccountAsGuardianResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgRegisterAccountAsGuardianResponse") - proto.RegisterType((*MsgStoreCode)(nil), "wormhole_foundation.wormchain.wormhole.MsgStoreCode") - proto.RegisterType((*MsgStoreCodeResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgStoreCodeResponse") - proto.RegisterType((*MsgInstantiateContract)(nil), "wormhole_foundation.wormchain.wormhole.MsgInstantiateContract") - proto.RegisterType((*MsgInstantiateContractResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgInstantiateContractResponse") - proto.RegisterType((*MsgAddWasmInstantiateAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.MsgAddWasmInstantiateAllowlist") - proto.RegisterType((*MsgDeleteWasmInstantiateAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist") - proto.RegisterType((*MsgWasmInstantiateAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgWasmInstantiateAllowlistResponse") - proto.RegisterType((*MsgMigrateContract)(nil), "wormhole_foundation.wormchain.wormhole.MsgMigrateContract") - proto.RegisterType((*MsgMigrateContractResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgMigrateContractResponse") - proto.RegisterType((*MsgExecuteGatewayGovernanceVaa)(nil), "wormhole_foundation.wormchain.wormhole.MsgExecuteGatewayGovernanceVaa") -} - -func init() { proto.RegisterFile("wormhole/tx.proto", fileDescriptor_55f7aa067b0c517b) } - -var fileDescriptor_55f7aa067b0c517b = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0xee, 0x34, 0xb9, 0xb9, 0xf4, 0x28, 0x70, 0x2f, 0x26, 0xea, 0x0d, 0xbe, 0x57, 0x2e, 0x75, - 0xa1, 0x62, 0x43, 0x82, 0xf8, 0x93, 0x40, 0x08, 0x94, 0xf4, 0x4f, 0x01, 0xcc, 0xc2, 0x45, 0x54, - 0x62, 0x13, 0x4d, 0xec, 0xe9, 0xc4, 0x22, 0xf6, 0x04, 0xcf, 0xb8, 0x69, 0x16, 0x08, 0xde, 0x00, - 0xba, 0x07, 0x89, 0x37, 0x40, 0x62, 0xc5, 0x23, 0xb0, 0xec, 0x92, 0x05, 0xaa, 0x50, 0xfa, 0x22, - 0xc8, 0x93, 0x78, 0xe2, 0x36, 0x71, 0x1a, 0xb7, 0x15, 0x77, 0x37, 0x33, 0xf6, 0xf9, 0xbe, 0xef, - 0x1c, 0x7f, 0x73, 0x8e, 0x0c, 0x2f, 0x0f, 0x58, 0xe8, 0x77, 0x59, 0x8f, 0xd4, 0xc5, 0x69, 0xad, - 0x1f, 0x32, 0xc1, 0xb4, 0xed, 0xe4, 0xa8, 0x7d, 0xcc, 0xa2, 0xc0, 0xc5, 0xc2, 0x63, 0x41, 0x2d, - 0x3e, 0x73, 0xba, 0xd8, 0x1b, 0xaf, 0xe2, 0xa7, 0x7a, 0x85, 0x32, 0xca, 0x64, 0x48, 0x3d, 0x5e, - 0x8d, 0xa3, 0xcd, 0x47, 0xf0, 0xe2, 0x9e, 0xdf, 0x17, 0x43, 0x9b, 0xf0, 0x3e, 0x0b, 0x38, 0x31, - 0x8f, 0xc1, 0xb0, 0x38, 0xdd, 0x09, 0x09, 0x16, 0xa4, 0xd1, 0xeb, 0xb1, 0x41, 0xcf, 0xe3, 0x62, - 0x2f, 0x10, 0xe1, 0xd0, 0x26, 0xdf, 0x45, 0x84, 0x0b, 0x6d, 0x1d, 0x4a, 0xdc, 0xa3, 0x01, 0x09, - 0xab, 0xe8, 0x35, 0xf4, 0xe6, 0x9a, 0x3d, 0xd9, 0x69, 0x55, 0x78, 0x88, 0x5d, 0x37, 0x24, 0x9c, - 0x57, 0x57, 0xe5, 0x83, 0x64, 0xab, 0x69, 0x50, 0x0c, 0xb0, 0x4f, 0xaa, 0x05, 0x79, 0x2c, 0xd7, - 0xa6, 0x2d, 0x79, 0x76, 0x49, 0x8f, 0xdc, 0x1b, 0x8f, 0xb9, 0x0e, 0x15, 0x8b, 0x53, 0x85, 0xa6, - 0x72, 0xda, 0x81, 0x27, 0x16, 0xa7, 0x7b, 0xa7, 0xc4, 0x89, 0x04, 0x39, 0x60, 0x27, 0x24, 0x0c, - 0x70, 0xe0, 0x90, 0xaf, 0x1b, 0x0d, 0xed, 0x31, 0x14, 0x4e, 0x30, 0x96, 0x0c, 0x65, 0x3b, 0x5e, - 0xa6, 0x68, 0x57, 0xd3, 0xb4, 0xe6, 0x26, 0x6c, 0x64, 0x80, 0x28, 0x9e, 0xaf, 0xe0, 0x99, 0xc5, - 0xa9, 0x4d, 0xa8, 0xc7, 0x05, 0x09, 0x1b, 0x8e, 0xc3, 0xa2, 0x40, 0x34, 0xf8, 0x41, 0x84, 0x43, - 0xd7, 0xc3, 0x41, 0x66, 0x46, 0xcf, 0x60, 0x2d, 0x5e, 0x61, 0x11, 0x85, 0xe3, 0x22, 0x95, 0xed, - 0xe9, 0x81, 0xb9, 0x0d, 0xaf, 0x2f, 0x42, 0x55, 0xec, 0x7d, 0x28, 0x5b, 0x9c, 0x1e, 0x0a, 0x16, - 0x92, 0x1d, 0xe6, 0x92, 0x4c, 0xb6, 0x0f, 0xe0, 0xa5, 0x01, 0xe6, 0x7e, 0xbb, 0x33, 0x14, 0xa4, - 0xed, 0x30, 0x97, 0xc8, 0x44, 0xcb, 0xcd, 0xc7, 0xa3, 0x8b, 0x8d, 0xf2, 0x51, 0xe3, 0xd0, 0x6a, - 0x0e, 0x85, 0x44, 0xb0, 0xcb, 0xf1, 0x7b, 0xc9, 0x2e, 0x29, 0x55, 0x41, 0x95, 0xca, 0x3c, 0x92, - 0xf5, 0x56, 0x8c, 0x89, 0x12, 0x6d, 0x0b, 0x1e, 0xc6, 0xb8, 0x6d, 0xcf, 0x95, 0xd4, 0xc5, 0x26, - 0x8c, 0x2e, 0x36, 0x4a, 0xf1, 0x2b, 0xad, 0x5d, 0xbb, 0x14, 0x3f, 0x6a, 0xb9, 0x9a, 0x0e, 0x2f, - 0x38, 0x5d, 0xe2, 0x7c, 0xcb, 0x23, 0x7f, 0x2c, 0xc0, 0x56, 0x7b, 0xf3, 0x27, 0x04, 0xeb, 0x16, - 0xa7, 0xad, 0x80, 0x0b, 0x1c, 0x08, 0x0f, 0xc7, 0x0a, 0x02, 0x11, 0x62, 0x27, 0xdb, 0x15, 0x29, - 0xce, 0x42, 0x26, 0x67, 0x05, 0x1e, 0xf4, 0x70, 0x87, 0xf4, 0xaa, 0x45, 0x19, 0x3b, 0xde, 0xc4, - 0x89, 0xf9, 0x9c, 0x56, 0x1f, 0x8c, 0x13, 0xf3, 0x39, 0x4d, 0x52, 0x2d, 0x4d, 0x53, 0xfd, 0x52, - 0xda, 0x75, 0x8e, 0x20, 0x95, 0x74, 0xca, 0x96, 0x68, 0xc6, 0xfe, 0x2e, 0x16, 0x78, 0x92, 0xa5, - 0x5c, 0x9b, 0xdf, 0x4b, 0xbc, 0x86, 0xeb, 0x1e, 0x61, 0xee, 0xa7, 0x60, 0x95, 0x79, 0x6f, 0x71, - 0xcd, 0x9e, 0x5c, 0x2b, 0x81, 0x4a, 0x7b, 0x92, 0x4e, 0x71, 0x9a, 0xce, 0x8f, 0x08, 0x36, 0xd5, - 0xf5, 0x7b, 0x3e, 0x12, 0xde, 0x80, 0x2d, 0x8b, 0xd3, 0x2c, 0x6e, 0xe5, 0xea, 0x33, 0x04, 0x9a, - 0xc5, 0xa9, 0xe5, 0xd1, 0x70, 0x19, 0x1b, 0xc4, 0xae, 0x9a, 0xbc, 0x33, 0xd1, 0xa6, 0xf6, 0xcb, - 0x59, 0x64, 0x62, 0x86, 0xe2, 0x22, 0x33, 0xbc, 0x0d, 0xfa, 0xac, 0x24, 0x65, 0x84, 0xe4, 0x73, - 0xa3, 0xd4, 0xe7, 0xfe, 0x4c, 0x7e, 0xee, 0xa4, 0x79, 0x60, 0x41, 0x06, 0x78, 0x98, 0xea, 0x21, - 0x57, 0xda, 0xce, 0xd5, 0x84, 0x26, 0xec, 0xab, 0x8a, 0xfd, 0x9d, 0x7f, 0xca, 0x50, 0xb0, 0x38, - 0xd5, 0x7e, 0x43, 0x50, 0x99, 0xdb, 0xd3, 0x3e, 0xad, 0x2d, 0x37, 0x12, 0x6a, 0x19, 0xfd, 0x4c, - 0x3f, 0xb8, 0x23, 0x80, 0x2a, 0xc5, 0xef, 0x08, 0x5e, 0xcd, 0x6e, 0x87, 0xbb, 0x39, 0x68, 0x32, - 0x51, 0xf4, 0x2f, 0xee, 0x03, 0x45, 0x29, 0xfe, 0x05, 0x41, 0x65, 0xde, 0xf0, 0xd3, 0xf6, 0x73, - 0xd0, 0x2c, 0x98, 0x9e, 0xfa, 0xc7, 0x39, 0x70, 0x66, 0x6e, 0x83, 0x94, 0x37, 0x6f, 0x66, 0xe6, - 0x92, 0xb7, 0x60, 0xe8, 0xde, 0x51, 0xde, 0x0f, 0xb0, 0x36, 0x9d, 0x3f, 0xef, 0xe5, 0x80, 0x52, - 0x51, 0xb9, 0x04, 0xcc, 0x4e, 0x9e, 0x5f, 0x11, 0xbc, 0x32, 0x6f, 0x6a, 0x7c, 0x92, 0x03, 0x75, - 0x4e, 0xbc, 0xbe, 0x7f, 0xb7, 0x78, 0xa5, 0xef, 0x0f, 0x04, 0x4f, 0x17, 0x35, 0xfd, 0x3c, 0x3c, - 0x0b, 0x70, 0xf4, 0xcf, 0x73, 0xe0, 0xdc, 0xd4, 0x82, 0xb5, 0x3f, 0x11, 0x18, 0x37, 0x4c, 0x8a, - 0x56, 0x6e, 0xfb, 0xfd, 0x3f, 0xd2, 0xcf, 0x10, 0x3c, 0xba, 0x3e, 0x3a, 0x3e, 0xca, 0x41, 0x70, - 0x2d, 0x56, 0x6f, 0xde, 0x3e, 0x36, 0x7d, 0x87, 0x9f, 0x2e, 0x9a, 0x04, 0xfb, 0xb7, 0xe8, 0xbe, - 0x73, 0x70, 0xf4, 0xf7, 0x97, 0xc5, 0xb9, 0xf2, 0x03, 0xd0, 0x3c, 0xfc, 0x6b, 0x64, 0xa0, 0xf3, - 0x91, 0x81, 0xfe, 0x1d, 0x19, 0xe8, 0xe7, 0x4b, 0x63, 0xe5, 0xfc, 0xd2, 0x58, 0xf9, 0xfb, 0xd2, - 0x58, 0xf9, 0xe6, 0x43, 0xea, 0x89, 0x6e, 0xd4, 0xa9, 0x39, 0xcc, 0xaf, 0x27, 0xc1, 0x6f, 0x4d, - 0xa1, 0xeb, 0x0a, 0xba, 0x7e, 0x5a, 0x9f, 0xfe, 0xa7, 0x0c, 0xfb, 0x84, 0x77, 0x4a, 0xf2, 0x6f, - 0xe3, 0xdd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x79, 0xba, 0x1f, 0x32, 0xc0, 0x0c, 0x00, 0x00, + proto.RegisterType((*EmptyResponse)(nil), "wormchain.wormhole.EmptyResponse") + proto.RegisterType((*MsgCreateAllowlistEntryRequest)(nil), "wormchain.wormhole.MsgCreateAllowlistEntryRequest") + proto.RegisterType((*MsgDeleteAllowlistEntryRequest)(nil), "wormchain.wormhole.MsgDeleteAllowlistEntryRequest") + proto.RegisterType((*MsgAllowlistResponse)(nil), "wormchain.wormhole.MsgAllowlistResponse") + proto.RegisterType((*MsgExecuteGovernanceVAA)(nil), "wormchain.wormhole.MsgExecuteGovernanceVAA") + proto.RegisterType((*MsgExecuteGovernanceVAAResponse)(nil), "wormchain.wormhole.MsgExecuteGovernanceVAAResponse") + proto.RegisterType((*MsgRegisterAccountAsGuardian)(nil), "wormchain.wormhole.MsgRegisterAccountAsGuardian") + proto.RegisterType((*MsgRegisterAccountAsGuardianResponse)(nil), "wormchain.wormhole.MsgRegisterAccountAsGuardianResponse") + proto.RegisterType((*MsgStoreCode)(nil), "wormchain.wormhole.MsgStoreCode") + proto.RegisterType((*MsgStoreCodeResponse)(nil), "wormchain.wormhole.MsgStoreCodeResponse") + proto.RegisterType((*MsgInstantiateContract)(nil), "wormchain.wormhole.MsgInstantiateContract") + proto.RegisterType((*MsgInstantiateContractResponse)(nil), "wormchain.wormhole.MsgInstantiateContractResponse") + proto.RegisterType((*MsgAddWasmInstantiateAllowlist)(nil), "wormchain.wormhole.MsgAddWasmInstantiateAllowlist") + proto.RegisterType((*MsgDeleteWasmInstantiateAllowlist)(nil), "wormchain.wormhole.MsgDeleteWasmInstantiateAllowlist") + proto.RegisterType((*MsgWasmInstantiateAllowlistResponse)(nil), "wormchain.wormhole.MsgWasmInstantiateAllowlistResponse") + proto.RegisterType((*MsgMigrateContract)(nil), "wormchain.wormhole.MsgMigrateContract") + proto.RegisterType((*MsgMigrateContractResponse)(nil), "wormchain.wormhole.MsgMigrateContractResponse") + proto.RegisterType((*MsgExecuteGatewayGovernanceVaa)(nil), "wormchain.wormhole.MsgExecuteGatewayGovernanceVaa") + proto.RegisterType((*MsgGuardianSetUpdateProposal)(nil), "wormchain.wormhole.MsgGuardianSetUpdateProposal") + proto.RegisterType((*MsgGovernanceWormholeMessageProposal)(nil), "wormchain.wormhole.MsgGovernanceWormholeMessageProposal") +} + +func init() { proto.RegisterFile("wormchain/wormhole/tx.proto", fileDescriptor_7262ffc699166207) } + +var fileDescriptor_7262ffc699166207 = []byte{ + // 1049 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xaf, 0xdb, 0x6c, 0x96, 0x4e, 0xd3, 0xee, 0xca, 0x44, 0x6d, 0xea, 0xae, 0x92, 0xd6, 0x0b, + 0xab, 0xd5, 0xa2, 0x4d, 0x96, 0xac, 0x58, 0xfe, 0xdc, 0x92, 0x6e, 0xb5, 0x2a, 0x92, 0x11, 0x72, + 0x80, 0x48, 0x5c, 0xaa, 0xa9, 0x3d, 0x3b, 0xb1, 0xb0, 0x3d, 0xc1, 0x33, 0x6e, 0x9a, 0x03, 0x12, + 0xe2, 0x82, 0xc4, 0x85, 0xe5, 0x9b, 0x70, 0x80, 0x13, 0x5f, 0x60, 0x8f, 0x2b, 0x4e, 0x88, 0x43, + 0x85, 0xd2, 0x03, 0x5f, 0x03, 0x79, 0x6c, 0x8f, 0xdd, 0xc4, 0x93, 0xa4, 0xb0, 0x12, 0x27, 0xcf, + 0x9b, 0x79, 0xef, 0xf7, 0x7b, 0x6f, 0xe6, 0xf9, 0xbd, 0x19, 0xb0, 0x37, 0x22, 0x81, 0x67, 0x0d, + 0xa0, 0xe3, 0xb7, 0xa2, 0xd1, 0x80, 0xb8, 0xa8, 0xc5, 0xce, 0x9b, 0xc3, 0x80, 0x30, 0xa2, 0xaa, + 0x62, 0xb1, 0x99, 0x2e, 0x6a, 0x07, 0x05, 0x06, 0x38, 0x84, 0x81, 0xed, 0x40, 0x3f, 0x36, 0xd3, + 0xaa, 0x98, 0x60, 0xc2, 0x87, 0xad, 0x68, 0x94, 0xcc, 0xee, 0x5a, 0x84, 0x7a, 0x84, 0x9e, 0xc4, + 0x0b, 0xb1, 0x90, 0x2c, 0xed, 0xc4, 0x52, 0xcb, 0xa3, 0xb8, 0x75, 0xf6, 0x6e, 0xf4, 0x89, 0x17, + 0xf4, 0x5b, 0x60, 0xf3, 0xc8, 0x1b, 0xb2, 0xb1, 0x89, 0xe8, 0x90, 0xf8, 0x14, 0xe9, 0xcf, 0x41, + 0xdd, 0xa0, 0xf8, 0x30, 0x40, 0x90, 0xa1, 0x8e, 0xeb, 0x92, 0x91, 0xeb, 0x50, 0x76, 0xe4, 0xb3, + 0x60, 0x6c, 0xa2, 0xaf, 0x43, 0x44, 0x99, 0xba, 0x0d, 0xca, 0xd4, 0xc1, 0x3e, 0x0a, 0x6a, 0xca, + 0xbe, 0x72, 0x7f, 0xdd, 0x4c, 0x24, 0xb5, 0x06, 0x6e, 0x42, 0xdb, 0x0e, 0x10, 0xa5, 0xb5, 0x55, + 0xbe, 0x90, 0x8a, 0xaa, 0x0a, 0x4a, 0x3e, 0xf4, 0x50, 0x6d, 0x8d, 0x4f, 0xf3, 0xb1, 0x6e, 0x72, + 0x9e, 0xa7, 0xc8, 0x45, 0xaf, 0x8d, 0x47, 0xdf, 0x06, 0x55, 0x83, 0x62, 0x81, 0x26, 0x62, 0x3a, + 0x04, 0x3b, 0x06, 0xc5, 0x47, 0xe7, 0xc8, 0x0a, 0x19, 0x7a, 0x46, 0xce, 0x50, 0xe0, 0x43, 0xdf, + 0x42, 0x5f, 0x74, 0x3a, 0xea, 0x6d, 0xb0, 0x76, 0x06, 0x21, 0x67, 0xa8, 0x98, 0xd1, 0x30, 0x47, + 0xbb, 0x9a, 0xa7, 0xd5, 0x0f, 0x40, 0x43, 0x02, 0x22, 0x78, 0x3e, 0x03, 0x77, 0x0c, 0x8a, 0x4d, + 0x84, 0x1d, 0xca, 0x50, 0xd0, 0xb1, 0x2c, 0x12, 0xfa, 0xac, 0x43, 0x9f, 0x25, 0x87, 0x27, 0x8d, + 0xe8, 0x0e, 0x58, 0x8f, 0x46, 0x90, 0x85, 0x41, 0xbc, 0x49, 0x15, 0x33, 0x9b, 0xd0, 0xef, 0x81, + 0xb7, 0xe6, 0xa1, 0x0a, 0xf6, 0x21, 0xa8, 0x18, 0x14, 0xf7, 0x18, 0x09, 0xd0, 0x21, 0xb1, 0x91, + 0x94, 0xed, 0x09, 0xd8, 0x1a, 0x41, 0xea, 0x9d, 0x9c, 0x8e, 0x19, 0x3a, 0xb1, 0x88, 0x8d, 0x78, + 0xa0, 0x95, 0xee, 0xed, 0xc9, 0x45, 0xa3, 0xd2, 0xef, 0xf4, 0x8c, 0xee, 0x98, 0x71, 0x04, 0xb3, + 0x12, 0xe9, 0xa5, 0x52, 0xba, 0x55, 0x6b, 0x62, 0xab, 0xf4, 0x3e, 0xdf, 0x6f, 0xc1, 0x98, 0x7a, + 0xa2, 0xde, 0x05, 0x37, 0x23, 0xdc, 0x13, 0xc7, 0xe6, 0xd4, 0xa5, 0x2e, 0x98, 0x5c, 0x34, 0xca, + 0x91, 0xca, 0xf1, 0x53, 0xb3, 0x1c, 0x2d, 0x1d, 0xdb, 0xaa, 0x06, 0xde, 0xb0, 0x06, 0xc8, 0xfa, + 0x8a, 0x86, 0x5e, 0xec, 0x80, 0x29, 0x64, 0xfd, 0x47, 0x05, 0x6c, 0x1b, 0x14, 0x1f, 0xfb, 0x94, + 0x41, 0x9f, 0x39, 0x30, 0xf2, 0xc0, 0x67, 0x01, 0xb4, 0xe4, 0x59, 0x91, 0xe3, 0x5c, 0x93, 0x72, + 0x56, 0xc1, 0x0d, 0x17, 0x9e, 0x22, 0xb7, 0x56, 0xe2, 0xb6, 0xb1, 0x10, 0x05, 0xe6, 0x51, 0x5c, + 0xbb, 0x11, 0x07, 0xe6, 0x51, 0x9c, 0x86, 0x5a, 0xce, 0x42, 0xfd, 0x84, 0xa7, 0x6b, 0x81, 0x43, + 0x22, 0xe8, 0x5c, 0x5a, 0x2a, 0x33, 0xe9, 0x6f, 0x43, 0x06, 0x93, 0x28, 0xf9, 0x58, 0xff, 0x86, + 0xe3, 0x75, 0x6c, 0xbb, 0x0f, 0xa9, 0x97, 0x83, 0x15, 0xc9, 0xfb, 0x2f, 0x7e, 0xb3, 0x9d, 0xa9, + 0x2d, 0x10, 0x61, 0x27, 0xe1, 0x94, 0xb2, 0x70, 0xbe, 0x55, 0xc0, 0x81, 0xf8, 0xfd, 0xfe, 0x1f, + 0x17, 0xde, 0x06, 0x77, 0x0d, 0x8a, 0x65, 0xdc, 0x22, 0xab, 0x7f, 0x52, 0x80, 0x6a, 0x50, 0x6c, + 0x38, 0x38, 0x58, 0x26, 0x0d, 0xa2, 0xac, 0x4a, 0x74, 0x12, 0xdf, 0x84, 0xbc, 0x5c, 0x8a, 0x24, + 0xc9, 0x50, 0x9a, 0x97, 0x0c, 0x8f, 0x80, 0x36, 0xeb, 0x92, 0x48, 0x84, 0xf4, 0xb8, 0x95, 0xdc, + 0x71, 0x7f, 0xcc, 0x8f, 0x3b, 0x2d, 0x1e, 0x90, 0xa1, 0x11, 0x1c, 0xe7, 0x6a, 0xc8, 0x95, 0xb2, + 0x73, 0x35, 0xa0, 0x84, 0x7d, 0x35, 0x63, 0xff, 0x55, 0xe1, 0x65, 0x26, 0xfd, 0xff, 0x7b, 0x88, + 0x7d, 0x3e, 0xb4, 0x21, 0x43, 0x9f, 0x06, 0x64, 0x48, 0x28, 0x74, 0xd5, 0x27, 0x60, 0x1d, 0x86, + 0x6c, 0x40, 0x02, 0x87, 0x8d, 0x63, 0xb4, 0x6e, 0xed, 0xf7, 0x5f, 0x1e, 0x56, 0x93, 0x8e, 0xd0, + 0x89, 0xcf, 0xaa, 0xc7, 0x02, 0xc7, 0xc7, 0x66, 0xa6, 0xaa, 0x1a, 0x60, 0xcb, 0x47, 0xa3, 0x1c, + 0x2e, 0x67, 0xdd, 0x68, 0x37, 0x9a, 0xb3, 0x5d, 0xaa, 0x99, 0x53, 0xeb, 0x96, 0x5e, 0x5e, 0x34, + 0x56, 0xcc, 0x29, 0xe3, 0x8f, 0xb6, 0xbe, 0xfb, 0xfb, 0xe7, 0x07, 0x19, 0xbc, 0xfe, 0xa7, 0xc2, + 0x0b, 0x59, 0x16, 0x76, 0x3f, 0xc1, 0x32, 0x10, 0xa5, 0x10, 0xff, 0x77, 0xff, 0xb7, 0x41, 0x19, + 0x5a, 0xcc, 0x21, 0x3e, 0xf7, 0x7b, 0xd3, 0x4c, 0xa4, 0x68, 0xde, 0x23, 0x76, 0xe8, 0xa6, 0xb5, + 0x35, 0x91, 0xd4, 0x7d, 0xb0, 0xc1, 0x60, 0x80, 0x11, 0x3b, 0x8c, 0x42, 0xe3, 0x47, 0xbe, 0x69, + 0xe6, 0xa7, 0xa2, 0x44, 0x1f, 0xc2, 0xb1, 0x4b, 0xa0, 0x9d, 0x54, 0x87, 0x54, 0x9c, 0x0e, 0xae, + 0xfd, 0xdb, 0x06, 0x58, 0x33, 0x28, 0x56, 0xcf, 0x41, 0xb5, 0xb0, 0xcf, 0xbc, 0x53, 0xb4, 0x87, + 0x92, 0x7e, 0xa2, 0x3d, 0xbe, 0x86, 0xb2, 0x48, 0xbb, 0xef, 0x15, 0xb0, 0x2b, 0x6f, 0x3d, 0x8f, + 0x24, 0x90, 0x52, 0x0b, 0xed, 0x83, 0xeb, 0x5a, 0x08, 0x4f, 0x18, 0xa8, 0x16, 0xdd, 0x1f, 0xd4, + 0xb6, 0x04, 0x71, 0xce, 0x65, 0x43, 0xbb, 0x2f, 0xb1, 0x99, 0x29, 0x14, 0x11, 0x6b, 0xd1, 0x6d, + 0x42, 0xca, 0x3a, 0xe7, 0xea, 0x71, 0x0d, 0xd6, 0x3e, 0x58, 0xcf, 0x3a, 0xee, 0xbe, 0xc4, 0x4c, + 0x68, 0x48, 0x81, 0x67, 0x7b, 0x68, 0x08, 0xde, 0x2c, 0x6a, 0x7f, 0x0f, 0x24, 0x00, 0x05, 0xba, + 0x5a, 0x7b, 0x79, 0x5d, 0x41, 0xfb, 0x83, 0x02, 0xf6, 0xe6, 0x75, 0x25, 0x19, 0xe6, 0x1c, 0x1b, + 0xed, 0x7d, 0x89, 0xcd, 0xa2, 0xda, 0xaf, 0xbe, 0x50, 0x40, 0x7d, 0x41, 0x8b, 0x7a, 0x6f, 0xee, + 0xe9, 0xbe, 0x7e, 0x97, 0x1c, 0x70, 0x6b, 0xba, 0x15, 0xdd, 0x93, 0x60, 0x4d, 0xe9, 0x69, 0xcd, + 0xe5, 0xf4, 0x72, 0x09, 0xbd, 0x37, 0xaf, 0x61, 0xb4, 0x17, 0x14, 0x89, 0x02, 0x1b, 0xed, 0xa0, + 0xc8, 0xe6, 0xca, 0xfd, 0x5f, 0x1d, 0x82, 0x5d, 0x79, 0x67, 0x91, 0x55, 0x11, 0xa9, 0xc5, 0x32, + 0x8c, 0xd1, 0x5d, 0x64, 0x71, 0x53, 0x90, 0x95, 0xa3, 0x85, 0x96, 0x4b, 0xb8, 0xd0, 0xed, 0xbd, + 0x9c, 0xd4, 0x95, 0x57, 0x93, 0xba, 0xf2, 0xd7, 0xa4, 0xae, 0xbc, 0xb8, 0xac, 0xaf, 0xbc, 0xba, + 0xac, 0xaf, 0xfc, 0x71, 0x59, 0x5f, 0xf9, 0xf2, 0x43, 0xec, 0xb0, 0x41, 0x78, 0xda, 0xb4, 0x88, + 0x27, 0x5e, 0x63, 0x0f, 0x9f, 0x93, 0xd0, 0xb7, 0x61, 0xd4, 0x5b, 0x5a, 0xd9, 0x5b, 0xed, 0x3c, + 0xf7, 0xbc, 0x1b, 0x0f, 0x11, 0x3d, 0x2d, 0xf3, 0x17, 0xd6, 0xe3, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x87, 0x35, 0x59, 0x4b, 0x01, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1107,12 +1261,16 @@ type MsgClient interface { DeleteAllowlistEntry(ctx context.Context, in *MsgDeleteAllowlistEntryRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) // StoreCode to submit Wasm code to the system StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. + // Instantiate creates a new smart contract instance for the given code id. InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) AddWasmInstantiateAllowlist(ctx context.Context, in *MsgAddWasmInstantiateAllowlist, opts ...grpc.CallOption) (*MsgWasmInstantiateAllowlistResponse, error) DeleteWasmInstantiateAllowlist(ctx context.Context, in *MsgDeleteWasmInstantiateAllowlist, opts ...grpc.CallOption) (*MsgWasmInstantiateAllowlistResponse, error) MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) ExecuteGatewayGovernanceVaa(ctx context.Context, in *MsgExecuteGatewayGovernanceVaa, opts ...grpc.CallOption) (*EmptyResponse, error) + // GuardianSetUpdateProposal processes a proposal to update the guardian set + GuardianSetUpdateProposal(ctx context.Context, in *MsgGuardianSetUpdateProposal, opts ...grpc.CallOption) (*EmptyResponse, error) + // GovernanceWormholeMessageProposal processes a proposal to emit a generic message + GovernanceWormholeMessageProposal(ctx context.Context, in *MsgGovernanceWormholeMessageProposal, opts ...grpc.CallOption) (*EmptyResponse, error) } type msgClient struct { @@ -1125,7 +1283,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) ExecuteGovernanceVAA(ctx context.Context, in *MsgExecuteGovernanceVAA, opts ...grpc.CallOption) (*MsgExecuteGovernanceVAAResponse, error) { out := new(MsgExecuteGovernanceVAAResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/ExecuteGovernanceVAA", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/ExecuteGovernanceVAA", in, out, opts...) if err != nil { return nil, err } @@ -1134,7 +1292,7 @@ func (c *msgClient) ExecuteGovernanceVAA(ctx context.Context, in *MsgExecuteGove func (c *msgClient) RegisterAccountAsGuardian(ctx context.Context, in *MsgRegisterAccountAsGuardian, opts ...grpc.CallOption) (*MsgRegisterAccountAsGuardianResponse, error) { out := new(MsgRegisterAccountAsGuardianResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/RegisterAccountAsGuardian", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/RegisterAccountAsGuardian", in, out, opts...) if err != nil { return nil, err } @@ -1143,7 +1301,7 @@ func (c *msgClient) RegisterAccountAsGuardian(ctx context.Context, in *MsgRegist func (c *msgClient) CreateAllowlistEntry(ctx context.Context, in *MsgCreateAllowlistEntryRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) { out := new(MsgAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/CreateAllowlistEntry", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/CreateAllowlistEntry", in, out, opts...) if err != nil { return nil, err } @@ -1152,7 +1310,7 @@ func (c *msgClient) CreateAllowlistEntry(ctx context.Context, in *MsgCreateAllow func (c *msgClient) DeleteAllowlistEntry(ctx context.Context, in *MsgDeleteAllowlistEntryRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) { out := new(MsgAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/DeleteAllowlistEntry", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/DeleteAllowlistEntry", in, out, opts...) if err != nil { return nil, err } @@ -1161,7 +1319,7 @@ func (c *msgClient) DeleteAllowlistEntry(ctx context.Context, in *MsgDeleteAllow func (c *msgClient) StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) { out := new(MsgStoreCodeResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/StoreCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/StoreCode", in, out, opts...) if err != nil { return nil, err } @@ -1170,7 +1328,7 @@ func (c *msgClient) StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grp func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) { out := new(MsgInstantiateContractResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/InstantiateContract", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/InstantiateContract", in, out, opts...) if err != nil { return nil, err } @@ -1179,7 +1337,7 @@ func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateC func (c *msgClient) AddWasmInstantiateAllowlist(ctx context.Context, in *MsgAddWasmInstantiateAllowlist, opts ...grpc.CallOption) (*MsgWasmInstantiateAllowlistResponse, error) { out := new(MsgWasmInstantiateAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/AddWasmInstantiateAllowlist", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/AddWasmInstantiateAllowlist", in, out, opts...) if err != nil { return nil, err } @@ -1188,7 +1346,7 @@ func (c *msgClient) AddWasmInstantiateAllowlist(ctx context.Context, in *MsgAddW func (c *msgClient) DeleteWasmInstantiateAllowlist(ctx context.Context, in *MsgDeleteWasmInstantiateAllowlist, opts ...grpc.CallOption) (*MsgWasmInstantiateAllowlistResponse, error) { out := new(MsgWasmInstantiateAllowlistResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/DeleteWasmInstantiateAllowlist", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/DeleteWasmInstantiateAllowlist", in, out, opts...) if err != nil { return nil, err } @@ -1197,7 +1355,7 @@ func (c *msgClient) DeleteWasmInstantiateAllowlist(ctx context.Context, in *MsgD func (c *msgClient) MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) { out := new(MsgMigrateContractResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/MigrateContract", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/MigrateContract", in, out, opts...) if err != nil { return nil, err } @@ -1206,7 +1364,25 @@ func (c *msgClient) MigrateContract(ctx context.Context, in *MsgMigrateContract, func (c *msgClient) ExecuteGatewayGovernanceVaa(ctx context.Context, in *MsgExecuteGatewayGovernanceVaa, opts ...grpc.CallOption) (*EmptyResponse, error) { out := new(EmptyResponse) - err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/ExecuteGatewayGovernanceVaa", in, out, opts...) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/ExecuteGatewayGovernanceVaa", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GuardianSetUpdateProposal(ctx context.Context, in *MsgGuardianSetUpdateProposal, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/GuardianSetUpdateProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GovernanceWormholeMessageProposal(ctx context.Context, in *MsgGovernanceWormholeMessageProposal, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/wormchain.wormhole.Msg/GovernanceWormholeMessageProposal", in, out, opts...) if err != nil { return nil, err } @@ -1221,12 +1397,16 @@ type MsgServer interface { DeleteAllowlistEntry(context.Context, *MsgDeleteAllowlistEntryRequest) (*MsgAllowlistResponse, error) // StoreCode to submit Wasm code to the system StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. + // Instantiate creates a new smart contract instance for the given code id. InstantiateContract(context.Context, *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) AddWasmInstantiateAllowlist(context.Context, *MsgAddWasmInstantiateAllowlist) (*MsgWasmInstantiateAllowlistResponse, error) DeleteWasmInstantiateAllowlist(context.Context, *MsgDeleteWasmInstantiateAllowlist) (*MsgWasmInstantiateAllowlistResponse, error) MigrateContract(context.Context, *MsgMigrateContract) (*MsgMigrateContractResponse, error) ExecuteGatewayGovernanceVaa(context.Context, *MsgExecuteGatewayGovernanceVaa) (*EmptyResponse, error) + // GuardianSetUpdateProposal processes a proposal to update the guardian set + GuardianSetUpdateProposal(context.Context, *MsgGuardianSetUpdateProposal) (*EmptyResponse, error) + // GovernanceWormholeMessageProposal processes a proposal to emit a generic message + GovernanceWormholeMessageProposal(context.Context, *MsgGovernanceWormholeMessageProposal) (*EmptyResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1263,6 +1443,12 @@ func (*UnimplementedMsgServer) MigrateContract(ctx context.Context, req *MsgMigr func (*UnimplementedMsgServer) ExecuteGatewayGovernanceVaa(ctx context.Context, req *MsgExecuteGatewayGovernanceVaa) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteGatewayGovernanceVaa not implemented") } +func (*UnimplementedMsgServer) GuardianSetUpdateProposal(ctx context.Context, req *MsgGuardianSetUpdateProposal) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GuardianSetUpdateProposal not implemented") +} +func (*UnimplementedMsgServer) GovernanceWormholeMessageProposal(ctx context.Context, req *MsgGovernanceWormholeMessageProposal) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernanceWormholeMessageProposal not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1278,7 +1464,7 @@ func _Msg_ExecuteGovernanceVAA_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/ExecuteGovernanceVAA", + FullMethod: "/wormchain.wormhole.Msg/ExecuteGovernanceVAA", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).ExecuteGovernanceVAA(ctx, req.(*MsgExecuteGovernanceVAA)) @@ -1296,7 +1482,7 @@ func _Msg_RegisterAccountAsGuardian_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/RegisterAccountAsGuardian", + FullMethod: "/wormchain.wormhole.Msg/RegisterAccountAsGuardian", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RegisterAccountAsGuardian(ctx, req.(*MsgRegisterAccountAsGuardian)) @@ -1314,7 +1500,7 @@ func _Msg_CreateAllowlistEntry_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/CreateAllowlistEntry", + FullMethod: "/wormchain.wormhole.Msg/CreateAllowlistEntry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateAllowlistEntry(ctx, req.(*MsgCreateAllowlistEntryRequest)) @@ -1332,7 +1518,7 @@ func _Msg_DeleteAllowlistEntry_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/DeleteAllowlistEntry", + FullMethod: "/wormchain.wormhole.Msg/DeleteAllowlistEntry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeleteAllowlistEntry(ctx, req.(*MsgDeleteAllowlistEntryRequest)) @@ -1350,7 +1536,7 @@ func _Msg_StoreCode_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/StoreCode", + FullMethod: "/wormchain.wormhole.Msg/StoreCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).StoreCode(ctx, req.(*MsgStoreCode)) @@ -1368,7 +1554,7 @@ func _Msg_InstantiateContract_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/InstantiateContract", + FullMethod: "/wormchain.wormhole.Msg/InstantiateContract", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).InstantiateContract(ctx, req.(*MsgInstantiateContract)) @@ -1386,7 +1572,7 @@ func _Msg_AddWasmInstantiateAllowlist_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/AddWasmInstantiateAllowlist", + FullMethod: "/wormchain.wormhole.Msg/AddWasmInstantiateAllowlist", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AddWasmInstantiateAllowlist(ctx, req.(*MsgAddWasmInstantiateAllowlist)) @@ -1404,7 +1590,7 @@ func _Msg_DeleteWasmInstantiateAllowlist_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/DeleteWasmInstantiateAllowlist", + FullMethod: "/wormchain.wormhole.Msg/DeleteWasmInstantiateAllowlist", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeleteWasmInstantiateAllowlist(ctx, req.(*MsgDeleteWasmInstantiateAllowlist)) @@ -1422,7 +1608,7 @@ func _Msg_MigrateContract_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/MigrateContract", + FullMethod: "/wormchain.wormhole.Msg/MigrateContract", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MigrateContract(ctx, req.(*MsgMigrateContract)) @@ -1440,7 +1626,7 @@ func _Msg_ExecuteGatewayGovernanceVaa_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/ExecuteGatewayGovernanceVaa", + FullMethod: "/wormchain.wormhole.Msg/ExecuteGatewayGovernanceVaa", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).ExecuteGatewayGovernanceVaa(ctx, req.(*MsgExecuteGatewayGovernanceVaa)) @@ -1448,8 +1634,45 @@ func _Msg_ExecuteGatewayGovernanceVaa_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Msg_GuardianSetUpdateProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGuardianSetUpdateProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GuardianSetUpdateProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormchain.wormhole.Msg/GuardianSetUpdateProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GuardianSetUpdateProposal(ctx, req.(*MsgGuardianSetUpdateProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_GovernanceWormholeMessageProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovernanceWormholeMessageProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovernanceWormholeMessageProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormchain.wormhole.Msg/GovernanceWormholeMessageProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovernanceWormholeMessageProposal(ctx, req.(*MsgGovernanceWormholeMessageProposal)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wormhole_foundation.wormchain.wormhole.Msg", + ServiceName: "wormchain.wormhole.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1492,9 +1715,17 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ExecuteGatewayGovernanceVaa", Handler: _Msg_ExecuteGatewayGovernanceVaa_Handler, }, + { + MethodName: "GuardianSetUpdateProposal", + Handler: _Msg_GuardianSetUpdateProposal_Handler, + }, + { + MethodName: "GovernanceWormholeMessageProposal", + Handler: _Msg_GovernanceWormholeMessageProposal_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "wormhole/tx.proto", + Metadata: "wormchain/wormhole/tx.proto", } func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { @@ -2160,6 +2391,100 @@ func (m *MsgExecuteGatewayGovernanceVaa) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgGuardianSetUpdateProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGuardianSetUpdateProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGuardianSetUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.NewGuardianSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGovernanceWormholeMessageProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGovernanceWormholeMessageProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovernanceWormholeMessageProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintTx(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x2a + } + if m.TargetChain != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TargetChain)) + i-- + dAtA[i] = 0x20 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintTx(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0x1a + } + if m.Action != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2476,6 +2801,48 @@ func (m *MsgExecuteGatewayGovernanceVaa) Size() (n int) { return n } +func (m *MsgGuardianSetUpdateProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.NewGuardianSet.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgGovernanceWormholeMessageProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Action != 0 { + n += 1 + sovTx(uint64(m.Action)) + } + l = len(m.Module) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.TargetChain != 0 { + n += 1 + sovTx(uint64(m.TargetChain)) + } + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4529,6 +4896,309 @@ func (m *MsgExecuteGatewayGovernanceVaa) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgGuardianSetUpdateProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGuardianSetUpdateProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGuardianSetUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewGuardianSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewGuardianSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovernanceWormholeMessageProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGovernanceWormholeMessageProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovernanceWormholeMessageProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + m.Action = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Action |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = append(m.Module[:0], dAtA[iNdEx:postIndex]...) + if m.Module == nil { + m.Module = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetChain", wireType) + } + m.TargetChain = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetChain |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0